REST ClientShort Codes

get

View as MarkdownOpen in Claude

Retrieve a specific short code.

Path parameters

idstringRequiredformat: "uuid"
Unique ID of the short code.

Response

idstringRequiredformat: "uuid"
The unique identifier of the short code.
namestring or nullRequired
The name given to the short code.
numberstringRequired
The short code number.
capabilitieslist of enumsRequired
The messaging capabilities of the short code.
Allowed values:
number_typeenumRequired
The type of number (always 'shortcode').
Allowed values:
code_typeenumRequired
The type of short code.
Allowed values:
country_codestringRequired
The ISO 3166-1 alpha-2 country code.
created_atstringRequired
The date and time when the short code was created.
updated_atstringRequired
The date and time when the short code was last updated.
next_billed_atstring or nullRequired
The date and time when the short code will next be billed.
lease_durationstring or nullRequired
The lease duration of the short code (e.g., '12 months').
message_handlerenum or nullRequired
The message handler type for incoming messages.
Allowed values:
message_request_urlstring or nullRequired
The URL to send message requests to when using laml_webhooks handler.
message_request_methodenum or nullRequired
The HTTP method to use for message requests.
Allowed values:
message_fallback_urlstring or nullRequired
The fallback URL for message requests.
message_fallback_methodenum or nullRequired
The HTTP method to use for fallback requests.
Allowed values:
message_laml_application_idstring or nullRequiredformat: "uuid"
The ID of the LāML application to handle messages when using laml_application handler.
message_relay_contextstring or nullRequired
The Relay context to use when using relay_context handler.

Response Example

Response
1{
2 "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
3 "name": "My Short Code",
4 "number": "12345",
5 "capabilities": [
6 "sms"
7 ],
8 "number_type": "shortcode",
9 "code_type": "vanity",
10 "country_code": "US",
11 "created_at": "2023-01-15T10:30:00Z",
12 "updated_at": "2023-01-15T10:30:00Z",
13 "next_billed_at": "2024-01-15T10:30:00Z",
14 "lease_duration": "12 months",
15 "message_handler": "relay_context",
16 "message_request_url": "https://example.com/message",
17 "message_request_method": "GET",
18 "message_fallback_url": "https://example.com/fallback",
19 "message_fallback_method": "GET",
20 "message_laml_application_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
21 "message_relay_context": "my-context"
22}

Example

1from signalwire.rest import RestClient
2
3client = RestClient(
4 project="your-project-id",
5 token="your-api-token",
6 host="your-space.signalwire.com",
7)
8
9code = client.short_codes.get("short-code-id")
10print(code.get("short_code"))