1

Create system app

Create System App with the right set of roles. For details on how to create a System App, refer to https://developer.fabric.inc/v3/docs/api-key-management#creating-api-apps.

Once the app is created, capture the app credentials including the associated authentication information. To do this, refer to the steps here https://developer.fabric.inc/v3/docs/api-key-management#viewing-api-apps

2

Generate access token

Generate an access token using the System App credentials, which include Authorization URL, Client ID, and Client Secret.

This access token is required in the next step to access fabric APIs, such as Product Catalog, Offers, and more.

cURL

curl --location '<authorizationUrl>/v1/token' \
--header 'accept: application/json' \
--header 'cache-control: no-cache' \
--header 'content-type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'scope=s2s' \
--data-urlencode 'client_id=<clientId>' \
--data-urlencode 'client_secret=<clientSecret>'
3

Perform Login

Trigger the required fabric API, such as the Product Catalog API, to get items from the catalog. Use the generated access token in the Authorization header to authenticate the API request.

Note: Some of the fabric APIs require higher levels of permissions to run successfully. Hence, it is crucial to create the System App with the appropriate set of roles in Step 1.

cURL
curl --location 'https://api.fabric.inc/v3/published-products/skus/<sku>?locale=<locale>' \
--header 'x-fabric-tenant-id: <Tenant-Id>' \
--header 'Authorization: Bearer <Generated-access-token>'

Was this page helpful?