Access to all the endpoints requires passing an Authorization header. Two methods of authorization are supported:

  1. JWT Token - Pass a JWT as a Bearer token in the Authorization header.
  2. API Key - Pass an API key in the Authorization header and provide the EnterpriseId header for verification. The API Key will impersonate a selected User in Copyl.

Both methods require correct configuration to ensure successful access. Each approach is described below in detail.

Sample Request

Endpoint: Get All Integrations

Using JWT Token

GET /integrations HTTP/1.1
Host: [<https://api.copyl.com/ms/Integrations>](<https://copylservicesapi.delightfulflower-7dbed4bd.westeurope.azurecontainerapps.io/Integrations>)
[](<https://copylservicesapi.delightfulflower-7dbed4bd.westeurope.azurecontainerapps.io/>)Authorization: Bearer <JWT Token>
Ocp-Apim-Subscription-Key: <Subscription Key>

Using API Key

GET /integrations HTTP/1.1
Host: [<https://api.copyl.com/ms/Integrations>](<https://copylservicesapi.delightfulflower-7dbed4bd.westeurope.azurecontainerapps.io/Integrations>)
Authorization: ApiKey <Your API Key>
Ocp-Apim-Subscription-Key: <Subscription Key>
EnterpriseId: <Enterprise GUID>

Authorization

The JWTandApiKeyAuthorization filter validates the authorization header. The validation process differs based on whether a JWT or API Key is provided:

  1. JWT Authorization:
  2. API Key Authorization:

Error Responses

In case of authentication failures, the API returns an appropriate error message in JSON format: