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.
Showing results for 
Search instead for 
Did you mean: 
Developer Advocate
Developer Advocate
In this blog post, I will cover the SAP Ariba Master Data Retrieval API for Sourcing, which was released a couple of weeks ago. We'll see the entities that are exposed in the new API, how these can be used and an example use case for reporting purposes.

The Master data retrieval API for Sourcing was released as part of the 2011 release. It is now possible to retrieve the master data that exists is your SAP Ariba realm. This enables third parties/customers to create applications extending SAP Ariba and be able to display a customer's SAP Ariba Master Data in their applications. The API can also be used for auditing purposes, to validate the master data available in SAP Ariba compared to the system of origin.
Check out the documentation available for the Master Data Retrieval API for Sourcing: https://help.sap.com/viewer/ed78e1994e424374b6d81225a0276e0c/cloud/en-US/a401d6eb8f1743abac3e245cead...


Each entity available in the API exposes different fields. To find out which fields an entity exposes, you can use the GET /entityTypes/{EntityName} method, e.g. GET /entityTypes/users. The table below shows the entities available and their corresponding API names:

Master data entity API lookup name
User users
Group groups
UnitOfMeasure uoms
LocaleID loaleids
ClassificationCodeMap classificationcodemap
Currency currency
CurrencyConversionRate currencyconversionrate
CommodityCode commoditycodes
Country countries
Language languages
PreferredSupplierLevel preferredsupplierlevel
SegmentationLevel segmentationlevels
Department s4departments
Region s4regions

When extracting data via the GET /entityTypes/{EntityName} method, it is possible to $select fields, $expand certain fields, $filter, and do pagination with $top$skip query parameters. Also, we can $includeInactive records, $includeFlexFields and $includeNullValues. In essence, this API kinda follows the OData system query options.
ℹ️ This is a read-only API, it is not possible to create master data through it.

Reporting use case

In SAP Ariba, it is possible to assign a user delegate for a period of time, e.g. when someone goes on vacation, a delegate will be able of doing that user's approvals. We have a requirement to report on who are the users responsible for this delegations.

We can use the Master data retrieval API for Sourcing if we want to know who is the delegatee for whom. This is something that was not possible to before and it can easily be retrieved by using the API.


curl --location --request GET 'https://openapi.ariba.com/api/mds-search/v1/prod/entities/users?$filter=CanActAs.Name%20ne%20null&$count=true&$includeNullValues=false&$top=250&$select=UniqueName,Name,Active,TimeUpdated,CanActAs.Name&$expand=CanActAs' \
--header 'Accept-Language: en' \
--header 'X-Realm: YOURREALM-T' \
--header 'Authorization: Bearer ea97d123-1234-1234-1234-3f96b8ce1234' \
--header 'apiKey: dAAW72hKXfwTFdxCfA2JZ4Wk3o8fsWaLY'


As you can see in the response above, we are able to retrieve all the users that can act as someone else in the system. This is achieved by specifying the query parameter $filter=CanActAs.Name ne null.