The SAP Customer Data Cloud REST API is a powerful interface for managing user identities, social login flows, and preference data.
The core of the SAP Customer Data Cloud service is a REST-like interface. This means that API method calls are made over the internet by sending HTTP GET, POST, or DELETE requests to the SAP Customer Data Cloud REST API server, and the response is returned as JSON.

For more information, refer to REST API documentation in the SAP Help Portal.
To find the data center that your site is associated with, refer to the Finding Your Data Center documentation in the SAP Help Portal.
Purpose and Value of REST APIs in SAP Customer Data Cloud
REST APIs are essential for interacting with SAP Customer Data Cloud programmatically. They provide a standardized way to access and manage user identities, data, and configurations. Here's why REST APIs are valuable:
Integration: REST APIs enables seamless integration of SAP Customer Data Cloud with various applications, systems, and platforms, allowing you to extend the functionality of SAP Customer Data Cloud beyond its native interface.
Automation: You can automate identity management tasks such as user registration, login, profile updates, and data synchronization, reduce manual effort and improve efficiency.
Customization: REST APIs allows you to customize the behavior of SAP Customer Data Cloud to meet specific business requirements, such as implementing custom authentication flows or integrating with third-party services.
Flexibility: REST APIs offer flexibility in how you interact with SAP Customer Data Cloud, allowing you to use different programming languages, tools, and frameworks to build custom solutions.
Authentication and Authorization Mechanisms for SAP Customer Data Cloud REST APIs
To access the SAP Customer Data Cloud REST APIs, you need to authenticate and authorize your requests. SAP Customer Data Cloud offers a Rest-like Web API that can be consumed via HTTPS requests and requires one of the following authentication methods:
An HTTP bearer token header.
A combination of App Key and App Secret.
A combination of User Key and User Secret.
A Partner Secret.

Note
Requests to the REST API should be signed for security purposes. The recommended best practice is to generate a bearer token for the signature.
The above list is ordered accordingly with best practices, with item 4 being the worst way (you must avoid it) and the first one the best.
For more information, refer to the REST APIs with the SAP Customer Data Cloud Authorization Method documentation in the SAP Help Portal.
Here’s an example curl command to call the accounts.getSchema API.
1234567curl -X POST \
https://accounts.us1.gigya.com/accounts.getSchema \
-H 'content-type: application/x-www-form-urlencoded' \
--data-urlencode "apiKey=[Enter-Your-API-Key-Here]" \
--data-urlencode "secret=[Enter-Your-Secret-Key]" \
--data-urlencode "scope=site" \
--data-urlencode "filter=explicitOnly" \This is one of the recommended approaches to use the SAP Customer Data Cloud API. It allows administrators to provide appropriate access and can be audited, extended, or limited based on needs.
App Keys are essentially the same as User Keys, except they are intended to be used by applications, such as mobile apps or server-side apps.
You can create as many User Keys as needed by inviting users or creating App Keys (the better way) in the Administration section of the SAP Customer Data Cloud Console.
Application Key has higher rate limits than standard user keys, but their actions aren't reviewed.
Constructing and Executing REST API Requests
To interact with the SAP Customer Data Cloud REST APIs, you need to construct and execute HTTP requests with the appropriate headers, parameters, and payload. Here's a breakdown of the process:
Identify the API Endpoint: Determine the correct API endpoint for the operation you want to perform (e.g., accounts.register, accounts.getAccountInfo).
Choose the HTTP Method: Select the appropriate HTTP method (GET, POST, DELETE) based on the API documentation.
Set the Headers: Include required headers such as Content-Type (usually application/x-www-form-urlencoded or application/json) and Authorization(if using bearer tokens).
Provide Parameters: Include authentication parameters like userKey and secret(if not using bearer tokens) and other required parameters as query parameters or in the request body (payload).
Sign the Request (if required): Generate a signature or bearer token based on your authentication method and include it in the request.
Execute the Request: Use a tool like curl, Postman, or an HTTP client library in your programming language to send the request to the SAP Customer Data Cloud API server.





