Create service
A Messaging Service resource to create, fetch, update, delete or add/remove senders from Messaging Services.
Body
-
A descriptive string that you create to describe the resource. It can be up to 64 characters long.
-
The URL we call using
inbound_methodwhen a message is received by any phone number or short code in the Service. When this property isnull, receiving inbound messages is disabled. All messages sent to the Twilio phone number or short code will not be logged and received on the Account. If theuse_inbound_webhook_on_numberfield is enabled then the webhook url defined on the phone number will override theinbound_request_urldefined for the Messaging Service. -
The HTTP method we should use to call
inbound_request_url. Can beGETorPOSTand the default isPOST.Values are
GETorPOST. -
The URL that we call using
fallback_methodif an error occurs while retrieving or executing the TwiML from the Inbound Request URL. If theuse_inbound_webhook_on_numberfield is enabled then the webhook url defined on the phone number will override thefallback_urldefined for the Messaging Service. -
The HTTP method we should use to call
fallback_url. Can be:GETorPOST.Values are
GETorPOST. -
The URL we should call to pass status updates about message delivery.
-
Whether to enable Sticky Sender on the Service instance.
-
Whether to enable the MMS Converter for messages sent through the Service instance.
-
Whether to enable Smart Encoding for messages sent through the Service instance.
-
Reserved.
Values are
inherit,enable, ordisable. -
[OBSOLETE] Former feature used to fallback to long code sender after certain short code message failures.
-
Whether to enable Area Code Geomatch on the Service Instance.
-
How long, in seconds, messages sent from the Service are valid. Can be an integer from
1to36,000. Default value is36,000. -
Reserved.
-
A string that describes the scenario in which the Messaging Service will be used. Possible values are
notifications,marketing,verification,discussion,poll,undeclared. -
A boolean value that indicates either the webhook url configured on the phone number will be used or
inbound_request_url/fallback_urlurl will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override theinbound_request_url/fallback_urldefined for the Messaging Service.
curl \
--request POST 'https://messaging.twilio.com/v1/Services' \
--user "username:password" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data 'Usecase=marketing&FallbackUrl=https%3A%2F%2Fwww.example.com&FriendlyName=My+Service%21&MmsConverter=true&StickySender=true&InboundMethod=POST&SmartEncoding=false&FallbackMethod=GET&StatusCallback=https%3A%2F%2Fwww.example.com&ValidityPeriod=600&AreaCodeGeomatch=true&InboundRequestUrl=https%3A%2F%2Fwww.example.com&FallbackToLongCode=true&ScanMessageContent=inherit&SynchronousValidation=true&UseInboundWebhookOnNumber=true'
{"Usecase" => "marketing", "FallbackUrl" => "https://www.example.com", "FriendlyName" => "My Service!", "MmsConverter" => true, "StickySender" => true, "InboundMethod" => "POST", "SmartEncoding" => false, "FallbackMethod" => "GET", "StatusCallback" => "https://www.example.com", "ValidityPeriod" => 600, "AreaCodeGeomatch" => true, "InboundRequestUrl" => "https://www.example.com", "FallbackToLongCode" => true, "ScanMessageContent" => "inherit", "SynchronousValidation" => true, "UseInboundWebhookOnNumber" => true}
{
"sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"links": {
"messages": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages",
"short_codes": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes",
"alpha_senders": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AlphaSenders",
"phone_numbers": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers",
"channel_senders": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelSenders",
"us_app_to_person": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Compliance/Usa2p",
"destination_alpha_senders": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DestinationAlphaSenders",
"us_app_to_person_usecases": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Compliance/Usa2p/Usecases"
},
"usecase": "marketing",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"date_created": "2015-07-30T20:12:31Z",
"date_updated": "2015-07-30T20:12:33Z",
"fallback_url": "https://www.example.com",
"friendly_name": "My Service!",
"mms_converter": true,
"sticky_sender": true,
"inbound_method": "POST",
"smart_encoding": false,
"fallback_method": "GET",
"sending_windows": [],
"status_callback": "https://www.example.com",
"validity_period": 600,
"area_code_geomatch": true,
"inbound_request_url": "https://www.example.com/",
"scan_message_content": "inherit",
"fallback_to_long_code": true,
"synchronous_validation": true,
"us_app_to_person_registered": false,
"use_inbound_webhook_on_number": true
}