Retrieving Master Data Using Master Data Retrieval API for Sourcing

This procedure describes how to retrieve master data using Master Data Retrieval API for Sourcing.

Context

The following steps describe the process to retrieve master data using the Master Data Retrieval API for Sourcing.

Procedure

  1. The client application submits the request for a list of all master data entities, using the GET /entityTypes endpoint, specifying the locale and the site, for which the master data entities need to be retrieved, in the request header.
    GET {{runtime_url}}/entityTypes
     
    Accept-Language
    The locale of the site for which the master data entities need to be retrieved. The default locale is en. Two locales can be specified as comma separated values. The second locale corresponds to the fallback locale.
    X-Realm
    The site for which the master data entities need to be retrieved. The realm name specified for this parameter must match one of the realms configured for the customer organization on the SAP Ariba Developer Portal.

    The response contains a list of master data entities.

  2. Optional. The client application requests the metadata of the specified master data entity using the GET /entityTypes/{EntityName} endpoint.
    GET {{runtime_url}}/entityTypes/{EntityName}
    $EntityName
    The name of the master data entity for which metadata is to be retrieved.

    This request returns a JSON response with a schema representing the metadata of the specified master data entity.

  3. The client application requests the details related to the specified master data entity using the GET /entities/{EntityName} endpoint.
    GET {{runtime_url}}/entities/{EntityName}?$select={field1,field2,field3,...}&$expand={field}&$filter={filter}&orderBy={field}&$skip={skip}&$top={top}
    $EntityName
    The name of the master data entity for which master data details need to be retrieved.
    $select
    The fields needed in the output. Multiple fields can be specified as comma separated values.
    $expand
    The entities to be expanded. Multiple entities can be specified as comma separated values. Expansion is supported only at the first level of association. For one-to-one associations, all direct fields will be expanded. For one-to-many associations, only key fields will be expanded.
    $filter
    The OData filter criteria to identify the details to retrieve for the specified master data entity. The filter supports the use of all the fields supported in $select, in the query.
    $top
    The number of records to be returned in the response.
    $skip
    The number of records to be skipped from the beginning of the search results.
    $orderby
    The field of the master data entity, based on which the results will be ordered.
    $includeInactive
    Includes all the inactive records also in the output. The default value is false.
    $includeFlexFields
    Includes all the flex fields in the output. The default value is false.
    $count
    Includes count in the output along with data, if set to true.
    $includeNullValues
    Includes attributes in the response, even if those attributes do not have values.
  4. The client application requests the number of records corresponding to the specified master data entity using the GET /entities/{EntityName}/$count endpoint.
    GET {{runtime_url}}/entities/{EntityName}/$count?$select={field1,field2,field3,...}&$expand={field}&$filter={filter}&orderBy={field}&$skip={skip}&$top={top}
    $EntityName
    The name of the master data entity for which master data details need to be retrieved.
    $select
    The fields needed in the output. Multiple fields can be specified as comma separated values.
    $expand
    The entities to be expanded. Multiple entities can be specified as comma separated values. Expansion is supported only at the first level of association. For one-to-one associations, all direct fields will be expanded. For one-to-many associations, only key fields will be expanded.
    $filter
    The OData filter criteria to identify the details to retrieve for the specified master data entity. The filter supports the use of all the fields supported in $select, in the query.
    $top
    The number of records to be returned in the response.
    $skip
    The number of records to be skipped from the beginning of the search results.
    $orderby
    The field of the master data entity, based on which the results will be ordered.
    $includeInactive
    Includes all the inactive records also in the output. The default value is false.
    $includeFlexFields
    Includes all the flex fields in the output. The default value is false.
    $count
    Includes count in the output along with data, if set to true.
    $includeNullValues
    Includes attributes in the response, even if those attributes do not have values.