import plivo

client = plivo.RestClient(auth_id="<auth_id>", auth_token="<auth_token>")
# List all Tollfree in a Powerpack
powerpack = client.powerpacks.get(uuid='<powerpack_uuid>')
# Version 1
response = powerpack.list_tollfree()
# Version 2
response = powerpack.numberpool.tollfree.list()
print(response)
{
  "api_id": "06c15d7c-7ed5-11ea-855f-0242ac110003",
  "meta": {
    "limit": 20,
    "next": "",
    "offset": 0,
    "previous": "",
    "total_count": 1
  },
  "objects": [
    {
      "account_phone_number_resource": "/v1/Account/{auth_id}/Number/{your_tollfree_number}/",
      "added_on": "2022-10-09T11:24:35.085797Z",
      "country_iso2": "US",
      "number": "{your_tollfree_number}",
      "number_pool_uuid": "{number_pool_uuid}",
      "service": "mms",
      "type": "tollfree"
    }
  ]
}

This API fetches a list of all toll-free numbers from a number pool based on the number pool UUID specified in the resource URI.

API Endpoint

GET
https://api.plivo.com/v1/Account/{auth_id}/NumberPool/{number_pool_uuid}/Tollfree/

Arguments

No arguments need to be passed.

Returns

This API returns the list of toll-free numbers from the number pool.

The API response contains a meta field with the following fields:

  • limit: The size of the page returned in the response.
  • next: The URL that points to the next page of results. (Currently this will be blank because only one toll-free can be present in a number pool.)
  • offset: The offset for the page returned in the response.
  • previous: The URL that points to the previous page of results. (Currently this will be blank because only one toll-free can be present in a number pool.)
  • total_count: The total number of records that match the specified filters. (Currently this is always 1.)
import plivo

client = plivo.RestClient(auth_id="<auth_id>", auth_token="<auth_token>")
# List all Tollfree in a Powerpack
powerpack = client.powerpacks.get(uuid='<powerpack_uuid>')
# Version 1
response = powerpack.list_tollfree()
# Version 2
response = powerpack.numberpool.tollfree.list()
print(response)
{
  "api_id": "06c15d7c-7ed5-11ea-855f-0242ac110003",
  "meta": {
    "limit": 20,
    "next": "",
    "offset": 0,
    "previous": "",
    "total_count": 1
  },
  "objects": [
    {
      "account_phone_number_resource": "/v1/Account/{auth_id}/Number/{your_tollfree_number}/",
      "added_on": "2022-10-09T11:24:35.085797Z",
      "country_iso2": "US",
      "number": "{your_tollfree_number}",
      "number_pool_uuid": "{number_pool_uuid}",
      "service": "mms",
      "type": "tollfree"
    }
  ]
}