Accessing APIs
Authentication
How to retrieve the authentication token?
The token is granted from the tenant authorization using the client credential flow. This is specified using the header parameter grant_type and provides the value client_credentials.

In addition to the grant_type, the caller needs the granting authority URL, the client ID, and the client secret to retrieve a token with the required authorization.
-
Create a service instance of Solution Sales Configuration service.
-
Create a service key for each instance.
-
In the uaa section of each service key, you can find fields clientid, clientsecret, and url, where the URL follows the pattern https://<identityzone>.authentication.<eu10|us10|...>.hana.ondemand.com.
To retrieve a token, the path /oauth/token/ must be added to the authentication URL found in the service key’s uaa section mentioned above. Both POST and GET are supported. Basic Authentication is used by the tenant authorization. Hence, the client ID and the client secret need to be provided as the authorization header.
POST /oauth/token?grant_type=client_credentials Authorization: Basic Base64 encoded <client Id> and <client secret> Cache-Control: no-cache Host: <identityzone>.authentication.<eu10|us10|...>.hana.ondemand.com Accept-Encoding: gzip, deflate, br Connection: keep-alive Content-Length: 0
The response contains the JSON Web Token (JWT) in the body as access_token. Caller can use the token with preceding keyword Bearer as value of authentication header parameter when calling sales configuration service. It has a limited validity, which can be seen in the parameter expires_in. In general, the validity time of the JWT in sales configuration service is 15 minutes. After the validity expires, a new token must be retrieved.
HTTP/1.1 200 OK
cache-control: no-store
content-type: application/json;charset=UTF-8
date: Thu, 27 Apr 2023 11:41:14 GMT
pragma: no-cache
server: nginx
x-content-type-options: nosniff
x-frame-options: DENY
x-vcap-request-id: cce55b3b-c4a8-436b-461d-07dd80a393bd
x-xss-protection: 1; mode=block
transfer-encoding: chunked
strict-transport-security: max-age=31536000; includeSubDomains; preload;
{"access_token":"eyJh....",
"token_type":"bearer",
"expires_in":899,
"scope":"uaa.resource ssc-app!b41151.Api",
"jti":"5d8200d7ffe345d7a62526d061eef9ad"}
If sales configuration service is called with an expired JWT, it will return 401 Unauthorized.
Cross-Origin Resource Sharing CORS
Cross-Origin Resource Sharing CORS is a mechanism that uses additional HTTP headers to tell a browser to let a web application running at one origin (domain) have permission to access selected resources from a server with a different origin. A web application performs a cross-origin HTTP request when it requests a resource of an origin (domain, protocol or port) different from its own origin. This is a general insight into CORS
.
In addition to the standard headers that are supported, the implemented CORS handling of the Sales Configuration service allows:
-
If-Match
-
If-None-Match
-
Cookie
-
X-CorrelationID
The service exposes the headers :
-
Set-Cookie
-
ETag
Scenarios with the CORS domain
-
If the Origin does not match the maintained Origin in the CORS setting, the service will return error status 403 Forbidden and body Invalid CORS request.
-
If the given HTTP method is not among the allowed methods (other than GET, DELETE, POST, PUT and PATCH) error 403 Forbidden is returned.
-
If the Origin matches the maintained Origin, service returns valid response.
Available Header Parameters
Following are the list of parameters used by the service.
-
The service endpoints only support only JSON requests and responses. This is specified in the parameter content-type: application/
-
For logging reasons, the caller should use the header parameter X-CorrelationID that is provided in the requests for all requests resulting in a common UI step or belonging to the same UI session.
-
For performance enhancement, the service uses an HTTP session. The session is provided with the response header parameter set-cookie and is set to the next request using the parameter Cookie.
-
For all the configuration related endpoints, caller should use header parameter If-Match for POST, PUT, PATCH, and DELETE requests, the value of which is returned as the response header parameter Etag of the create configuration request. For configuration related GET requests, either If-Match or If-None-Match can be used, but it is optional.
Language Handling
Solution Sales Configuration service exposes an endpoint for retrieving the list of supported languages from table T002. The endpoint is GET /api/v1/languages.
The response will have all the supported language IDs that can be used with other requests for retrieving data in specific language format.
Etag Handling
SSC service use optimistic locking through ETag/If-Match headers. This is implemented in configuration resource, where ETag will be returned along with response. Weak ETag is used to allow response compression. ETag is returned from all Configuration endpoints. When updating/deleting/resetting a resource, the caller must include the ETag value in the If-Match header of the update request.
If the If-Match header is missing or the value does not match the current ETag value for the resource, the request fails with a HTTP status 412 (Precondition Failed). This can occur if the resource was modified by another caller in the meantime. The caller must resend the request with the If-Match header set to the latest ETag value.
For all PUT, PATCH, POST and DELETE calls to configuration endpoints, If-Match request header is mandatory. The value of this is the response header Etag returned by create configuration or any GET calls to configuration endpoints.
For GET calls to configuration related endpoints, this is not mandatory but can provide either If-Match or If-None-Match as request header. On providing If-None-Match header, if the state of the resource is not updated, the service will return status 304 Not Modified.