Equotix One APIs requires authentication. You will need an active subscription with Equotix One which has API access to be able to authenticate.
API Domain
The production domain for Equotix One APIs will be:
https://dashboard.equotix.one
API Request Methods
The API accepts POST request for all API calls with JSON data in the body.
API Response
JSON is used for all APIs responses.
Authentication Parameters
The below POST parameters are required for all API calls to authenticate.
Name | Type | Description |
domain | string | The domain you are assigned to authenticate your Equotix One account. |
api_key | string | The email address assigned to the user account in your Equotix One. |
auth_timestamp | int | The unix timestamp used to sign this API request. |
auth_signature | string |
The calculated signature for this API request. |
Authentication Signature Calculation
The authentication signature is calculated by removing any object parameters from the data, then sort the remaining JSON data alphabetically by the parameter name and use the HMAC-SHA256 algorithm with your API secret.
Signature Calculation Example
Below is an example for calculating the authentication signature for a simple API request to get an item.
Variables:
domain = test
api_key = test@example.com
api_secret = Xv2l2mDFf1KG6WaLVZPpYbXNLpHRjF1MZMxiSSf4
auth_timestamp = 1670561053
sku = test
Sorted JSON without objects
{"api_key":"test@example.com","auth_timestamp":1670561053,"domain":"test","sku":"test"}
Calculated Signature
292223c3b8b7f0a79f083e62560cfb44c478fb256a457e341214310f27c2dd1a
PHP Example
Below is the sample code for calculating the signature hash using PHP.
$post_data = [
'domain' => 'test',
'api_key' => 'test@example.com',
'auth_timestamp' => 1670561053,
'sku' => 'test'
];
$hash_data = $post_data;
foreach ($hash_data as $key => $value) {
if (is_array($value)) {
unset($hash_data[$key]);
}
}
ksort($hash_data);
$hash = hash_hmac('sha256', json_encode($hash_data), 'Xv2l2mDFf1KG6WaLVZPpYbXNLpHRjF1MZMxiSSf4');
Comments
0 comments
Article is closed for comments.