List your allocated numbers
/v1/numbersfor await (const allocated of bird.numbers.list({ country_code: "GB" })) {
// kind distinguishes a number you bought from one Bird manages.
console.log(allocated.number, allocated.kind, allocated.status);
}for allocated in client.numbers.list(country_code="GB"):
# kind distinguishes a number you bought from one Bird manages.
print(allocated.number, allocated.kind, allocated.status)for allocated, err := range client.Numbers.List(context.Background(), bird.NumbersListParams{
CountryCode: "GB",
}) {
if err != nil {
log.Fatal(err)
}
// Kind distinguishes a number you bought from one Bird manages.
fmt.Println(allocated.Number, allocated.Kind, allocated.Status)
}$page = $bird->numbers->list(['country_code' => 'GB']);
foreach ($page as $allocated) {
// kind distinguishes a number you bought from one Bird manages.
echo $allocated->getNumber(), ' ', $allocated->getKind(), ' ', $allocated->getStatus(), "\n";
}bird numbers listcurl -X GET "https://us1.platform.bird.com/v1/numbers" \
-H "Authorization: Bearer $TOKEN" \
--url-query "limit=25"{
"data": [
{
"id": "nda_01krdgeqcxet5s7t44vh8rt9mg",
"kind": "dedicated",
"country_code": "US",
"number_type": "mobile",
"capabilities": [
"sms"
],
"status": "active",
"ownership": {
"submission_id": "csb_01krdgeqcxet5s7t44vh8rt9mg",
"status": "needs_input",
"next": [
{
"kind": "operation"
}
]
}
}
],
"next_cursor": "eyJ2IjoxLCJzIjoiXCIyMDI2LTA1LTI1VDE0OjAzOjEwWlwiIiwiaSI6IjAxOTJmM2IxLTRjN2UtN2EyYi05ZDYxLThmM2E1YzJlN2I0MCJ9",
"prev_cursor": null,
"refresh_cursor": "eyJ2IjoxLCJzIjoiXCIyMDI2LTA1LTI1VDE2OjQyOjAxWlwiIiwiaSI6IjAxOTJmM2IxLTllMDQtN2NkMy1iODE3LTJhNmY0ZDFjOGUwOSJ9"
}
Returns a paginated list of the phone numbers currently allocated to your workspace, newest first. Each entry is either a dedicated number you bought or a shared number managed for you, as its kind field indicates. Pass number to look one up, or narrow the list with country_code, number_type, prefix, and capabilities. Use search to find a number by its name or reference, or reference for an exact match. An allocated number is not always enough to send from it: some countries also require an approved registration for the sender.
Paramètres de requête
searchstringMatches part of the number, name, or reference, ignoring case. Number matching also ignores phone formatting such as spaces, parentheses, and hyphens. Name and reference matching preserves punctuation. Characters such as percent and underscore match literally.
referencestringReturn numbers with this exact reference. Matching is case-sensitive.
numberstringReturn only the number matching these digits. Give a full number with its country code, however your own records spell it: +12025550188, 12025550188, 0012025550188, and +1 202 555 0188 all resolve to the same number. Spacing and punctuation are fine once a leading + or 00 marks the country code, or when country_code names the country; a grouped spelling without either is refused rather than guessed at, and a national spelling (bare digits without the country code) matches only when country_code names the country. A short code is matched on its bare digits instead, and since the same short code can be allocated in more than one country, pass country_code alongside it to name which one. This filter narrows the list like the others rather than replacing them, so a country or capability filter still applies. To match a range of numbers rather than one, use prefix.
country_codestringFilter by the country a number belongs to, as an ISO 3166-1 alpha-2 code.
number_typestringReturn only allocated numbers of this physical type after applying the country and prefix filters.
Possible values (may grow over time): mobile, local, national, short_code, short_code_fteu, toll_free
prefixstringReturn only numbers that start with these digits. With country_code, the digits are national ones, matched right after the country dial code: with country_code=US, prefix=212 returns the +1 212 area-code numbers allocated to you. Leave out the dial code and any national dialing prefix such as a leading 0; short codes never match a country-anchored prefix search. Without country_code, the digits are matched from the start of each stored number, ignoring a leading +, so short codes are reachable and a full number in digits finds itself. Digits only: up to 10 of them with country_code, 15 without.
capabilitiesarrayFilter by capability. Repeat the parameter to require several at once: capabilities=sms&capabilities=voice returns only numbers that support both.
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.
Contenu de la réponse
dataAfficher les attributs enfants
data.nameThe name you gave this number in your workspace. Null when no name is set.
data.referenceYour own reference for this number in your workspace. Null when no reference is set.
data.idIdentifier of this allocated number. Pass it as number_id to read this number, or to cancel or release it when kind is dedicated.
data.kindHow this number is allocated. dedicated belongs to your workspace and is billed as a subscription. shared is provided through Bird-managed shared infrastructure and is not owned or billed as a workspace subscription.
Possible values: dedicated, shared
data.numberPhone number in E.164 format.
data.country_codedata.number_typePhysical type of this phone number.
data.capabilitiesCapabilities supported by this number.
data.statusThe allocation and ownership-approval status of this number.
activemeans this number is allocated to your workspace and usable.pending_ownership_registrationmeans this number is allocated to your workspace and billed, but outbound SMS and both inbound and outbound voice calls are blocked until ownership registration is approved and activation completes, or the ownership requirement is withdrawn. This ownership status does not gate inbound SMS or WhatsApp. Readownership.statusandownership.nextfor the current decision and remaining work.releasedmeans this number is no longer allocated to your workspace.
An allocated number is not always enough to send from it: some destination countries also require an approved registration for the sender.
Possible values: active, pending_ownership_registration, released
data.allocated_atWhen this number was allocated to your workspace.
data.releases_atWhen a scheduled release of this number takes effect, at the end of its current billing period. The number stays allocated, with its current status, until then. null when no release is scheduled.
data.released_atWhen this number was released. null while it is still allocated to your workspace.
data.ownershipOwnership paperwork and activation progress. null when no ownership requirements, recorded block, or recorded decision apply, or when requirements or progress cannot be read and no ownership block or decision has been recorded. A recorded block still returns an ownership object with status: unknown when progress cannot be read; retry the read. We manage the paperwork for shared short codes, so this field is always null for them. Other sending requirements can apply even when ownership registration is complete.
next_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.
Ressources associées
Poursuivez avec la documentation, les guides et les exemples sur ce sujet.