Mobile Numbers

Listing available or assigned mobile numbers to a tenant

GET /api/v1/tenants/(string: tenant_id)/mobile_numbers/

List the mobile numbers owned by the Tenant that are in available state (meaning not yet assigned to a Group) and or the status of all mobile numbers (assigned to a Group or not).

Example request:

GET /api/v1/tenants/foo/mobile_numbers/ HTTP/1.1
Host: example.com

{
   "available": true,
   "assignement": true
}
Request JSON Object:
  • available (boolean) – indicate if the list of available numbers must be returned.

  • assignement (boolean) – indicate if the list of numbers with their assigned Group must be returned.

Example response:

HTTP/1.1 200 OK
Content-Type: "application/json"

{
   "assigned_numbers": [
      {
         "phoneNumbers": "+3299996666",
         "assignedToGroup": "ApioGrpTest",
         "canBeDeleted": false
      }
   ],
   "available_numbers": ["+32471123456"]
}

Note

In case none of the input parameters are provided, assigned_numbers and/or available_numbers are returned.
In case both parameters are set to False, assigned_numbers and/or available_numbers are returned as empty lists.
Response JSON Object:
  • assigned_numbers (array) – a list of numbers (phoneNumbers) with the indication of the Group they are assigned to if any (assignedToGroup) and if they can be deleted (canBeDeleted).

  • available_numbers (array) – a list of numbers that are available (meaning not assigned to a Group).

Status Codes:

Add mobile numbers

POST /api/v1/tenants/(string: tenant_id)/mobile_numbers/

Add a list of numbers in the tenant. They will be in ‘available’ state.

Example request:

POST /api/v1/tenants/foo/mobile_numbers/ HTTP/1.1
Host: example.com
Content-Type: "application/json"

{
   "phoneNumbers": [
      {"phoneNumber": "+32471123456"}
   ]
}
Request JSON Object:
  • numbers (array) – the list of numbers to be added.

Example response:

HTTP/1.1 200 OK
Content-Type: "application/json"

{
   "result": [
      {"phoneNumber": "+32471123456", "status": "added"}
   ]
}
Response JSON Object:
  • result (array) – a list of objects containing the number and it’s status (‘added’, ‘rejected’).

Status Codes:

Remove mobile numbers

DELETE /api/v1/tenants/(string: tenant)/mobile_numbers/

Delete a list of numbers in the tenant.

Example request:

DELETE /api/v1/tenants/foo/mobile_numbers/ HTTP/1.1
Host: example.com
Content-Type: "application/json"

{
   "phoneNumbers": [
      {"phoneNumber": "+32471123456"}
   ]
}
Request JSON Object:
  • numbers (array) – the list of numbers to be removed.

Example response:

HTTP/1.1 200 OK
Content-Type: "application/json"

{}
Status Codes: