import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const phoneNumberBlock = await client.portingOrders.phoneNumberBlocks.create(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
{
activation_ranges: [{ end_at: '+4930244999910', start_at: '+4930244999901' }],
phone_number_range: { end_at: '+4930244999910', start_at: '+4930244999901' },
},
);
console.log(phoneNumberBlock.data);{
"data": {
"id": "f24151b6-3389-41d3-8747-7dd8c681e5e2",
"country_code": "DE",
"phone_number_type": "local",
"phone_number_range": {
"start_at": "+4930244999901",
"end_at": "+4930244999910"
},
"activation_ranges": [
{
"start_at": "+4930244999901",
"end_at": "+4930244999910"
}
],
"record_type": "porting_phone_number_block",
"created_at": "2021-03-19T10:07:15.527Z",
"updated_at": "2021-03-19T10:07:15.527Z"
}
}Creates a new phone number block.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const phoneNumberBlock = await client.portingOrders.phoneNumberBlocks.create(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
{
activation_ranges: [{ end_at: '+4930244999910', start_at: '+4930244999901' }],
phone_number_range: { end_at: '+4930244999910', start_at: '+4930244999901' },
},
);
console.log(phoneNumberBlock.data);{
"data": {
"id": "f24151b6-3389-41d3-8747-7dd8c681e5e2",
"country_code": "DE",
"phone_number_type": "local",
"phone_number_range": {
"start_at": "+4930244999901",
"end_at": "+4930244999910"
},
"activation_ranges": [
{
"start_at": "+4930244999901",
"end_at": "+4930244999910"
}
],
"record_type": "porting_phone_number_block",
"created_at": "2021-03-19T10:07:15.527Z",
"updated_at": "2021-03-19T10:07:15.527Z"
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Identifies the Porting Order associated with the phone number block
Show child attributes
Specifies the activation ranges for this porting phone number block. The activation range must be within the block range and should not overlap with other activation ranges.
Show child attributes
Specifies the start of the activation range. Must be greater or equal the start of the extension range.
"+4930244999901"
Specifies the end of the activation range. It must be no more than the end of the extension range.
"+4930244999910"
Successful response
Show child attributes
Uniquely identifies this porting phone number block.
"f24151b6-3389-41d3-8747-7dd8c681e5e2"
Specifies the country code for this porting phone number block. It is a two-letter ISO 3166-1 alpha-2 country code.
"DE"
Specifies the phone number type for this porting phone number block.
landline, local, mobile, national, shared_cost, toll_free "local"
Specifies the phone number range for this porting phone number block.
Show child attributes
Specifies the activation ranges for this porting phone number block. The activation range must be within the phone number range and should not overlap with other activation ranges.
Show child attributes
Specifies the start of the activation range. Must be greater or equal the start of the phone number range.
"+4930244999901"
Specifies the end of the activation range. It must be no more than the end of the phone number range.
"+4930244999910"
Identifies the type of the resource.
"porting_phone_number_block"
ISO 8601 formatted date indicating when the resource was created.
"2021-03-19T10:07:15.527Z"
ISO 8601 formatted date indicating when the resource was last updated.
"2021-03-19T10:07:15.527Z"
Was this page helpful?