Get a Valid CSRF Token for POST and DELETE Requests

Before being able to send POST or DELETE HTTP requests to the service, make sure you have a valid CSRF token first.

You can get a token by sending a GET request to <tenant-url>/api/v1/csrf, or any GET request to the Data Import Service (e.g <tenant-url>/api/v1/dataimport/models)), including both the x-csrf-token: fetch header and the x-sap-sac-custom-auth: true header. The csrf token is then returned in the x-csrf-token response header.

Once you get the token, you can use it to send POST and DELETE requests to the service. The x-csrf-token:<token> header must be included in the request.

API Usage

URL

<tenant-url>/api/v1/csrf

Request Type

GET

CRSF Token Header

Header Name

x-csrf-token

Header Value

fetch

Auth Header

Header Name

x-sap-sac-custom-auth

Header Value

true

Response

The CSRF token is returned in the x-csrf-token response header. This token can then be included in the post or delete request in the x-csrf-token:<token> header.