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";
}curl -X GET "https://us1.platform.bird.com/v1/numbers/orders" \
-H "Authorization: Bearer $TOKEN" \
--url-query "limit=25"Response200
{
"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.
查询参数
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 field of a previous list response. Returns items immediately before the cursor position in the current sort order.
响应载荷
data
array of object
必填
显示子属性
data.id
string
必填
Identifier of this purchase order.
data.number
string
必填
The number being acquired, in E.164 format.
data.country_code
string
必填
data.number_type
string
必填
Physical type of the number being acquired.
data.status
string
必填
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
必填
data.updated_at
string
必填
next_cursor
nullable string
必填
Cursor for the next page. Pass back as starting_after to advance forward. null when no next page exists.
prev_cursor
nullable string
必填
Cursor for the previous page. Pass back as ending_before to step backward. null when no previous page exists.
refresh_cursor
nullable string
必填
Refresh anchor. Pass back as ending_before later to fetch items that have appeared since this response. Non-null whenever data is non-empty; null only on an empty page. Distinct from prev_cursor.