import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const requirements = await client.requirements.list();
console.log(requirements.data);{
"data": [
{
"record_type": "requirement",
"country_code": "FR",
"locality": "Nice",
"phone_number_type": "local",
"action": "ordering",
"requirements_types": [
{
"acceptance_criteria": {
"time_limit": "Current and not expired",
"locality_limit": "Issued by the same country that the phone number belongs to",
"acceptable_values": [
"US"
],
"max_length": 20,
"min_length": 16,
"acceptable_characters": "abcdef0123456789"
},
"description": "Proves the customer has a physical address in the same locality as the phone number",
"example": "Utility bill, internet bill, phone bill, or lease",
"type": "document",
"name": "Proof of Address",
"record_type": "requirement_type",
"id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"created_at": "2021-04-09T22:25:27.521Z",
"updated_at": "2021-04-12T20:20:20.020Z"
}
],
"id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"created_at": "2021-04-09T22:25:27.521Z",
"updated_at": "2021-04-12T20:20:20.020Z"
}
],
"meta": {
"page_number": 2,
"page_size": 25,
"total_pages": 3,
"total_results": 55
}
}List all requirements with filtering, sorting, and pagination
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const requirements = await client.requirements.list();
console.log(requirements.data);{
"data": [
{
"record_type": "requirement",
"country_code": "FR",
"locality": "Nice",
"phone_number_type": "local",
"action": "ordering",
"requirements_types": [
{
"acceptance_criteria": {
"time_limit": "Current and not expired",
"locality_limit": "Issued by the same country that the phone number belongs to",
"acceptable_values": [
"US"
],
"max_length": 20,
"min_length": 16,
"acceptable_characters": "abcdef0123456789"
},
"description": "Proves the customer has a physical address in the same locality as the phone number",
"example": "Utility bill, internet bill, phone bill, or lease",
"type": "document",
"name": "Proof of Address",
"record_type": "requirement_type",
"id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"created_at": "2021-04-09T22:25:27.521Z",
"updated_at": "2021-04-12T20:20:20.020Z"
}
],
"id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"created_at": "2021-04-09T22:25:27.521Z",
"updated_at": "2021-04-12T20:20:20.020Z"
}
],
"meta": {
"page_number": 2,
"page_size": 25,
"total_pages": 3,
"total_results": 55
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Consolidated filter parameter for requirements (deepObject style). Originally: filter[country_code], filter[phone_number_type], filter[action]
Show child attributes
Filters results to those applying to a 2-character (ISO 3166-1 alpha-2) country code
"US"
Filters results to those applying to a specific phone_number_type
local, national, toll_free "local"
Filters requirements to those applying to a specific action.
branded_calling, ordering, porting "porting"
Consolidated sort parameter for requirements (deepObject style). Originally: sort[]
Specifies the sort order for results. If you want to sort by a field in ascending order, include it as a sort parameter. If you want to sort in descending order, prepend a - in front of the field name.
created_at, updated_at, country_code, phone_number_type, -created_at, -updated_at, -country_code, -phone_number_type ["country_code"]Successful response
Show child attributes
Identifies the type of the resource.
"requirement"
The 2-character (ISO 3166-1 alpha-2) country code where this requirement applies
"FR"
The locality where this requirement applies
"Nice"
Indicates the phone_number_type this requirement applies to. Leave blank if this requirement applies to all number_types.
local, national, toll_free "local"
Indicates whether this requirement applies to branded_calling, ordering, porting, or both ordering and porting
both, branded_calling, ordering, porting "ordering"
Lists the requirement types necessary to fulfill this requirement
Show child attributes
Specifies objective criteria for acceptance
Show child attributes
Specifies time-based acceptance criteria
"Current and not expired"
Specifies geography-based acceptance criteria
"Issued by the same country that the phone number belongs to"
Specifies the list of strictly possible values for the requirement. Ignored when empty
Maximum length allowed for the value
20
Minimum length allowed for the value
16
Specifies the allowed characters as a string
"abcdef0123456789"
Describes the requirement type
"Proves the customer has a physical address in the same locality as the phone number"
Provides one or more examples of acceptable documents
"Utility bill, internet bill, phone bill, or lease"
Defines the type of this requirement type
document, address, textual "document"
A short descriptive name for this requirement_type
"Proof of Address"
Identifies the type of the resource
"requirement_type"
Identifies the associated document
"6a09cdc3-8948-47f0-aa62-74ac943d6c58"
ISO 8601 formatted date-time indicating when the resource was created.
"2021-04-09T22:25:27.521Z"
ISO 8601 formatted date-time indicating when the resource was last updated.
"2021-04-12T20:20:20.020Z"
Identifies the associated document
"6a09cdc3-8948-47f0-aa62-74ac943d6c58"
ISO 8601 formatted date-time indicating when the resource was created.
"2021-04-09T22:25:27.521Z"
ISO 8601 formatted date-time indicating when the resource was last updated.
"2021-04-12T20:20:20.020Z"
Was this page helpful?