1. Home
  2. Docs
  3. Documentation
  4. Getting Started
  5. Step 2: Authentication Token

Step 2: Authentication Token

In order to make API calls, you need first to create an authentication token. The token is a hashed key that is required in every modulus® API call.

Request

API Name Authenticate
URL https://your_account.modulus.biz/api/cmn/Authenticate
Method Post
Source Third Party Server
Recipient modulus® Server
Content Type application/x-www-form-urlencoded

Request Body Parameters

Parameter Description
app Name of your application as provided by modulus® team.
secret App secret as provided by modulus® team.

Responses

HTTP Status result title message object
Success Responses
200 OK true Success Authentication succeeded.
{
    "token": "YOUR_TOKEN",
    "app_id": "YOUR_APP_ID",
    "ip": "AUTHENTICATED_IP_ADDRESS"
}
Failure Responses
400 Bad Request false Bad Request Missing one or more of parameters account, app, secret. null
401 Unauthorized false Unauthorized Authentication failed. null

Please note that authentication token expires 15 minutes after creation.

Example

Request
curl --request POST 'https://your_account.modulus.biz/api/cmn/Authenticate' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'app=YOUR_APP_NAME' \
--data-urlencode 'secret=SECRET_KEY'
Success Responses
200 OK
{
    "result": true,
    "title": "Success",
    "message": "Authentication succeeded.",
    "object": {
        "token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "app_id": "XXX",
        "ip": "X.X.X.X"
    }
}
Failure Responses
400 Bad Request
{
    "result": false,
    "title": "Bad Request",
    "message": "Missing one or more of parameters account, app, secret.",
    "object": null
}
401 Unauthorized
{
    "result": false,
    "title": "Unauthorized",
    "message": "Authentication failed.",
    "object": null
}