API User Authentication

Create API User

To use the ClearIP API, you should first create a ClearIP user account used for the API and whitelist the relevant IP address under the user account settings. This will allow the API user to bypass entering the one-time password. A phone number is still required to create the user account, but it will never be used.

The email address must be different from any existing user account. This email address will receive an email with the initial temporary password.

API User

Get Access Token

The ClearIP API authenticates requests by verifying a valid access token. The access token must be included in the Authorization header of every request like so ‘Bearer ACCESS_TOKEN_HERE’.

Method: POST
URL: https://api.clearip.com/auth/login

Request Body:

{
  "email": "EMAIL_HERE",
  "password": "PASSWORD_HERE"
}

Response Body:

{
  "token": "TOKEN_HERE"
}

Refresh Access Token

Access tokens are valid for 5 minutes. Before the access token expires, you must get a new access token by refreshing it.

Method: POST
URL: https://api.clearip.com/auth/refresh

Request Body:

{}

Response Body:

{
  "token": "TOKEN_HERE"
}

Operator Access

The API request examples provided in this documentation are shown for an API user account that is restricted to a single Operator. If the API user account has access to view and modify the configuration for multiple Operators because the Operator field in the user account is blank, then the Operator field is a required field that should be added to each API request shown in this documentation.

For example, to add a new Service Provider using an API user account that is assigned to a single Operator, you would use the following API request.

Method: POST
URL: https://api.clearip.com/serviceProviders

Request Body:

{
  "serviceProvider": {
    "name": "NAME_HERE",
    "status": "active",
    "comment": "COMMENT_HERE"
  }
}

However, to add a new Service Provider using an API user account that can access multiple Operators, then you would use the following API request.

Method: POST
URL: https://api.clearip.com/serviceProviders

Request Body:

{
  "serviceProvider": {
    "operator": "CLEARIP_OPERATOR_ID_HERE",
    "name": "NAME_HERE",
    "status": "active",
    "comment": "COMMENT_HERE"
  }
}