Sirportly

Toggle Menu

Creating a token

This method allows you to create a new account API token.

URL

/api/v2/api_tokens/create

Access

This method can be accessed by account level tokens. In addition, user tokens for applications who have been granted this level of access may also access this method.

Supported Parameters

  • name - a name to assign to this token (required)
  • ip_addresses - a new line separated list of IPs to allow this token to operate from
  • log - whether or not logging is enabled (send '1' to enable or '0' to disable, disabled by default)
  • log_response - whether or not response logging is enabled (send '1' to enable or '0' to disable, disabled by default). Must enable log above for this to have any effect.

Example JSON

If your request is successful, you will receive a 201 Created status with the following response. If there is a validation error, you'll receive a 422 Unprocessable Entity response with an array of errors.

{
    "id": 5,
    "name": "Example Token",
    "token": "b5042e98-9706-a6df-6f85-4f0238d39857",
    "secret": "6v00gjez8cxphm2v6ycnadbd413oekwx24ryry1mesfgj4qxt4",
    "ip_addresses": "109.104.109.23",
    "enabled": true,
    "log": false,
    "log_response": false,
    "user": null,
    "api_application": null
}