Update a short code with the following parameters
Messaging short codes
Update a short code with the following parameters
Path parameters
-
The SID of the Account that created the ShortCode resource(s) to update.
Minimum length is
34
, maximum length is34
. Format should match the following pattern:^AC[0-9a-fA-F]{32}$
. -
The Twilio-provided string that uniquely identifies the ShortCode resource to update
Minimum length is
34
, maximum length is34
. Format should match the following pattern:^SC[0-9a-fA-F]{32}$
.
Body
-
A descriptive string that you created to describe this resource. It can be up to 64 characters long. By default, the
FriendlyName
is the short code. -
The API version to use to start a new TwiML session. Can be:
2010-04-01
or2008-08-01
. -
The URL we should call when receiving an incoming SMS message to this short code.
-
The HTTP method we should use when calling the
sms_url
. Can be:GET
orPOST
.Values are
GET
orPOST
. -
The URL that we should call if an error occurs while retrieving or executing the TwiML from
sms_url
. -
The HTTP method that we should use to call the
sms_fallback_url
. Can be:GET
orPOST
.Values are
GET
orPOST
.
curl \
--request POST 'https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SMS/ShortCodes/{Sid}.json' \
--user "username:password" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data 'SmsUrl=https%3A%2F%2Fexample.com&SmsMethod=POST&ApiVersion=2010-04-01&FriendlyName=friendly_name&SmsFallbackUrl=https%3A%2F%2Fexample.com&SmsFallbackMethod=POST'
{"SmsUrl"=>"https://example.com", "SmsMethod"=>"POST", "ApiVersion"=>"2010-04-01", "FriendlyName"=>"friendly_name", "SmsFallbackUrl"=>"https://example.com", "SmsFallbackMethod"=>"POST"}
{
"sid": "SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
"sms_url": null,
"short_code": "99990",
"sms_method": "POST",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"api_version": "2010-04-01",
"date_created": "Thu, 01 Apr 2010 00:00:00 +0000",
"date_updated": "Thu, 01 Apr 2010 00:00:00 +0000",
"friendly_name": "API_CLUSTER_TEST_SHORT_CODE",
"sms_fallback_url": null,
"sms_fallback_method": "POST"
}