List your number orders
GET
/v1/numbers/orders
const page = await bird.numbers.orders.list({ status: "failed" });
for (const order of page.data) {
console.log(order.number, order.failure_reason ?? "");
}page = client.numbers.orders.list(status="failed")
for order in page.data:
print(order.number, order.failure_reason or "")for order, err := range client.Numbers.Orders.List(context.Background(), bird.NumbersOrdersListParams{
Status: "failed",
}) {
if err != nil {
log.Fatal(err)
}
fmt.Println(order.Number)
}$page = $bird->numbers->orders->list(['status' => 'failed']);
foreach ($page as $order) {
echo $order->getNumber(), ' ', $order->getFailureReason() ?? '', "\n";
}bird numbers orders listcurl -X GET "https://us1.platform.bird.com/v1/numbers/orders" \
-H "Authorization: Bearer $TOKEN" \
--url-query "limit=25"Réponse200
{
"data": [
{
"id": "nor_01krdgeqcxet5s7t44vh8rt9mg",
"country_code": "US",
"number_type": "mobile",
"status": "charging",
"number_id": "nda_01krdgeqcxet5s7t44vh8rt9mg"
}
],
"next_cursor": "eyJ2IjoxLCJzIjoiXCIyMDI2LTA1LTI1VDE0OjAzOjEwWlwiIiwiaSI6IjAxOTJmM2IxLTRjN2UtN2EyYi05ZDYxLThmM2E1YzJlN2I0MCJ9",
"prev_cursor": null,
"refresh_cursor": "eyJ2IjoxLCJzIjoiXCIyMDI2LTA1LTI1VDE2OjQyOjAxWlwiIiwiaSI6IjAxOTJmM2IxLTllMDQtN2NkMy1iODE3LTJhNmY0ZDFjOGUwOSJ9"
}
Returns your workspace's number orders, newest first. Filter by status to find in-progress or failed orders.
Paramètres de requête
status
string
Return only orders with status charging, ordering, pending, completed, or failed.
Possible values (may grow over time): charging, ordering, pending, completed, failed
limit
integer
Maximum number of items to return per page.
starting_after
string
Cursor from the next_cursor field of a previous list response. Returns items immediately after the cursor position in the current sort order.
ending_before
string
Cursor from the prev_cursor or refresh_cursor field of a previous list response. Returns items immediately before the cursor position in the current sort order. prev_cursor returns the preceding page. refresh_cursor anchors at the first row of that response, which on a newest-first sort is how to fetch the items that have appeared since.
Contenu de la réponse
data
array of object
obligatoire
Afficher les attributs enfants
data.id
string
obligatoire
Identifier of this purchase order.
data.number
string
obligatoire
The number being acquired, in E.164 format.
data.country_code
string
obligatoire
data.number_type
string
obligatoire
Physical type of the number being acquired.
data.status
string
obligatoire
data.number_id
nullable string
Identifier of the number this order produced, set when status is completed. Pass it as number_id to GET /v1/numbers/{number_id} or DELETE /v1/numbers/{number_id}. null until the order completes.
data.failure_reason
nullable string
Human-readable reason the purchase failed. null unless status is failed. An order can fail some time after it was created, so updated_at tells you when the failure was recorded rather than when the order was placed.
data.completed_at
nullable string
When the purchase completed and the number became owned (status completed). null for orders still in progress or failed.
data.created_at
string
obligatoire
data.updated_at
string
obligatoire
next_cursor
nullable string
obligatoire
Cursor for the next page. Pass back as starting_after to advance forward. null when no next page exists.
prev_cursor
nullable string
obligatoire
Cursor for the previous page. Pass back as ending_before to step backward. null when no previous page exists.
refresh_cursor
nullable string
obligatoire
Refresh anchor, the first row of this response. Pass back as ending_before to fetch what precedes it in the current sort order. On a newest-first sort those are the items that have appeared since; on any other sort they are the items that sort earlier, so refreshing such a list means re-fetching it instead. Non-null whenever data is non-empty; null only on an empty page. Distinct from prev_cursor.
Ressources associées
Poursuivez avec la documentation, les guides et les exemples sur ce sujet. Les ressources sont en anglais.
Comprendre le conceptWhat is a virtual phone number (VMN)?Explorer la fonctionnalitéSMS numbersGuide d'implémentationNumber types
Obtenir un guide d'implémentation