Create short code
A Messaging Service resource to add, fetch or remove short code numbers from a Messaging Service.
Path parameters
-
The SID of the Service to create the resource under.
Minimum length is
34
, maximum length is34
. Format should match the following pattern:^MG[0-9a-fA-F]{32}$
.
POST
/v1/Services/{ServiceSid}/ShortCodes
curl \
--request POST 'https://messaging.twilio.com/v1/Services/{ServiceSid}/ShortCodes' \
--user "username:password" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data 'ShortCodeSid=SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
Request examples
Create
{"ShortCodeSid"=>"SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}
{"ShortCodeSid"=>"SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}
Response examples (200)
{
"sid": "SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"short_code": "12345",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"capabilities": [
"SMS"
],
"country_code": "US",
"date_created": "2015-07-30T20:12:31Z",
"date_updated": "2015-07-30T20:12:33Z"
}
Response examples (201)
{
"sid": "SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"short_code": "12345",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"capabilities": [
"SMS"
],
"country_code": "US",
"date_created": "2015-07-30T20:12:31Z",
"date_updated": "2015-07-30T20:12:33Z"
}