import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const numberReservation = await client.numberReservations.create();
console.log(numberReservation.data);{
"data": {
"id": "12ade33a-21c0-473b-b055-b3c836e1c292",
"record_type": "number_reservation",
"phone_numbers": [
{
"id": "12ade33a-21c0-473b-b055-b3c836e1c292",
"record_type": "reserved_phone_number",
"phone_number": "+19705555098",
"status": "pending",
"created_at": "2018-01-01T00:00:00.000000Z",
"updated_at": "2018-01-01T00:00:00.000000Z",
"expired_at": "2018-01-01T00:00:00.000000Z",
"errors": ""
}
],
"status": "pending",
"customer_reference": "MY REF 001",
"created_at": "2018-01-01T00:00:00.000000Z",
"updated_at": "2018-01-01T00:00:00.000000Z"
}
}Creates a Phone Number Reservation for multiple numbers.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const numberReservation = await client.numberReservations.create();
console.log(numberReservation.data);{
"data": {
"id": "12ade33a-21c0-473b-b055-b3c836e1c292",
"record_type": "number_reservation",
"phone_numbers": [
{
"id": "12ade33a-21c0-473b-b055-b3c836e1c292",
"record_type": "reserved_phone_number",
"phone_number": "+19705555098",
"status": "pending",
"created_at": "2018-01-01T00:00:00.000000Z",
"updated_at": "2018-01-01T00:00:00.000000Z",
"expired_at": "2018-01-01T00:00:00.000000Z",
"errors": ""
}
],
"status": "pending",
"customer_reference": "MY REF 001",
"created_at": "2018-01-01T00:00:00.000000Z",
"updated_at": "2018-01-01T00:00:00.000000Z"
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Successful response with details about a number reservation.
Show child attributes
"12ade33a-21c0-473b-b055-b3c836e1c292"
"number_reservation"
Show child attributes
"12ade33a-21c0-473b-b055-b3c836e1c292"
"reserved_phone_number"
"+19705555098"
The status of the phone number's reservation.
pending, success, failure "success"
An ISO 8901 datetime string denoting when the individual number reservation was created.
"2018-01-01T00:00:00.000000Z"
An ISO 8901 datetime string for when the the individual number reservation was updated.
"2018-01-01T00:00:00.000000Z"
An ISO 8901 datetime string for when the individual number reservation is going to expire
"2018-01-01T00:00:00.000000Z"
The status of the entire reservation.
pending, success, failure A customer reference string for customer look ups.
"MY REF 001"
An ISO 8901 datetime string denoting when the numbers reservation was created.
"2018-01-01T00:00:00.000000Z"
An ISO 8901 datetime string for when the number reservation was updated.
"2018-01-01T00:00:00.000000Z"
{
"id": "12ade33a-21c0-473b-b055-b3c836e1c292",
"record_type": "number_reservation",
"phone_numbers": [
{
"id": "12ade33a-21c0-473b-b055-b3c836e1c292",
"record_type": "reserved_phone_number",
"phone_number": "+19705555098",
"status": "pending",
"created_at": "2018-01-01T00:00:00.000000Z",
"updated_at": "2018-01-01T00:00:00.000000Z",
"expired_at": "2018-01-01T00:00:00.000000Z",
"errors": ""
}
],
"status": "pending",
"customer_reference": "MY REF 001",
"created_at": "2018-01-01T00:00:00.000000Z",
"updated_at": "2018-01-01T00:00:00.000000Z"
}Was this page helpful?