When making calls to fabric APIs, you must use the following HTTP headers to provide context.
--header
: This flag is used to include headers in the request. The most commonly used headers in fabric APIs are:x-fabric-tenant-id
: This is a custom header used by the API to identify the tenant making the request. You can find thetenant-id
in the Copilot application.Content-Type: application/json
: This tells the server that the data being sent in the request is in JSON format.Authorization: Bearer
: This is the authorization token used to authenticate the request. You are required to pass the access token generated from the system app.x-fabric-channel-id
: This is a custom header, used to identify the channel through which the request is being made. This is primarily used for a multichannel use case. And in most cases, the default value is 12 (US).
fabric API responses are in JSON format.
Prerequisites
Before you can start using fabric APIs:
- Generate the access token by following the instructions in the Getting Started with fabric APIs section.
- Get the x-fabric-tenant-id by following the instructions in the Getting the Account ID section.
Procedure
- Set the following headers:
- Content-Type: application/json
- Authorization: Bearer
- Run the following command by replacing the
<Tenant-Id>
and<Generated-access-token>
:
In this request the baseURL is followed by one of the requests from the Products APIs, Product Operations by ID.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>'