Skip to main content

How to Use API Key Authentication

How to use API keys in the API Portal to authorize and test APIs.


Key Authorization

  1. Choose the API you want to use, this example uses the Ticket API.
  2. Second, select the endpoint you want to use.
  3. Third, choose the authorization type for the API and add your API key.
    Bearer token: The API key is included in the request header.
    API key: You send the key-value pair to the API as query parameter.
  4. Paste your API Key.
  5. Set the limit.
  6. Select Send API Request.
  7. View the output.
https://dev.example.com/collections/travel-collection/apis/ticket-api@apps#/operations/getTickets

API Portal.

CLI

The following examples show how to use curl and HTTPIe to send API requests using an API key for authentication.

FieldDescription
$PORTAL-URLThe base URL of your Portal, for example api.example.com.
$API-KEYThe API key of the consumer

Examples

API Key In Header

CLI
curl -X 'GET' \
'https://$PORTAL-URL/tickets/tickets' \
-H 'accept: application/json' \
-H 'Authorization: Bearer $API-KEY'

API Key In Query Param

CLI
curl -X 'GET' \
'https://$PORTAL_URL/tickets/tickets?limit=1&api_key=$API-KEY' \
-H 'accept: application/json'