List your number orders
/v1/numbers/ordersconst 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"{
"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.
查询参数
statusstringReturn only orders with status charging, ordering, pending, completed, or failed.
Possible values (may grow over time): charging, ordering, pending, completed, failed
limitintegerMaximum number of items to return per page.
starting_afterstringCursor from the next_cursor field of a previous list response. Returns items immediately after the cursor position in the current sort order.
ending_beforestringCursor 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.
响应载荷
data显示子属性
data.idIdentifier of this purchase order.
data.numberThe number being acquired, in E.164 format.
data.country_codedata.number_typePhysical type of the number being acquired.
data.statusdata.number_idIdentifier 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_reasonHuman-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_atWhen the purchase completed and the number became owned (status completed). null for orders still in progress or failed.
data.created_atdata.updated_atnext_cursorCursor for the next page. Pass back as starting_after to advance forward. null when no next page exists.
prev_cursorCursor for the previous page. Pass back as ending_before to step backward. null when no previous page exists.
refresh_cursorRefresh 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.