API General Reference
Endpoint
https://api.unimtx.com
Visit Regions & Endpoint to see more about global access points.
Common Parameters
The common parameters are the parameters that must be passed when calling the API request and are uniformly transferred using URL Query parameters.
Name | Type | Required | Description | Example |
---|---|---|---|---|
action | string | Yes | Interface identification | sms.message.send |
accessKeyId | string | Yes | request AccessKey ID | MvMa9eLy3BBpZqTj49vuAB |
Authentication
Unimatrix provides the following two authentication methods for developers to choose from, which can be set in the Console - Credentials, with the default being Simple mode.
- Simple Mode [Default]: This mode only verifies the AccessKey ID and does not verify the request parameters, making it easy for developers to quickly integrate.
- HMAC Mode: This mode requires the use of
AccessKey Secret
to verify the request parameters to enhance the security and authenticity of the request.
Simple Mode
To use simple mode authentication, simply pass the AccessKey ID
value from the Console - Credentials to the URL Query parameter accessKeyId
to complete the authentication.
HMAC Mode
To use HMAC mode access authentication, all URL Query parameters should be arranged in dictionary order as the text string to be signed and signed according to the specified signature hash algorithm.
Add the required common parameters to Query as follows:
Name | Type | Required | Description | Example |
---|---|---|---|---|
algorithm | string | Yes | Signature hash algorithm, currently only hmac-sha256 is supported | hmac-sha256 |
timestamp | number | Yes | Timestamp (ms), acceptance tolerance time 10 minutes | 1620243278785 |
nonce | string | Yes | Random string, accepts a random string between 8-64 characters | e1098a414d09d2f6 |
signature | string | Yes | Signature string | ZlbgmnCqB7Cgb3WI57Q4zrqq50xiQfi/LPbeL2kC |
Generate signature
-
Extract all URL Query parameter pairs in the request, sort them in dictionary order (ACS) according to the parameter Key, connect the Key-Values with
=
and the parameter pairs with&
to form the text string to be signed, for example as follows.accessKeyId=MvMa9eLy3BBpZqTj49vuAB&action=sms.message.send&algorithm=hmac-sha256&nonce=e1098a414d09d2f6×tamp=1620269782258
-
Using the
HmacSHA256
algorithm, theAccessKey Secret
corresponding to theAccessKey ID
is used as the signature secret key to generate a signature for the text string to be signed, and the output is a Base64 (or Hex) string, as in the following example:ZlbgmnCqB7Cgb3WI57Q4zrqq50xiQfi/LPbeL2kC
-
Adding the signature string as the value of
signature
to the request URL Query parameter sends the request, resulting in the following example of a complete request URL:https://api.unimtx.com/?action=sms.message.send&accessKeyId=MvMa9eLy3BBpZqTj49vuAB&algorithm=hmac-sha256×tamp=1620269782258&nonce=e1098a414d09d2f6&signature=xvv9UjzOrQFWe7fFS5IUU9iqIZrncvF093SqXsnfcK8%3D