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|objectGET customers
GET /api/v1/customers HTTP/1.1
Host: tph.io
X-Token: c9c0a840-b5f1-4e0e-84da-e8a4eedfc63b
data
: array[object]
id
: inttype
: string ("business"
, "individual"
)name
: stringtelephone_number
: stringmobile_number
: stringaddress
: stringcountry
: stringregion
: stringcity
: stringpost_code
: stringbilling_address
: stringbilling_country
: stringbilling_region
: stringbilling_city
: stringbilling_post_code
: stringbilling_vat_number
: stringbilling_company_registration_number
: stringcreated_at
: string ("2020-01-01T00:00:00+00:00"
)updated_at
: string ("2020-01-01T00:00:00+00:00"
)meta
: object
first_url
: stringlast_url
: stringnext_url
: stringprevious_url
: stringtotal
: intper_page
: intcurrent_page
: intlast_page
: intfrom
: intto
: int{
"data":[
{
"id":1,
"name":"Example Customer",
"type":"business",
"telephone_number":"0123456789",
"mobile_number":"0987654321",
"address":"123 Example Address",
"country":"US",
"region":"Example Region",
"city":"Example City",
"post_code":"123 EXAMPLE",
"billing_address":"",
"billing_country":"",
"billing_region":"",
"billing_city":"",
"billing_post_code":"",
"billing_vat_number":"",
"billing_company_registration_number":""
}
],
"meta":{
"first_url":"https://tph.io/api/v1/customers",
"last_url":"https://tph.io/api/v1/customers?page=1",
"next_url":"https://tph.io/api/v1/customers?page=1",
"previous_url":"https://tph.io/api/v1/customers?page=1",
"total":1,
"per_page":25,
"current_page":1,
"last_page":1,
"from":1,
"to":1
}
}
POST customers
type
: string ("business"
, "individual"
)name
: string (Only applies to "business"
type)first_name
: string, requiredlast_name
: string, requiredemail
: string, requiredpassword
: string, requiredpassword_again
: string, requiredaddress
: string, requiredcity
: string, requiredregion
: string, requiredpost_code
: string, requiredcountry
: string, requiredmobile_number
: stringtelephone_number
: stringPOST /api/v1/customers HTTP/1.1
Host: tph.io
X-Token: c9c0a840-b5f1-4e0e-84da-e8a4eedfc63b
Content-Type: application/json
{
"type": "business",
"name": "New Customer",
"first_name": "Customer",
"last_name": "User",
"email": "customeruser@example.com",
"password": "validpass123",
"password_again": "validpass123",
"address": "123 Example Address",
"city": "Example City",
"region": "Example Region",
"post_code": "123 EXAMPLE",
"country": "US"
}
success
: boolmessages
: string (optional)data
: object
customer_id
: int{
"success":true,
"messages":"Business customer created",
"data":{
"customer_id":2
}
}
GET customers/{id}
GET /api/v1/customers/1 HTTP/1.1
Host: tph.io
X-Token: c9c0a840-b5f1-4e0e-84da-e8a4eedfc63b
data
: object
id
: intname
: stringtelephone_number
: stringmobile_number
: stringaddress
: stringcountry
: stringregion
: stringcity
: stringpost_code
: stringbilling_address
: stringbilling_country
: stringbilling_region
: stringbilling_city
: stringbilling_post_code
: stringbilling_vat_number
: stringbilling_company_registration_number
: stringcreated_at
: string ("2020-01-01T00:00:00+00:00"
)updated_at
: string ("2020-01-01T00:00:00+00:00"
){
"data":{
"id":1,
"name":"Example Customer",
"type":"business",
"telephone_number":"0123456789",
"mobile_number":"0987654321",
"address":"123 Example Address",
"country":"US",
"region":"Example Region",
"city":"Example City",
"post_code":"123 EXAMPLE",
"billing_address":"",
"billing_country":"",
"billing_region":"",
"billing_city":"",
"billing_post_code":"",
"billing_vat_number":"",
"billing_company_registration_number":"",
"created_at":"2020-12-31T00:00:00+00:00",
"updated_at":"2020-12-31T00:00:00+00:00"
}
}
PUT customers/{id}/update_business
name
: string, requiredaddress
: string, requiredcity
: string, requiredregion
: string, requiredpost_code
: string, requiredcountry
: string, requiredmobile_number
: stringtelephone_number
: stringbilling_address
: stringbilling_city
: stringbilling_region
: stringbilling_post_code
: stringbilling_company_registration_number
: stringbilling_vat_number
: stringPUT /api/v1/customers/1/update_business HTTP/1.1
Host: tph.io
X-Token: c9c0a840-b5f1-4e0e-84da-e8a4eedfc63b
Content-Type: application/json
{
"name": "Example Customer",
"address": "123 Example Address",
"city": "Example City",
"region": "Example Region",
"post_code": "123 EXAMPLE",
"country": "US",
"mobile_number": "001122334455"
}
data
: object
id
: intname
: stringtelephone_number
: stringmobile_number
: stringaddress
: stringcountry
: stringregion
: stringcity
: stringpost_code
: stringbilling_address
: stringbilling_country
: stringbilling_region
: stringbilling_city
: stringbilling_post_code
: stringbilling_vat_number
: stringbilling_company_registration_number
: stringcreated_at
: string ("2020-12-31T00:00:00+00:00"
)updated_at
: string ("2020-12-31T00:00:00+00:00"
){
"data":{
"id":1,
"name":"Example Customer",
"type":"business",
"telephone_number":null,
"mobile_number":"001122334455",
"address":"123 Example Address",
"country":"US",
"region":"Example Region",
"city":"Example City",
"post_code":"123 EXAMPLE",
"billing_address":null,
"billing_country":null,
"billing_region":null,
"billing_city":null,
"billing_post_code":null,
"billing_vat_number":null,
"billing_company_registration_number":null,
"created_at":"2020-01-01T00:00:00+00:00",
"updated_at":"2020-01-01T00:00:00+00:00"
}
}
PUT customers/{id}/update_individual
first_name
: string, requiredlast_name
: string, requiredaddress
: string, requiredcity
: string, requiredregion
: string, requiredpost_code
: string, requiredcountry
: string, requiredmobile_number
: stringtelephone_number
: stringbilling_address
: stringbilling_city
: stringbilling_region
: stringbilling_post_code
: stringbilling_company_registration_number
: stringbilling_vat_number
: stringPUT /api/v1/customers/3/update_individual HTTP/1.1
Host: tph.io
X-Token: c9c0a840-b5f1-4e0e-84da-e8a4eedfc63b
Content-Type: application/json
{
"first_name": "Individual",
"last_name": "User",
"address": "321 Example Address",
"city": "Example City",
"region": "Example Region",
"post_code": "321 EXAMPLE",
"country": "US"
}
data
: object
id
: intname
: stringtelephone_number
: stringmobile_number
: stringaddress
: stringcountry
: stringregion
: stringcity
: stringpost_code
: stringbilling_address
: stringbilling_country
: stringbilling_region
: stringbilling_city
: stringbilling_post_code
: stringbilling_vat_number
: stringbilling_company_registration_number
: stringcreated_at
: string ("2020-12-31T00:00:00+00:00"
)updated_at
: string ("2020-12-31T00:00:00+00:00"
){
"data":{
"id":3,
"name":"Individual User",
"type":"individual",
"telephone_number":null,
"mobile_number":null,
"address":"321 Example Address",
"country":"US",
"region":"Example Region",
"city":"Example City",
"post_code":"321 EXAMPLE",
"billing_address":null,
"billing_country":"",
"billing_region":null,
"billing_city":null,
"billing_post_code":null,
"billing_vat_number":null,
"billing_company_registration_number":null,
"created_at":"2020-01-01T00:00:00+00:00",
"updated_at":"2020-01-01T00:00:00+00:00"
}
}
POST /customers/{id}/app/activate
app
: int, requiredPOST /api/v1/customers/3/app/activate HTTP/1.1
Host: tph.io
X-Token: c9c0a840-b5f1-4e0e-84da-e8a4eedfc63b
Content-Type: application/json
{
"app": 1
}
success
: boolmessages
: string{
"success":true,
"messages":"App successfully activated."
}
POST /customers/{id}/app/deactivate
app
: int, requiredPOST /api/v1/customers/3/app/activate HTTP/1.1
Host: tph.io
X-Token: c9c0a840-b5f1-4e0e-84da-e8a4eedfc63b
Content-Type: application/json
{
"app": 1
}
success
: boolmessages
: string{
"success":true,
"messages":"App successfully deactivated."
}
GET /accounts
GET /api/v1/accounts HTTP/1.1
Host: tph.io
X-Token: c9c0a840-b5f1-4e0e-84da-e8a4eedfc63b
data
: array[object]
id
: intfirst_name
: stringlast_name
: stringsuspended
: boolarchived
: boolcreated_at
: string ("2020-01-01T00:00:00+00:00"
)updated_at
: string ("2020-01-01T00:00:00+00:00"
)meta
: object
first_url
: stringlast_url
: stringnext_url
: stringprevious_url
: stringtotal
: intper_page
: intcurrent_page
: intlast_page
: intfrom
: intto
: int{
"data":[
{
"id":2,
"first_name":"Example",
"last_name":"User",
"suspended":false,
"archived":false,
"created_at":"2018-04-27T15:10:27+00:00",
"updated_at":"2018-04-27T15:10:27+00:00"
}
],
"meta":{
"first_url":"https://tph.io/api/v1/accounts",
"last_url":"https://tph.io/api/v1/accounts?page=1",
"next_url":"https://tph.io/api/v1/accounts?page=1",
"previous_url":"https://tph.io/api/v1/accounts?page=1",
"total":1,
"per_page":25,
"current_page":1,
"last_page":1,
"from":1,
"to":1
}
}
GET p8auth/subscribers
GET /api/v1/p8auth/subscribers HTTP/1.1
Host: tph.io
X-Token: c9c0a840-b5f1-4e0e-84da-e8a4eedfc63b
data
: array[object]
id
: intreseller
: stringcompany
: stringusername
: stringproduct
: stringnetwork
: stringip_address
: stringprovider
: stringsim_number
: stringis_capped
: boolis_suspended
: boolhas_schedule
: boolstatus
: stringhas_quota
: boolquota_is_capped
: boolcreated_at
: string ("2020-01-01T00:00:00+00:00"
)updated_at
: string ("2020-01-01T00:00:00+00:00"
)labels
: array[object]
data
: array[object]
id
: intname
: stringtype_id
: intmeta
: object
first_url
: stringlast_url
: stringnext_url
: stringprevious_url
: stringtotal
: intper_page
: intcurrent_page
: intlast_page
: intfrom
: intto
: int{
"data": [
{
"id": 3,
"reseller": "Example Reseller",
"company": "Example Customer",
"username": "1212121212",
"product": "Example APN Product",
"network": "Network 1",
"ip_address": "192.168.0.2",
"provider": "Provider 1",
"sim_number": "0123456789",
"is_capped": false,
"is_suspended": false,
"has_schedule": false,
"status": "Enabled",
"has_quota": false,
"quota_is_capped": false,
"created_at": "2018-04-24T16:13:35+00:00",
"updated_at": "2018-04-25T10:35:24+00:00",
"labels": {
"data": [
{
"id": 1,
"name": "Label 1",
"type_id": 1
}
]
}
},
]
"meta": {
"first_url": "https://tph.io/api/v1/p8auth/subscribers",
"last_url": "https://tph.io/api/v1/p8auth/subscribers?page=1",
"next_url": "https://tph.io/api/v1/p8auth/subscribers?page=1",
"previous_url": "https://tph.io/api/v1/p8auth/subscribers?page=1",
"total": 1,
"per_page": 50,
"current_page": 1,
"last_page": 1,
"from": 1,
"to": 1
}
}