Short Code Numbers
Overview
A short number (4-6 digits) used for sending and receiving SMS and MMS messages to mobile phones in a single country. Short code numbers are strictly domestic and are not recommended for sending international traffic.
API Access
The following API requests can only be made using a valid access key, and attached to an access role, with an access policy that at least specifies the permissions to the resources outlined in each section below. Learn more about API access.
List Short Code Numbers
In order to retrieve all short code numbers available in your workspace you can use this request.
GET
/workspaces/{workspaceId}/numbers-short-code
Get a list of all short code numbers assigned to your workspace. The results can be paginated. To learn more about the pagination, please refer to the pagination section on API Access Common API Usage section.
查询参数
limit
integer
Limits the number of results to return.
pageToken
string
The cursor that keeps track of the current position in the results.
reverse
boolean
Reverses the order in which the results are returned.
响应载荷
nextPageToken
string
The token that can be passed as pageToken in URL to retrieve the next set of results. If missing, no more results to display. To know more, refer to the pagination section.
results
array of object
必填
显示子属性
results.id
string
必填
results.endpointId
string
必填
results.type
string
必填
Possible values: dedicated, vanity, shared
results.numberString
string
必填
results.countryCode
string
必填
The country code in ISO 3166-1 alpha-2 format.
results.capabilities
object
必填
Capabilities of the phone number. It shows if the phone number supports voice, sms and/or mms.
显示子属性
results.capabilities.voice
object
必填
显示子属性
results.capabilities.voice.inbound
boolean
必填
Whether the number supports inbound use cases.
results.capabilities.voice.outbound
boolean
必填
Whether the number supports outbound use cases.
results.capabilities.sms
object
必填
显示子属性
results.capabilities.sms.inbound
boolean
必填
Whether the number supports inbound use cases.
results.capabilities.sms.outbound
boolean
必填
Whether the number supports outbound use cases.
results.capabilities.mms
object
必填
显示子属性
results.capabilities.mms.inbound
boolean
必填
Whether the number supports inbound use cases.
results.capabilities.mms.outbound
boolean
必填
Whether the number supports outbound use cases.
results.capabilities.whatsapp
object
显示子属性
results.capabilities.whatsapp.inbound
boolean
必填
Whether the number supports inbound use cases.
results.capabilities.whatsapp.outbound
boolean
必填
Whether the number supports outbound use cases.
results.createdAt
string
必填
results.updatedAt
string
必填
results.endpoint
object
必填
A representation of an endpoint. It contains details such as the capabilities, dependencies, and more.
显示子属性
results.endpoint.id
string
必填
The ID of the endpoint.
results.endpoint.type
string
必填
The type of the endpoint. It can be a long code number, short code number, alpha number, ip pool, or rcs google agent.
Possible values: long-code-number, short-code-number, alpha-number, ip-pool, rcs-google-agent
results.endpoint.instanceId
string
必填
The unique identifier of the instance.
results.endpoint.name
string
必填
The name of the endpoint. For some cases it will be the number in international format as string.
results.endpoint.capabilities
array of object
必填
显示子属性
results.endpoint.capabilities.name
string
必填
Possible values: sms
results.endpoint.capabilities.inbound
object
显示子属性
results.endpoint.capabilities.inbound.status
string
必填
Possible values: active, inactive, available, unavailable
results.endpoint.capabilities.inbound.issues
array of string
results.endpoint.capabilities.outbound
object
显示子属性
results.endpoint.capabilities.outbound.status
string
必填
Possible values: active, inactive, available, unavailable
results.endpoint.capabilities.outbound.destinationStatuses
object
显示子属性
results.endpoint.capabilities.outbound.destinationStatuses.active
number
results.endpoint.capabilities.outbound.destinationStatuses.inactive
number
results.endpoint.capabilities.outbound.destinationStatuses.available
number
results.endpoint.capabilities.outbound.destinationStatuses.unavailable
number
results.endpoint.capabilities.outbound.supportsDestinations
boolean
Whether the number supports destinations
results.endpoint.capabilities.outbound.issues
array of string
results.endpoint.capabilities.name
string
必填
Possible values: mms
results.endpoint.capabilities.inbound
object
显示子属性
results.endpoint.capabilities.inbound.status
string
必填
Possible values: active, inactive, available, unavailable
results.endpoint.capabilities.inbound.issues
array of string
results.endpoint.capabilities.outbound
object
显示子属性
results.endpoint.capabilities.outbound.status
string
必填
Possible values: active, inactive, available, unavailable
results.endpoint.capabilities.outbound.destinationStatuses
object
显示子属性
results.endpoint.capabilities.outbound.destinationStatuses.active
number
results.endpoint.capabilities.outbound.destinationStatuses.inactive
number
results.endpoint.capabilities.outbound.destinationStatuses.available
number
results.endpoint.capabilities.outbound.destinationStatuses.unavailable
number
results.endpoint.capabilities.outbound.supportsDestinations
boolean
Whether the number supports destinations
results.endpoint.capabilities.outbound.issues
array of string
results.endpoint.capabilities.name
string
必填
Possible values: voice
results.endpoint.capabilities.inbound
object
显示子属性
results.endpoint.capabilities.inbound.status
string
必填
Possible values: active, inactive, available, unavailable
results.endpoint.capabilities.inbound.issues
array of string
results.endpoint.capabilities.outbound
object
显示子属性
results.endpoint.capabilities.outbound.status
string
必填
Possible values: active, inactive, available, unavailable
results.endpoint.capabilities.outbound.destinationStatuses
object
显示子属性
results.endpoint.capabilities.outbound.destinationStatuses.active
number
results.endpoint.capabilities.outbound.destinationStatuses.inactive
number
results.endpoint.capabilities.outbound.destinationStatuses.available
number
results.endpoint.capabilities.outbound.destinationStatuses.unavailable
number
results.endpoint.capabilities.outbound.supportsDestinations
boolean
Whether the number supports destinations
results.endpoint.capabilities.outbound.issues
array of string
results.endpoint.capabilities.useCaseType
string
Possible values: contact-centre
results.endpoint.capabilities.name
string
必填
Possible values: whatsapp
results.endpoint.capabilities.inbound
object
显示子属性
results.endpoint.capabilities.inbound.status
string
必填
Possible values: active, inactive, available, unavailable
results.endpoint.capabilities.inbound.issues
array of string
results.endpoint.capabilities.outbound
object
显示子属性
results.endpoint.capabilities.outbound.status
string
必填
Possible values: active, inactive, available, unavailable
results.endpoint.capabilities.outbound.destinationStatuses
object
显示子属性
results.endpoint.capabilities.outbound.destinationStatuses.active
number
results.endpoint.capabilities.outbound.destinationStatuses.inactive
number
results.endpoint.capabilities.outbound.destinationStatuses.available
number
results.endpoint.capabilities.outbound.destinationStatuses.unavailable
number
results.endpoint.capabilities.outbound.supportsDestinations
boolean
Whether the number supports destinations
results.endpoint.capabilities.outbound.issues
array of string
results.endpoint.capabilities.name
string
必填
Possible values: email
results.endpoint.capabilities.inbound
object
显示子属性
results.endpoint.capabilities.inbound.status
string
必填
Possible values: active, inactive, available, unavailable
results.endpoint.capabilities.inbound.issues
array of string
results.endpoint.capabilities.outbound
object
显示子属性
results.endpoint.capabilities.outbound.status
string
必填
Possible values: active, inactive, available, unavailable
results.endpoint.capabilities.outbound.destinationStatuses
object
显示子属性
results.endpoint.capabilities.outbound.destinationStatuses.active
number
results.endpoint.capabilities.outbound.destinationStatuses.inactive
number
results.endpoint.capabilities.outbound.destinationStatuses.available
number
results.endpoint.capabilities.outbound.destinationStatuses.unavailable
number
results.endpoint.capabilities.outbound.supportsDestinations
boolean
Whether the number supports destinations
results.endpoint.capabilities.outbound.issues
array of string
results.endpoint.capabilities.name
string
必填
Possible values: rcs-google
results.endpoint.capabilities.inbound
object
显示子属性
results.endpoint.capabilities.inbound.status
string
必填
Possible values: active, inactive, available, unavailable
results.endpoint.capabilities.inbound.issues
array of string
results.endpoint.capabilities.outbound
object
显示子属性
results.endpoint.capabilities.outbound.status
string
必填
Possible values: active, inactive, available, unavailable
results.endpoint.capabilities.outbound.destinationStatuses
object
显示子属性
results.endpoint.capabilities.outbound.destinationStatuses.active
number
results.endpoint.capabilities.outbound.destinationStatuses.inactive
number
results.endpoint.capabilities.outbound.destinationStatuses.available
number
results.endpoint.capabilities.outbound.destinationStatuses.unavailable
number
results.endpoint.capabilities.outbound.supportsDestinations
boolean
Whether the number supports destinations
results.endpoint.capabilities.outbound.issues
array of string
results.endpoint.dependencies
array of object
The dependencies of the endpoint. It shows the connectors that the endpoint is connected to.
显示子属性
results.endpoint.dependencies.type
string
Possible values: connector
results.endpoint.dependencies.connectorId
string
必填
results.endpoint.dependencies.connectorTemplateRef
string
必填
results.endpoint.dependencies.capabilities
array of string
results.endpoint.issues
array of string
results.endpoint.provisioningStatus
string
必填
Possible values: provisioned, provisioning, deprovisioned, deprovisioning
results.endpoint.whatsApp
object
WhatsApp pre-verification details for this endpoint, if applicable. Only present for long code numbers from WhatsApp-capable providers.
显示子属性
results.endpoint.whatsApp.whatsAppId
string
results.endpoint.whatsApp.status
string
WhatsApp number status
Possible values: unknown, already-exists, installed, verified, not-verified, expired
results.endpoint.whatsApp.stage
string
results.endpoint.whatsApp.attempt
integer
results.endpoint.whatsApp.nextAttemptAt
string
results.endpoint.whatsApp.verificationExpiresAt
string
results.endpoint.whatsApp.requestedCodeAt
string
results.endpoint.whatsApp.createdAt
string
results.endpoint.whatsApp.updatedAt
string
results.endpoint.createdAt
string
必填
results.endpoint.updatedAt
string
必填
代码示例
curl -X GET 'https://api.bird.com/workspaces/{workspaceId}/numbers-short-code' \
-H 'Authorization: AccessKey YOUR_ACCESS_KEY'代码示例
curl "https://api.bird.com/workspaces/{workpaceId}/numbers-short-code/" \
-H 'Authorization: Bearer <your-access-key>'
代码示例
{
"results": [
{
"id": "uuid",
"numberString": "string",
"countryCode": "string",
"capabilities": {
"voice": {
"inbound": false,
"outbound": false
},
"sms": {
"inbound": true,
"outbound": true
},
"mms": {
"inbound": false,
"outbound": false
}
},
"endpointId": "uuid",
"createdAt": "2023-10-23T12:35:39.339-03:00",
"updatedAt": "2023-10-23T12:35:39.411-03:00",
"endpoint": {
"id": "uuid",
"type": "short-code-number",
"instanceId": "uuid",
"name": "string",
"createdAt": "2023-10-23T12:35:39.339-03:00",
"updatedAt": "2023-10-23T12:35:39.382-03:00",
"capabilities": [
{
"name": "sms",
"inbound": {
"status": "active",
"subscriptions": [
"main"
],
"fees": [
"setup"
]
},
"outbound": {
"status": "active",
"subscriptions": [
"main"
],
"fees": [
"setup"
],
"destinationStatuses": {
"active": 1
}
}
}
]
}
},
{
"id": "uuid",
"numberString": "string",
"countryCode": "string",
"capabilities": {
"voice": {
"inbound": false,
"outbound": false
},
"sms": {
"inbound": true,
"outbound": true
},
"mms": {
"inbound": false,
"outbound": false
}
},
"endpointId": "uuid",
"createdAt": "2023-10-23T12:35:39.246-03:00",
"updatedAt": "2023-10-23T12:35:39.246-03:00",
"endpoint": {
"id": "uuid",
"type": "short-code-number",
"instanceId": "string",
"name": "string",
"createdAt": "2023-10-23T12:35:39.246-03:00",
"updatedAt": "2023-10-23T12:35:39.318-03:00",
"capabilities": [
{
"name": "sms",
"inbound": {
"status": "active",
"subscriptions": [
"main"
],
"fees": [
"setup"
]
},
"outbound": {
"status": "active",
"subscriptions": [
"main"
],
"fees": [
"setup"
],
"destinationStatuses": {
"active": 1
}
}
}
]
}
}
]
}
Get a Short Code Number
In order to retrieve the details of a short code number available in your workspace you can use this request.
GET
/workspaces/{workspaceId}/numbers-short-code/{shortCodeNumberId}
This endpoint returns the previously created short code number by its ID.
响应载荷
id
string
必填
endpointId
string
必填
type
string
必填
Possible values: dedicated, vanity, shared
numberString
string
必填
countryCode
string
必填
The country code in ISO 3166-1 alpha-2 format.
capabilities
object
必填
Capabilities of the phone number. It shows if the phone number supports voice, sms and/or mms.
显示子属性
capabilities.voice
object
必填
显示子属性
capabilities.voice.inbound
boolean
必填
Whether the number supports inbound use cases.
capabilities.voice.outbound
boolean
必填
Whether the number supports outbound use cases.
capabilities.sms
object
必填
显示子属性
capabilities.sms.inbound
boolean
必填
Whether the number supports inbound use cases.
capabilities.sms.outbound
boolean
必填
Whether the number supports outbound use cases.
capabilities.mms
object
必填
显示子属性
capabilities.mms.inbound
boolean
必填
Whether the number supports inbound use cases.
capabilities.mms.outbound
boolean
必填
Whether the number supports outbound use cases.
capabilities.whatsapp
object
显示子属性
capabilities.whatsapp.inbound
boolean
必填
Whether the number supports inbound use cases.
capabilities.whatsapp.outbound
boolean
必填
Whether the number supports outbound use cases.
createdAt
string
必填
updatedAt
string
必填
endpoint
object
必填
A representation of an endpoint. It contains details such as the capabilities, dependencies, and more.
显示子属性
endpoint.id
string
必填
The ID of the endpoint.
endpoint.type
string
必填
The type of the endpoint. It can be a long code number, short code number, alpha number, ip pool, or rcs google agent.
Possible values: long-code-number, short-code-number, alpha-number, ip-pool, rcs-google-agent
endpoint.instanceId
string
必填
The unique identifier of the instance.
endpoint.name
string
必填
The name of the endpoint. For some cases it will be the number in international format as string.
endpoint.capabilities
array of object
必填
显示子属性
endpoint.capabilities.name
string
必填
Possible values: sms
endpoint.capabilities.inbound
object
显示子属性
endpoint.capabilities.inbound.status
string
必填
Possible values: active, inactive, available, unavailable
endpoint.capabilities.inbound.issues
array of string
endpoint.capabilities.outbound
object
显示子属性
endpoint.capabilities.outbound.status
string
必填
Possible values: active, inactive, available, unavailable
endpoint.capabilities.outbound.destinationStatuses
object
显示子属性
endpoint.capabilities.outbound.destinationStatuses.active
number
endpoint.capabilities.outbound.destinationStatuses.inactive
number
endpoint.capabilities.outbound.destinationStatuses.available
number
endpoint.capabilities.outbound.destinationStatuses.unavailable
number
endpoint.capabilities.outbound.supportsDestinations
boolean
Whether the number supports destinations
endpoint.capabilities.outbound.issues
array of string
endpoint.capabilities.name
string
必填
Possible values: mms
endpoint.capabilities.inbound
object
显示子属性
endpoint.capabilities.inbound.status
string
必填
Possible values: active, inactive, available, unavailable
endpoint.capabilities.inbound.issues
array of string
endpoint.capabilities.outbound
object
显示子属性
endpoint.capabilities.outbound.status
string
必填
Possible values: active, inactive, available, unavailable
endpoint.capabilities.outbound.destinationStatuses
object
显示子属性
endpoint.capabilities.outbound.destinationStatuses.active
number
endpoint.capabilities.outbound.destinationStatuses.inactive
number
endpoint.capabilities.outbound.destinationStatuses.available
number
endpoint.capabilities.outbound.destinationStatuses.unavailable
number
endpoint.capabilities.outbound.supportsDestinations
boolean
Whether the number supports destinations
endpoint.capabilities.outbound.issues
array of string
endpoint.capabilities.name
string
必填
Possible values: voice
endpoint.capabilities.inbound
object
显示子属性
endpoint.capabilities.inbound.status
string
必填
Possible values: active, inactive, available, unavailable
endpoint.capabilities.inbound.issues
array of string
endpoint.capabilities.outbound
object
显示子属性
endpoint.capabilities.outbound.status
string
必填
Possible values: active, inactive, available, unavailable
endpoint.capabilities.outbound.destinationStatuses
object
显示子属性
endpoint.capabilities.outbound.destinationStatuses.active
number
endpoint.capabilities.outbound.destinationStatuses.inactive
number
endpoint.capabilities.outbound.destinationStatuses.available
number
endpoint.capabilities.outbound.destinationStatuses.unavailable
number
endpoint.capabilities.outbound.supportsDestinations
boolean
Whether the number supports destinations
endpoint.capabilities.outbound.issues
array of string
endpoint.capabilities.useCaseType
string
Possible values: contact-centre
endpoint.capabilities.name
string
必填
Possible values: whatsapp
endpoint.capabilities.inbound
object
显示子属性
endpoint.capabilities.inbound.status
string
必填
Possible values: active, inactive, available, unavailable
endpoint.capabilities.inbound.issues
array of string
endpoint.capabilities.outbound
object
显示子属性
endpoint.capabilities.outbound.status
string
必填
Possible values: active, inactive, available, unavailable
endpoint.capabilities.outbound.destinationStatuses
object
显示子属性
endpoint.capabilities.outbound.destinationStatuses.active
number
endpoint.capabilities.outbound.destinationStatuses.inactive
number
endpoint.capabilities.outbound.destinationStatuses.available
number
endpoint.capabilities.outbound.destinationStatuses.unavailable
number
endpoint.capabilities.outbound.supportsDestinations
boolean
Whether the number supports destinations
endpoint.capabilities.outbound.issues
array of string
endpoint.capabilities.name
string
必填
Possible values: email
endpoint.capabilities.inbound
object
显示子属性
endpoint.capabilities.inbound.status
string
必填
Possible values: active, inactive, available, unavailable
endpoint.capabilities.inbound.issues
array of string
endpoint.capabilities.outbound
object
显示子属性
endpoint.capabilities.outbound.status
string
必填
Possible values: active, inactive, available, unavailable
endpoint.capabilities.outbound.destinationStatuses
object
显示子属性
endpoint.capabilities.outbound.destinationStatuses.active
number
endpoint.capabilities.outbound.destinationStatuses.inactive
number
endpoint.capabilities.outbound.destinationStatuses.available
number
endpoint.capabilities.outbound.destinationStatuses.unavailable
number
endpoint.capabilities.outbound.supportsDestinations
boolean
Whether the number supports destinations
endpoint.capabilities.outbound.issues
array of string
endpoint.capabilities.name
string
必填
Possible values: rcs-google
endpoint.capabilities.inbound
object
显示子属性
endpoint.capabilities.inbound.status
string
必填
Possible values: active, inactive, available, unavailable
endpoint.capabilities.inbound.issues
array of string
endpoint.capabilities.outbound
object
显示子属性
endpoint.capabilities.outbound.status
string
必填
Possible values: active, inactive, available, unavailable
endpoint.capabilities.outbound.destinationStatuses
object
显示子属性
endpoint.capabilities.outbound.destinationStatuses.active
number
endpoint.capabilities.outbound.destinationStatuses.inactive
number
endpoint.capabilities.outbound.destinationStatuses.available
number
endpoint.capabilities.outbound.destinationStatuses.unavailable
number
endpoint.capabilities.outbound.supportsDestinations
boolean
Whether the number supports destinations
endpoint.capabilities.outbound.issues
array of string
endpoint.dependencies
array of object
The dependencies of the endpoint. It shows the connectors that the endpoint is connected to.
显示子属性
endpoint.dependencies.type
string
Possible values: connector
endpoint.dependencies.connectorId
string
必填
endpoint.dependencies.connectorTemplateRef
string
必填
endpoint.dependencies.capabilities
array of string
endpoint.issues
array of string
endpoint.provisioningStatus
string
必填
Possible values: provisioned, provisioning, deprovisioned, deprovisioning
endpoint.whatsApp
object
WhatsApp pre-verification details for this endpoint, if applicable. Only present for long code numbers from WhatsApp-capable providers.
显示子属性
endpoint.whatsApp.whatsAppId
string
endpoint.whatsApp.status
string
WhatsApp number status
Possible values: unknown, already-exists, installed, verified, not-verified, expired
endpoint.whatsApp.stage
string
endpoint.whatsApp.attempt
integer
endpoint.whatsApp.nextAttemptAt
string
endpoint.whatsApp.verificationExpiresAt
string
endpoint.whatsApp.requestedCodeAt
string
endpoint.whatsApp.createdAt
string
endpoint.whatsApp.updatedAt
string
endpoint.createdAt
string
必填
endpoint.updatedAt
string
必填
代码示例
curl -X GET 'https://api.bird.com/workspaces/{workspaceId}/numbers-short-code/{shortCodeNumberId}' \
-H 'Authorization: AccessKey YOUR_ACCESS_KEY'代码示例
curl "https://api.bird.com/workspaces/{workpaceId}/numbers-short-code/{shorCodeNumberId}" \
-H 'Authorization: Bearer <your-access-key>'
代码示例
{
"id": "uuid",
"numberString": "string",
"countryCode": "string",
"capabilities": {
"voice": {
"inbound": false,
"outbound": false
},
"sms": {
"inbound": true,
"outbound": true
},
"mms": {
"inbound": false,
"outbound": false
}
},
"endpointId": "uuid",
"createdAt": "2023-10-23T12:35:39.339-03:00",
"updatedAt": "2023-10-23T12:35:39.411-03:00",
"endpoint": {
"id": "uuid",
"type": "short-code-number",
"instanceId": "uuid",
"name": "string",
"createdAt": "2023-10-23T12:35:39.339-03:00",
"updatedAt": "2023-10-23T12:35:39.382-03:00",
"capabilities": [
{
"name": "sms",
"inbound": {
"status": "active",
"subscriptions": [
"main"
],
"fees": [
"setup"
]
},
"outbound": {
"status": "active",
"subscriptions": [
"main"
],
"fees": [
"setup"
],
"destinationStatuses": {
"active": 1
}
}
}
]
}
}