Create service
A Messaging Service resource to create, fetch, update, delete or add/remove senders from Messaging Services.
Body
-
AreaCodeGeomatch boolean
Whether to enable Area Code Geomatch on the Service Instance.
-
FallbackMethod string(http-method)
The HTTP method we should use to call
fallback_url
. Can be:GET
orPOST
.Values are
HEAD
,GET
,POST
,PATCH
,PUT
, orDELETE
. -
FallbackToLongCode boolean
Whether to enable Fallback to Long Code for messages sent through the Service instance.
-
FallbackUrl string(uri)
The URL that we call using
fallback_method
if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. If theuse_inbound_webhook_on_number
field is enabled then the webhook url defined on the phone number will override thefallback_url
defined for the Messaging Service. -
A descriptive string that you create to describe the resource. It can be up to 64 characters long.
-
InboundMethod string(http-method)
The HTTP method we should use to call
inbound_request_url
. Can beGET
orPOST
and the default isPOST
.Values are
HEAD
,GET
,POST
,PATCH
,PUT
, orDELETE
. -
InboundRequestUrl string(uri)
The URL we call using
inbound_method
when 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_number
field is enabled then the webhook url defined on the phone number will override theinbound_request_url
defined for the Messaging Service. -
MmsConverter boolean
Whether to enable the MMS Converter for messages sent through the Service instance.
-
ScanMessageContent string
Reserved.
Values are
inherit
,enable
, ordisable
. -
SmartEncoding boolean
Whether to enable Smart Encoding for messages sent through the Service instance.
-
StatusCallback string(uri)
The URL we should call to pass status updates about message delivery.
-
StickySender boolean
Whether to enable Sticky Sender on the Service instance.
-
SynchronousValidation boolean
Reserved.
-
UseInboundWebhookOnNumber boolean
A boolean value that indicates either the webhook url configured on the phone number will be used or
inbound_request_url
/fallback_url
url 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_url
defined for the Messaging Service. -
Usecase string
A string that describes the scenario in which the Messaging Service will be used. Examples: [notification, marketing, verification, poll ..].
-
ValidityPeriod integer
How long, in seconds, messages sent from the Service are valid. Can be an integer from
1
to14,400
.
curl \
-X POST https://messaging.twilio.com/v1/Services \
--user "username:password" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d 'AreaCodeGeomatch=true&FallbackMethod=HEAD&FallbackToLongCode=true&FallbackUrl=https%3A%2F%2Fexample.com&FriendlyName=string&InboundMethod=HEAD&InboundRequestUrl=https%3A%2F%2Fexample.com&MmsConverter=true&ScanMessageContent=inherit&SmartEncoding=true&StatusCallback=https%3A%2F%2Fexample.com&StickySender=true&SynchronousValidation=true&UseInboundWebhookOnNumber=true&Usecase=string&ValidityPeriod=42'
{
"AreaCodeGeomatch": true,
"FallbackMethod": "HEAD",
"FallbackToLongCode": true,
"FallbackUrl": "https://example.com",
"FriendlyName": "string",
"InboundMethod": "HEAD",
"InboundRequestUrl": "https://example.com",
"MmsConverter": true,
"ScanMessageContent": "inherit",
"SmartEncoding": true,
"StatusCallback": "https://example.com",
"StickySender": true,
"SynchronousValidation": true,
"UseInboundWebhookOnNumber": true,
"Usecase": "string",
"ValidityPeriod": 42
}
{
"AreaCodeGeomatch": true,
"FallbackMethod": "HEAD",
"FallbackToLongCode": true,
"FallbackUrl": "https://example.com",
"FriendlyName": "string",
"InboundMethod": "HEAD",
"InboundRequestUrl": "https://example.com",
"MmsConverter": true,
"ScanMessageContent": "inherit",
"SmartEncoding": true,
"StatusCallback": "https://example.com",
"StickySender": true,
"SynchronousValidation": true,
"UseInboundWebhookOnNumber": true,
"Usecase": "string",
"ValidityPeriod": 42
}
{
"account_sid": "string",
"area_code_geomatch": true,
"date_created": "2023-05-04T09:42:00+00:00",
"date_updated": "2023-05-04T09:42:00+00:00",
"fallback_method": "HEAD",
"fallback_to_long_code": true,
"fallback_url": "https://example.com",
"friendly_name": "string",
"inbound_method": "HEAD",
"inbound_request_url": "https://example.com",
"links": {},
"mms_converter": true,
"scan_message_content": "inherit",
"sid": "string",
"smart_encoding": true,
"status_callback": "https://example.com",
"sticky_sender": true,
"synchronous_validation": true,
"url": "https://example.com",
"us_app_to_person_registered": true,
"use_inbound_webhook_on_number": true,
"usecase": "string",
"validity_period": 42
}
{
"account_sid": "string",
"area_code_geomatch": true,
"date_created": "2024-05-04T09:42:00+00:00",
"date_updated": "2024-05-04T09:42:00+00:00",
"fallback_method": "HEAD",
"fallback_to_long_code": true,
"fallback_url": "https://example.com",
"friendly_name": "string",
"inbound_method": "HEAD",
"inbound_request_url": "https://example.com",
"links": {},
"mms_converter": true,
"scan_message_content": "inherit",
"sid": "string",
"smart_encoding": true,
"status_callback": "https://example.com",
"sticky_sender": true,
"synchronous_validation": true,
"url": "https://example.com",
"us_app_to_person_registered": true,
"use_inbound_webhook_on_number": true,
"usecase": "string",
"validity_period": 42
}