Describing OData API and the API Center

Objective

After completing this lesson, you will be able to define API and OData.

What is API?

API stands for Application Programming Interface. API is a set of clearly defined methods of communication between various software components. This communication is useful for passing information back and forth between SAP SuccessFactors and other third-party systems.

APIs are trending towards more direct Representational State Transfer (REST) style web resources. Representational state transfer (REST) or RESTful Web Services is a way of providing interoperability between computer systems on the Internet. REST-compliant Web Services allow requesting systems to access and manipulate textual representations of Web resources by using a uniform and predefined set of stateless operations.

The following topic focuses on REST APIs and their communication through OData.

What is OData?

OData (Open Data Protocol) is an OASIS standard that defines the best practice for building and consuming RESTful APIs. OData helps you focus on your business logic while building RESTful APIs without having to worry about the approaches to define request and response headers, status codes, URL conventions, media types, payload formats, query options, and so on. OData also guides you about tracking changes, defining functions and actions for reusable procedures and sending asynchronous batch requests, and so on.

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.

A standards-based protocol eases API support and increases adoption by the following considerations:

  • OData is an SAP Standard.

  • Powerful query features pull data from multiple entities (think SQL JOINS).

  • Data can be returned in nested data structures, with choice of XML or JSON formats.

  • These standards are critical to HANA Cloud Extensibility.

  • Since OData is considered an industry standard, Customers don’t have to learn proprietary features of SFAPI like SFQL and our custom metadata.

OData API Uses

With OData API, you can:

  1. Query to extract data from the system.
  2. Create (insert) new data in the system.
  3. Update existing data in the system.
  4. Delete data from the system.
  5. Operate on multiple related entities in a single operation.

It's important to note that the metadata operation allows you to view the data schema:

  • What are the entities in a customer’s configuration?

  • What are the relationships between these entities?

  • What are the fields and data types of these entities?

  • What are other metadata features used like field labels, field behaviors, and so on?

All the MDF Entities are automatically exposed through the OData APIs. By using the MDF OData APIs users can access the MDF Entities, create, upsert, and delete them. Admin users can also create and manage MDF Object Definitions and picklists through the MDF OData APIs. Also, MDF OData APIs are used to integrate with third-party systems.

Metadata Entities

To get extra information, such as language labels, picklists, and so on, beyond what the standard OData metadata provides, SAP SuccessFactors OData exposes metadata as an entity.

The SAP SuccessFactors OData API exposes an entity named Entity. Its properties are exposed as complex type value embedded in the response body of Entity. Different forms of metadata can be exposed without changing the standard OData metadata format.

You can access the new metadata like you access a regular entity. Also, it supports a simple filter to output metadata of a specific entity or a group of entities.

In addition to the information you can get from the OData API dictionary about an entity, the metadata gives you information on the entities associated with the entity, picklists, relationships between the entity and other entities, and so on.

API Center and OData API Dictionary

The API Center is a one-stop shop for accessing the OData API Audit Log and the OData API Dictionary.

You find the API Center from the Action search. If you cannot see it there, check that you have the permission, Access to API Center (available in the Manage Integration Tools category in RBP).

Overview of the API Center tool

From the API Center, you can access the following actions:

  • OData API Allowlisting: To configure IP allowlisting when Basic Authentication is used. Both IPv4 and IPv6 are supported.
  • Manage User API Options: Similar to the Employee Import options, it allows to set optional actions that occur when the User write operation is performed, such as
    • Select the new user default password format.
    • Send welcome email to new users.
    • Validate Manager and HR fields.
    • Process inactive Employees.
    • Specify Form routing options, such as Automatic Manager Transfer, or Automatic Document Removal.
    .
  • OData API Metadata Management: Navigates to OData API Metadata Refresh and Export tool, to refresh cache or export metadata to an XML file
  • Audit Log Settings: Configure OData API and SFAPI Audit log settings. API Audit logs include API request and response information, including payloads. This information help developers diagnose issues happened during an API call, and view and download API transaction history for troubleshooting API issues
  • OData API Audit Log. Allows to view the Audit Logs for the API transactions, including the status, entity or OData API Call.
  • OData API Data Dictionary. It contains all the entities available in your instance. It lists the allowed operations, the field (property name), the label, and which fields are required or not. OData API Dictionary in SAP SuccessFactors.
  • OAuth Configuration for OData: To Manage and Register OAuth2 Client Applications so that you can authenticate API users using OAuth2. After you register an application, you'll get an exclusive API key for your application to access SAP SuccessFactors OData APIs.

Caution

The Legacy SFAPI options in API Center, should not be used for new developments, since SFAPI is deprecated. Customers should use OData for new development and consider moving there legacy applications and integrations to OData. For more information please check

Deprecation of Partner API, SFAPI Adhoc, and SFAPI for Simple Entities

.

OData Audit Log

The OData Audit Log can help with support and debugging issues related to OData usage. The Audit Log Integration tool monitors traffic and gets detailed payload information about API requests made to your system.

Other considerations include:

  • The OData Audit Log captures payload details for the last 10,000 OData calls. This log lets you inspect the exact OData payload requests made to the system and corresponding OData responses sent by the system.

  • The tool is for developers who use OData during an implementation, or administrators who want to share information in this log with SAP SuccessFactors HCM solution support to help resolve OData related issues.

  • You can download data from individual calls and send it to a Support representative for analysis.

  • OData API Metadata Refresh and Export tool

Within the OData API Metadata Refresh and Export tool, you'll see the following buttons:

  • Refresh: Refreshes the metadata cache. The updated metadata is regenerated and saved into the cache and is available for future operations such as export.

  • Export: Exports and downloads the metadata. The default export file name is CompanyName-Metadata.xml.

Summary

Some of the key takeaways for this lesson are:

  • API or Application Programming Interface, is a set of communication methods between software components to send information back and forth between SAP SuccessFactors and other systems.

  • OData or Open Data Protocol helps on focus on your business logic when building REST APIs (Representational State Transfer).

  • The OData API uses are to query to extract data from the system, create and update new data or delete data, as well as operating on multiple related entities in a single operation.

  • Using API Center tool, administrators can access the OData API dictionary, with all the entities available in the instance, as well as other actions, like Audit Log settings, Manage User API Options or OData API Allowlisting.