Skip to main content

API User Authentication

Equinix APIs use OAuth 2.0 protocol to authenticate the requests you make to API endpoints. To interact with Equinix APIs, you need a bearer access token. Bearer determines the type of authentication scheme and is a part of the OAuth 2.0 protocol.

Prerequisites​

Interacting with Equinix products over API requires:

  • An Equinix Customer Portal account.
  • Product-specific create, modify, and delete permissions. Contact your organization's primary administrator and request access permissions.

Generate Client ID and Client Secret​

A Client ID and a Client Secret are necessary to obtain tokens that authorize your API requests. To generate a Client ID and Client Secret, register your app in the Developer Settings section of the Customer Portal.

To register an app:

  1. Sign in to the Customer Portal.

  2. From the global navigation menu, select Developer Settings > Apps to display app details.

    Developer Settings menu with Apps and Messaging Gateway options

  3. API License Agreement - Before using the platform and APIs for the first time, you must read and accept the displayed API license agreement.

    API License Agreement dialog with the acceptance checkbox selected and the Accept button

    Once you have accepted the agreement, you can find it in the Additional Information section.

    Additional Information tab on the Apps page with documentation links and the API Agreement link

  4. Click Create New App.

    My Apps list with the Create New App button

  5. Provide an app name, select app environment type (Production), and click Create.

    Create New App panel with the App Name field and the Production environment option

  6. Click your app card to open its details.

  7. Click the eye icon to view your Consumer Key and Consumer Secret.

    App Details panel with the Consumer Key and Consumer Secret hidden behind eye icons

Requesting an Access Token​

An access token is required to authorize your API requests. To request a token, send a POST request to the /oauth2/v1/token endpoint, specifying your Client ID and Client Secret in the body of the request.

Sample cURL request:

curl -X
POST 'https://api.equinix.com/oauth2/v1/token'
-H 'content-type: application/json'
-d '{
"grant_type": "client_credentials",
"client_id": "<client_id>",
"client_secret": "<client_secret>"
}'

For a complete list of available parameters and options, see the API Reference.

Sample response:

{
"access_token": "<token>",
"token_timeout": "3600",
"user_name": "john.doe@example.com",
"token_type": "Bearer"
}

Refreshing a Token​

You can refresh your access token by sending a POST request to the /oauth2/v1/refreshaccesstoken endpoint.

Sample curl request:

curl -X
POST 'https://api.equinix.com/oauth2/v1/refreshaccesstoken'
-H 'content-type: application/json'
-d '{
"client_id": "<client_id>",
"client_secret": "<client_secret>",
"refresh_token": "<token>
}'‌‌

For a complete list of available parameters and options, see the API Reference

Using Access Tokens​

To interact with Equinix API, send your access token in the Authorization header of the HTTP request with authorization: Bearer <token>

Sample cURL request - an inbound shipment from the colocation API:

curl -X
POST "https://api.equinix.com/colocations/v2/orders/shipments"
-H "content-type: application/json"
-H "authorization: Bearer <token>"
-d '{
"type": "INBOUND",
"requestedDateTime": "2020-11-02T10:45:41Z",
"cageId": "AM1:01:000111",
"details": {
"carrier": "CUSTOMER_CARRIER",
"numberOfBoxes": 2
}
}'‌
Was this page helpful?