Query Parameter
|
Description
|
ak |
This is your
Public-API-Key, which Mettl uses to identify your account.
Unsuccessful authentication results in rejection of the request with Error: Access denied. The API key is not authorized for requested resource/action (E403) |
ts |
This is the current UNIX or Epoch
Timestamp (the number of seconds between 1970-01-01 00:00:00 and current UTC Time). Any current geneTimestamp generated will be valid for 24 hours only.
Unsuccessful validation results in rejection of the request with Error: Invalid Timestamp (E504)
|
asgn |
This is a unique
Signature which has to be generated
for each API request.
The Signature is generated by creating a String-to-Sign and hashing it with your Private-API-Key using the HMAC-SHA256 (for version v2 and v3) or HMAC-SHA1 (for v1) hashing algorithm with Base-64 and URL encoding.
Read more about the Signature Generation Process in the following sections.
Unsuccessful authentication results in rejection of the request with Error: Authentication failed/Signature Mismatch (E401)
|
1.
|
Construct a request
|
2.
|
Generate signature |
3.
|
Include signature in the request
|
4.
|
Send request to Mettl
|
5.
|
Checks if Timestamp is in valid format and and within past 24 hours of the current Epoch or UNIX Time
|
6.
|
Checks Public API Key and retrieves the corresponding private API key in Mettl
|
7.
|
Recalculates the signature using your request and private API key |
8.
|
Compares the 2 signatures
|