List the phone numbers attached to each agent
const url = 'https://api.vocapable.com/v1/agent-phone-numbers';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.vocapable.com/v1/agent-phone-numbers \ --header 'Authorization: Bearer <token>'Every number each agent answers or dials from, and how it is attached.
One read for the whole agent directory, so a list of agent cards never needs one request
per number or per policy. Numbers on their way out of service are left out, and so are
campaigns that can no longer dial. See AgentPhoneAttachmentKind for the four kinds.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”Successful Response
Every agent of this tenant with at least one attached number.
An agent absent from data has no number attached in any of the four ways. Not
paginated: the response is bounded by the numbers the tenant holds.
object
object
One number attached to one agent, and how it is attached.
A number attached in several ways (say, one policy step and one caller-ID pool) appears once per kind, so a reader never has to guess which relationship a row describes.
object
Example
{ "data": [ { "numbers": [ { "number_status": "provisioning", "kind": "inbound_agent", "policy_hours": "always" } ] } ]}