Spend Management Blogs by SAP
Stay current on SAP Ariba for direct and indirect spend, SAP Fieldglass for workforce management, and SAP Concur for travel and expense with blog posts by SAP.
cancel
Showing results for 
Search instead for 
Did you mean: 
ajmaradiaga
Developer Advocate
Developer Advocate
When calling the SAP Ariba APIs, various APIs require the realm name as an input. In this blog post I will share where you can find the realm name when accessing the SAP Ariba solution.

The realm name is a required input in several SAP Ariba APIs. In some APIs the value needs to be specified as a URL query parameter, e.g. realm=MyRealm-T, in others it will be specified as a Header parameter, e.g. X-Realm: MyRealm-T.

Depending on the SAP Ariba solution your company has a subscription for, users will login through a short URL similar to the examples below. The short URL will redirect to a longer URL which contains the realm name, as a URL query param, to be used when calling the SAP Ariba APIs.

Buying:

Sourcing:

The URLs will vary depending on the data center where they are located. In the URLs above, we can see different structure for realms in US, Europe (EU), and Australia (AU).

If your URL is invalid, you will get an error message like the one below.


Invalid URL


The short URLs above will redirect to URLs similar to the ones below respectively. Here you can see the realm query parameter. This is the value that you need to specify when calling the API.
Buying:

Sourcing:

 


Realm name in URL - query parameter


You can see that the short URL includes a value very similar to the realm name, e.g. http://EMEA-COMPANY-T.sourcing-eu.ariba.com. This value should not be used as the realm name might not be in the correct casing. The value in the realm query parameter within the long URL, e.g. https://s1-eu.ariba.com/Buyer/Main/aw?awh=r&awssk=CeWBeG0v&realm=EMEA-Company-T&dard=1 should be used as this value has the correct casing.

An alternative to copying the value from the URL is by viewing the source of the web page. Right click on the UI > View Source and search for realm=. You'll find the value in the source of the web page.


Realm name in UI - view source



Using the realm name to call the SAP Ariba APIs


Below a couple of examples of how the realm name is specified when calling the SAP Ariba APIs.

As a URL query parameter:

curl --location -g --request GET https://openapi.ariba.com/api/analytics-reporting-details/v1/prod/views/S4ApprovalFlowFactSystemView?realm=mycompany-t' \
--header 'apiKey: [APPLICATION-ID]' \
--header 'Authorization: Bearer [ACCESS-TOKEN]'


As a Header parameter:

curl --location --request GET 'https://openapi.ariba.com/api/sourcing-mds-search/v1/prod/entityTypes/users' \
--header 'Accept-Language: en' \
--header 'X-Realm: mycompany-t' \
--header 'Authorization: Bearer [ACCESS-TOKEN]' \
--header 'apiKey: [APPLICATION-ID]'


I hope this helps you know where to find the value of your SAP Ariba realm name, so that it can be used in your API requests.
2 Comments