Professional Documents
Culture Documents
Page 2 of 80
Table of Contents
1
Overview .......................................................................................................................................7
1.2
Background ..................................................................................................................................7
1.3
1.4
2
WSDL ...........................................................................................................................................8
2.2
2.3
2.3.4.2
2.3.5
2.3.5.1
2.3.5.2
2.3.5.3
2.3.4.1.1
2.3.4.1.2
2.3.4.1.3
2.4
3
API Summary..............................................................................................................................22
3.1.1
3.1.2
3.1.3
3.1.4
3.1.5
Page 3 of 80
3.3
3.4
Page 4 of 80
3.5
3.6
ObjectEditResult .................................................................................................................... 44
Insert ............................................................................................................................................. 45
Supported Parameters ........................................................................................................... 45
Example Java Code ............................................................................................................... 46
Example SOAP Request XML ............................................................................................... 47
Example SOAP Response XML............................................................................................. 48
Example SOAP Failed Response .......................................................................................... 48
Update ........................................................................................................................................... 49
Supported Parameters ........................................................................................................... 49
Example SOAP Request XML ............................................................................................... 50
Example SOAP Response XML............................................................................................. 50
Example SOAP Failed Response .......................................................................................... 51
Upsert ............................................................................................................................................ 52
Supported Parameters ........................................................................................................... 52
Example Java Code ............................................................................................................... 52
Example SOAP Request XML ............................................................................................... 53
Example SOAP Response XML............................................................................................. 55
Example SOAP Failed Response .......................................................................................... 55
Delete ............................................................................................................................................ 56
Supported Parameters ........................................................................................................... 56
Example Java Code ............................................................................................................... 57
Example SOAP Request XML ............................................................................................... 57
Example SOAP Response XML............................................................................................. 58
Example SOAP Failed Response .......................................................................................... 58
API Signature................................................................................................................................. 59
API Framework Objects ................................................................................................................. 60
QueryResult ........................................................................................................................... 60
Query ............................................................................................................................................ 60
Supported Parameters ........................................................................................................... 61
Optional SFParameter Values For Query .............................................................................. 61
Example Java Code ............................................................................................................... 61
Example SOAP Request XML ............................................................................................... 63
Example SOAP Response XML............................................................................................. 63
Example SOAP Failed Response .......................................................................................... 65
QueryMore .................................................................................................................................... 65
Supported Parameters ........................................................................................................... 66
Example Java Code............................................................................................................... 66
Example SOAP Request XML ............................................................................................... 66
Example SOAP Response XML............................................................................................. 66
Example SOAP Failed Response .......................................................................................... 67
SuccessFactors Query Language ................................................................................................. 68
Overview ................................................................................................................................ 68
SFQL Grammar ..................................................................................................................... 68
Page 5 of 80
Page 6 of 80
1 Introduction to SFAPI
1.1 Overview
This document is the functional guide for SFAPI developers. This guide provides an
overview of the SFAPI, technical information on how to use the SFAPI, details of the Web
Service methods and the framework objects.
1.2 Background
The SFAPI is SuccessFactors Data API. It is a SOAP Web Service designed for importing
and exporting data to and from your SuccessFactors instance. It provides generic CRUD
(Create, Read, Update, Delete) operations to access data, as well as meta-data operations
to allow runtime discovery of the data.
Data are exposed as entities called SFObjects, which are conceptually analogous to
database tables. Using the meta-data operations, you can list the SFObjects available to
the API, and describe the fields in these entities. Using the CRUD operations you can
query or edit the data.
The combination of CRUD style data access operations along with meta-data driven
operations for data discovery provides a generic API that offers the following benefits:
1. Provide a consistent mechanism for accessing data in the SuccessFactors
platform.
2. Provide a mechanism to describe the data schema configuration, including the
entities that are available and fields that appear in these entities.
3. Avoid WSDL changes with each release.
DC# Site
2
EU
Production
(Premium)
URLs
https://api.successfactors.eu/sfapi/v1/soap
https://api.successfactors.eu/sfapi/v1/soap12
https://api2.successfactors.eu/sfapi/v1/soap
https://api2.successfactors.eu/sfapi/v1/soap12
(Both https://api.successfactors.eu and
Page 7 of 80
Arizona
EMEA
Amsterdam
(ASM-5)
US
Ashburn
APJ
Sydney
10
EMEA
Rot
12
AZ
Production
(Standard)
AZ
Salesdemo
EU
Production
(Standard)
Ashburn
Production
(Premium)
Ashburn
Salesdemo
Sydney
Production
(Premium)
Rot
Production
(Standard)
1.4 WSDL
The WSDL can be accessed by appending "?wsdl" to any of the endpoints listed above.
For example: https://api4.successfactors.com/sfapi/v1/soap?wsdl
Page 8 of 80
2 Using SFAPI
2.1 SFAPI Setup
2.1.1 Enabling SFAPI
In order to use the SFAPI, SuccessFactors must enable the API for your company
instance. Please contact your SuccessFactors support representative details to enable the
SFAPI for your instance.
Page 9 of 80
Page 10 of 80
Page 11 of 80
To add API login exception to the password policy, select the Add button in the top left of
the expanded section. This will bring up the following dialog.
Page 12 of 80
Here you can add a user-specify password expiration. You must provide a username, and the desired
maximum password age in days (-1 means the password will not expire, though we do not recommend
this). You must also provide IP address restrictions for this user.
Page 13 of 80
2.2.2 Authorization
Access to different objects in the API will require the related permissions for authorization.
Authorizations in the SFAPI are administrative in nature. This means that the permissions
required to access data through the SFAPI are appropriate for administrative access,
granting access to broad sets of data. These permission are not appropriate for end users.
For example, to insert to the User entity, you need to grant the "Import Employee"
administrative permission by using Admin Tools > Manage Security > Administrative
Privileges > Manage Users > Import Employee to the SFAPI user link.
This makes the SFAPI useful for data integrations between systems. However the SFAPI
does not provide use cases appropriate for non-administrative access (aka normal end
users).
Refer to the SFAPI Data Dictionary documentation to understand the permissions required
for various API operations on each entity.
Page 15 of 80
Page 16 of 80
Page 17 of 80
The links can be accessed from here in the new Admin Page as shown.
This page will show the last 10,000 API calls to this system. For each call, you can view
the actual payload of data sent across. For example, if a call was to import Users, you
could see the user data that was sent in the import call. The payload information can be
viewed by selecting the button under the "SOAP" or "HTTP" columns in the log table. This
will show you the actual SOAP payload or the raw HTTP payload details.
IMPORTANT: Since this is sensitive data, care should be taken when granting permission
on who can see this audit log.
One safe strategy would be to grant this feature to developers only when necessary for
development and debugging purposes, and then remove access to this feature.
NOTE: that the log will always be captured, regardless of whether a particular user may
see the log or not. Therefore, removing a user's access to the log will not remove the
actual data in the log.
Page 19 of 80
You can view API call history in time intervals selected at the top of the screen, ranging
from 6 hours to 30 days. Here we have a selected a 6 hour time interval. You can also vary
the information presented by using the text drop-down at the top left of the screen. Here
we have selected "Call Count". You can also view record count (useful to see how many
rows of data were accessed in either import or queries), bandwidth, and call processing
time statistics..
This will allow you to view all the entities and fields as configured in your instance of SF.
Note that in November, 2012 we plan to release a separate document API ENTITY TYPE
GUIDE, which will give entity specific details like business context and permission
configuration details for each entity.
Page 20 of 80
Page 21 of 80
3 SFAPI Operations
3.1 API Summary
The SFAPI is intended to address import and export of SuccessFactors data. It is designed
in a generic approach. The data that you can access from the API is not defined in the
WSDL. Instead you can use the API metadata operations to discover the data and its
schema in your SuccessFactors instance.
There are five categories of methods in the API:
1.
2.
3.
4.
5.
Each of the operations above are documented in detail in the following sections.
Page 22 of 80
Page 23 of 80
Description
Boolean isValidSession()
3.2.2.1 LoginResult
Extended from the SFObject.
Name
Description
error
msUntilPwdExpiration The number of the ms (milliseconds) until the password will expire.
sessionId
3.2.2.2 SFCredential
Name
Description
companyId
Page 24 of 80
Username for a valid user in the specified client instance. The user should have
API Login Permission, and permissions to access any desired data. See more
details in the Security
Overview section in the chapter on Using SFAPI.
3.2.2.3 SFParameter
SFParameter is a generic name/value container object, with the following fields:
Name
Description
Name
Value
3.2.3 Login
LoginResult login( SFCredential credential, List<SFParameters> params)
Creates the SFAPI session. A successful API session is required for any subsequent API
calls.
Type
Description
credential
SFCredential
params
List<SFParameters>
Description
Page 25 of 80
An integer
from 1 to 800
Page 26 of 80
Page 27 of 80
3.2.4 LogOut
boolean logout()
Destroys the current API session.
Page 28 of 80
Page 29 of 80
Description
DescribeResult[ ] describe(String[]
types, List<SFParameter> params )
List<String> list()
Description
error
feature
field
An array of fields found in the SFObject. The Field object contains metadata
about the field like field name, data type, etc. See the Field object definition
for more information.
type
Page 30 of 80
Description
dataType
Integer
Long
Float
Double
String
Boolean
Date (with date only)
DateTime (with both date and time)
Binary
label
maxlength
name
picklist
required
Description
Boolean type
Page 31 of 80
Double type(Signed)
Float type(Signed)
Integer type(Signed)
Long type(Signed)
String type
3.3.2.4 Picklist
Picklist has the following properties:
Name
Type
Description
id
String
picklistOptions
PicklistOption [ ]
source
String
Page 32 of 80
Name
Type
Description
externalCode
String
Integer
labels
Label [ ]
status
String
value
Integer
3.3.2.6 Label
A localized label object. Label contains the following properties:
Name
Type
locale
String
Description
Optional. The locale for this label, where
the locale = language code + "_" + country
code + "_" + variant. The language code
should adhere to ISO 639, the country
code to ISO 3166. Variant has no
requirements on format. The following are
valid locale strings:
"en" - English language
"en_US" - English language specific to the
US "en_US_CA" - English in California,
U.S.A.
mime-type
String
value
String
Page 33 of 80
3.3.4 Describe
DescribeResult describe(String type[], SFParameter params[])
Returns metadata about the list of entities specified in the type parameter.
Page 35 of 80
Type
Description
params
List <SFParameters>
type
String [ ]
Page 37 of 80
Page 38 of 80
3.3.5 DescribeEx
DescribeExResult describeEx(String type[], SFParameter params[])
This method is in beta development and will change in the 1109 release. It will be an
extended version of the describe method.
Type
Description
params
List <SFParameters>
type
String [ ]
Page 39 of 80
Page 41 of 80
Description
Page 42 of 80
Type
Description
any
List<Object>
id
String
type
String
3.4.2.2 SFParameter
SFParameter is a generic structure used to pass in name - value pairs of information to
control method processing. For example, in user import you can pass in a parameter to
control whether welcome messages are sent to new users.
SFParameter has the following properties:
Property Name
Type
Description
Name
String
Value
String
Page 43 of 80
Type
Description
jobStatus
String
OK
ERROR
String
objectEditResult
3.4.2.4 ObjectEditResult
ObjectEditResult is used to contain the results and status of edit related calls on an object.
ObjectEditResult has the following properties:
Name
Page 44 of 80
Type
Description
String
OK
ERROR
NO_MATCH (only in Update or
Delete operations)
Integer
editStatus
String
message
String
CREATED
UPDATED
DELETED
NO_EDIT
3.4.3 Insert
InsertResult insert(String type, SFObject[] objects, SFParameter[] processingParam)
Insert the list of SFObjects. Errors will be reported if the rows already exist in the system.
Type
Description
objects
SFObject [ ]
Page 45 of 80
List <SFParameters>
type
String
Page 46 of 80
Page 47 of 80
Page 48 of 80
3.4.4 Update
UpdateResult update(String type, SFObject[] objects, SFParameter[]
processingParam)
Updates the objects of the specified entity type. The operation will resume if one row has
failed to update.
Type
Description
objects
SFObject [ ]
processingParam
List <SFParameters>
type
String
Page 49 of 80
Page 50 of 80
Page 51 of 80
3.4.5 Upsert
UpsertResult upsert(String type, SFObject[] objects, SFParameter[]
processingParam)
Inserts or updates the objects of the specified entity type. If the row doesn't exist, perform
the insert operation, if the row exists, perform the update operation. The operation will
resume if one row has failed to upsert.
Type
Description
objects
SFObject [ ]
processingParam
List <SFParameters>
type
String
Page 52 of 80
Page 53 of 80
Page 55 of 80
3.4.6 Delete
3.4.6.1 Supported Parameters
Page 56 of 80
Parameter Name
Type
Description
Objects
SFObject [ ]
processingParam
List <SFParameters>
Type
String
Page 57 of 80
Page 58 of 80
Signature
Description
Page 59 of 80
Type
Description
hasMore
boolean
numResults
int
querySessionId
String
sfobject
SFObject[]
3.5.3 Query
QueryResult query(String queryString, SFParameter[] param)
Queries the SuccessFactors system with the given query string in SFQL (SuccessFactors
Query Language). For detail grammar description, please check the related section in this
reference guide.
The following is an example query String:
SELECT FirstName, LastName, JobCode, Title FROM User WHERE externalId = 'cgrant'.
The QueryResult object will contain the first page of results. Paging through the remaining
results is accomplished using the queryMore() operation. The QueryResult object will
return a boolean parameter "hasMorePages" to indicate if there are more pages remaining
and a querySessionId, which must be passed into the queryMore() method to get the next
page of results.
Page 60 of 80
SFParameter Value
Description
maxRows
Page 61 of 80
* @param numRowsToPrint
*
* @param startRowIndex
*
*/
public static void dumpQueryResult(QueryResult result, int numRowsToPrint, int
startRowIndex) {
System.out.println("The number of the records in a query: " + result.getNumResults());
int index = 0;
for (SFObject sfobject : result.getSfobject()) {
index++;
if (index > numRowsToPrint) {
continue;
}
System.out.print("Row#" + String.valueOf(index + startRowIndex));
System.out.println("(Id:" + sfobject.getId() + ", Type:" + sfobject.getType() +
")");
for (Object fieldObject : sfobject.getAny()) {
if (fieldObject instanceof Element) {
Element field = (Element) fieldObject;
System.out.print("\t" + field.getLocalName());
if ("true".equals( field.getAttributeNS(
XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI,
"nil"))) {
System.out.println("=<NULL>");
} else {
Page 62 of 80
Page 63 of 80
3.5.4 QueryMore
QueryResult queryMore(String querySessionId)
The queryMore operation is used to support paging through results generated by the query
operation.
Like the query operation, the queryMore operation also returns a QueryResult object,
which contains the next page of results, and a hasMoreResults parameter to indicate if
there are more results, along with a new querySessionId to be used in the next queryMore
call.
Page 65 of 80
Page 66 of 80
Page 67 of 80
Description
TaskStatus submitQueryJob(String
queryString, SFParameter[] param)
Page 69 of 80
TaskStatus[] listJobs()
Type
Description
taskId
String
taskName
String
createDate
String
status
TaskStatusEnum
taskResult
Page 70 of 80
TaskResultStatus
unsubmitted
submitted
processing
finished
failed
undefined
cancelled
deleted
3.6.3 SubmitQueryJob
TaskStatus submitQueryJob(String queryString, SFParameter[] param)
Submit the asynchronous query job to the SuccessFactors platform with the given query
string in SFQL (SuccessFactors Query Language). TaskStatus includes taskId which is
used to identify a submitted job. For a detailed grammar description, please check the
related section in this reference guide.
TaskStatus includes the information of submitted task.
Page 71 of 80
3.6.4 GetJobStatus
TaskStatus getJobStatus(String taskId)
Get the execution status of the submitted asynchronous job.
All rights reserved.
Page 73 of 80
Page 74 of 80
Type
Description
taskId
String
format
String
Page 75 of 80
3.6.6 ListJobs
List<TaskStatus> listJobs()
List all running and waiting to run jobs.
Page 76 of 80
Page 77 of 80
Page 78 of 80
3.6.7 CancelJob
TaskStatus cancelJob(String taskId)
Cancel a waiting to run job.
Page 79 of 80
Page 80 of 80