Professional Documents
Culture Documents
Document History
Version No. Date Revision Description
Abhijeet Routray
Contents
1. Introduction ...................................................................................................................................... 2
2. Overview ........................................................................................................................................... 2
3. OData Operations ............................................................................................................................. 3
4. Composing the OData URI ................................................................................................................ 4
5. Querying with key predicate and system query options .................................................................. 5
6. Configuring SuccessFactors Adapter using message protocol OData V2 ......................................... 6
7. OData API Dictionary ...................................................................................................................... 13
8. Conclusion ....................................................................................................................................... 13
9. References ...................................................................................................................................... 13
2. Overview
Open Data Protocol (OData) is a standardized protocol for creating and consuming data APIs. OData
builds on core protocols like HTTP, and commonly accepted methodologies like REST. The result is a
uniform way to expose full-featured data APIs. OData provides both a standard for how to represent
your data and a metadata method to describe the structure of your data, and the operations available
in your API. SuccessFactors OData API service is based on OData V2.0.
This is where OData is very useful. OData advocates a standard way of implementing REST APIs that
allows for SQL-like querying capabilities using these RESTful APIs. OData is essentially SQL for the web
built on top of standard protocols – HTTP, JSON & ATOM – while leveraging the REST architecture
style.
Below is an example of a list of data centers with location and time zone information:
To log in with Basic Auth, you must have the Allow Admin to Access OData API through Basic
Authentication permission.
3. OData Operations
The OData API is a standardized protocol for accessing a database. The Entities in the API are described
in the metadata document. Accessing the Entities is as simple as knowing the entity name, and then
referencing the entity through an HTTP call. For example, all SuccessFactors HCM Suite solutions have
a User Entity that represents a user account. To query all the users in a system, you type the URL
https://<hostname>/odata/v2/User
A query can be more complex by including filtering, paging, sorting, and joining of entities (known as
expanding in OData).
• EntitySet: Name of the OData API entity. An entity set represents the resource exposed by the
OData API.
• KeyPredicate: A predicate that identifies the key property of the entity. If an entity has a single
key property, the key predicate may only include the value of the property. If the entity has a
composite key, that is, the entity has multiple key properties, the key predicate must include the
key/value pairs to identify an entry. For more information, see Querying with Key Predicate
[page 40].
Note that when a key predicate is present in a URI, the $filter query option will be disregarded.
• navPropSingle: The name of a navigation property defined by the entry associated with the
prior path segment. The navPropSingle must identify a single entity (that is, have a "to 1"
relationship).
• NavPropCollection: Same as NavPropSingle except it must identify a collection of entries (that is,
have a "to many" relationship).
• ComplexType: The name of a property of the entity or complex type associated with the prior
path segment.
• Property: The name of a property of the entity or complex type associated with the prior path
segment.
The following table contains examples of a URI and a description of its composition:
http://<hostname>/odata/v2/User('1')
• Identifies a single User entry with key
value 1.
http://<hostname>/odata/v2/User('1')/usernam
e • Identifies the username property of the
User entry with key value 1.
• $filter
• $top
• $skip
• $orderby
$filter:
You can use the $filter system query option in the URI to limit the number of results returned in an
OData API query. For example, the following URI filters the status field in the User entity to return all
active users:
https://<API-Server>/odata/v2/User?$filter=status eq 't'
$orderby:
Below is an example of the $orderby system query option used in a URI.
$skip:
1. Start Timer: Timer start event is used for triggering the iflow without using any sender at the
start.
Adapter Configurations:
Address: URL of the SuccessFactors data center that you're connecting to. You can browse and select a
SuccessFactors data center URL by using the Select option.
Address Suffix: The field is auto populated with /odata/v2. Don't edit the field.
Proxy Type: Use Proxy Type as Internet, other options are irrelevant for this adapter.
In this iflow we are fetching data from SuccessFactors, hence operation ‘Query’ has been configured.
Query option(OData query) is auto populated once step 2 is complete in the pop up.
You could observe that the Address field has been pre-populated by reading the Address value of
adapter specific details. All other configurations will also get auto populated.
You can select or type the entity name, e.g.perPersonal. Let the operation be Query(GET). Furthermore,
you are required to select the required fields from the particular entity.
Based upon your selected fields, query will be automatically generated in the query table as shown
below.
Once done, you can move on to step 3 for configuring filter and sorting functionalities of which are
explained above. Please find below example.
Once done, click on finish to continue with further processing and configuring with the below
parameters of the adapter.
Parameter Description
Query (GET)
Create (POST)
Read (GET)
Delete
Upsert (POST)
Resource Path Path of the resource (entity) that you want to perform the
operation
Fields(only for PUT and The fields in the entity that you want to modify.
POST operations)
Query Options Additional options that you want to add to the query
like $top or how to order the results using orderby. You can
(only for GET operations)
add this using the Model Operation Wizard.
Enable Batch Processing Select to perform multiple operations in one request to the
OData V2 service in the $batch mode.
(only for POST – UPSERT
operation)
Custom Query Options Query options that are specific to the SuccessFactors OData V2
service like purge.
Content Type Encoding Select one of the options. You can either encode the content
using UTF-8 or not encode the content.
(only
for PUT and POST operat None
ions)
Pagination Allows you to set the type of pagination for your query results.
(only for GET – QUERY By default, the value is set to Server Snapshot-Based which is
operation) the recommended value for integration scenarios. The other
values are:
Server Cursor-Based
Note
Upsert: For 412 inner error code along with HTTP response
code 200
Process in Pages The message is processed in pages of size defined in the Page
Size field.
(only for GET – QUERY
operation)
Output Payload:
1. Navigate to the SuccessFactors Admin Center and search for the OData API Data Dictionary.
2. The OData API Data Dictionary is displayed.
8. Conclusion
The document provides an overview on how data can be fetched using OData API in SAP cloud
Integration.
9. References
• https://help.sap.com/viewer/368c481cd6954bdfa5d0435479fd4eaf/Cloud/en-
US/d16dd12c5c5649e99c8939879a77f9c0.html
• https://help.sap.com/doc/a7c08a422cc14e1eaaffee83610a981d/2111/en-
US/SF_HCM_OData_API_DEV.pdf
• https://blogs.sap.com/2019/08/12/odata-service-in-cpi-for-beginners/
• https://help.sap.com/doc/74597e67f54d4f448252bad4c2b601c9/2111/en-
US/SF_HCM_OData_API_REF_en.pdf