All API endpoints listed should be preceded with api/v1/
.
All API requests made must include the following headers:
X-Token
header, which is a UUIDv4. This token will either be a token to access the admin-level API, or a token specific to a reseller to access the reseller-level of the API.
Accept
header, with the value application/json
is required to generate a JSON response.
The reseller-level token is found under the API menu item, in the API Token tab.
The admin-level token is supplied manually and is not visible within the application.
An example API request using X-Token
:
GET /api/v1/licenses HTTP/1.1
Host: tph.io
X-Token: c9c0a840-b5f1-4e0e-84da-e8a4eedfc63b
X-Token
When no X-Token
header is supplied, the following error response will be given:
{
"status": false,
"errors": [
[
"Missing token"
]
]
}
X-Token
When the X-Token
value is invalid, the following error response will be given:
{
"status": false,
"errors": [
[
"Invalid API credentials"
]
]
}
If a request to an API endpoint fails, the following structure will be returned:
success
: booldata
: objecterrors
: array|object