メニュー

Expand
Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Messaging ショートコード

A short code is a 5 or 6-digit number that can send and receive messages with mobile phones. These high-throughput numbers are perfect for apps that need to send messages to lots of users or need to send time-sensitive messages. You can buy shortcodes from Twilio or port existing short codes to our platform.

ショートコードを使ってメッセージを送信したい場合は「メッセージを送る」ドキュメンを御覧ください。

ShortCode properties

Names in PHP format
accountSid
sid<AC> Not PII

The SID of the Account that created this ShortCode resource.

apiVersion
文字列 Not PII

The API version used to start a new TwiML session when an SMS message is sent to this short code.

dateCreated
date_time<rfc2822> Not PII

The date and time in GMT that this resource was created specified in RFC 2822 format.

dateUpdated
date_time<rfc2822> Not PII

The date and time in GMT that this resource was last updated, specified in RFC 2822 format.

friendlyName
文字列 Not PII

A string that you assigned to describe this resource. By default, the FriendlyName is the short code.

shortCode
文字列 Not PII

ショート コードです。 例: 894546

sid
sid<SC> Not PII

The unique string that that we created to identify this ShortCode resource.

smsFallbackMethod
http_method Not PII

The HTTP method we use to call the sms_fallback_url. Can be: GET or POST.

smsFallbackUrl
url Not PII

The URL that we call if an error occurs while retrieving or executing the TwiML from sms_url.

smsMethod
http_method Not PII

The HTTP method we use to call the sms_url. Can be: GET or POST.

smsUrl
url Not PII

The URL we call when receiving an incoming SMS message to this short code.

uri
uri Not PII

The URI of this resource, relative to https://api.twilio.com.

Fetch a ShortCode resource

GET
https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SMS/ShortCodes/{Sid}.json
パラメーター
Names in None format
account_sid
必須
GET sid<AC> Not PII

The SID of the Account that created the ShortCode resource(s) to fetch.

sid
必須
GET sid<SC> Not PII

The Twilio-provided string that uniquely identifies the ShortCode resource to fetch

        
        
        
        

        Read multiple ShortCode resources

        GET
        https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SMS/ShortCodes.json

        Returns a list of ShortCode resources, each representing a short code within your account. This list includes paging information.

        Filter the list Twilio returns

        The following query string parameters allow you to limit the list returned.

        パラメーター
        Names in None format
        friendly_name
        オプション
        GET 文字列 Not PII

        The string that identifies the ShortCode resources to read.

        short_code
        オプション
        GET 文字列 Not PII

        このパターンに一致する ShortCode リソースのみを返します。 番号の一部を指定し、「*」を任意の 1 桁のワイルドカードとして使用することができます。

        account_sid
        必須
        GET sid<AC> Not PII

        The SID of the Account that created the ShortCode resource(s) to read.

        例 1
              
              
              
              
              例 2
                    
                    
                    
                    
                    Return the set of short codes that match '67898'

                    Read: list Short Codes with an exact match

                    Return the set of short codes that match '67898'
                    例 3
                          
                          
                          
                          
                          Return the set of all phone numbers containing the digits '898'

                          Read: list all Short Codes with a partial match

                          Return the set of all phone numbers containing the digits '898'

                          Update a ShortCode resource

                          post
                          https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SMS/ShortCodes/{Sid}.json

                          Tries to update the shortcode's properties. This API call returns the updated resource representation if it is successful. The returned response is identical to that returned when making a GET request.

                          パラメーター
                          Names in None format
                          account_sid
                          必須
                          post sid<AC> Not PII

                          The SID of the Account that created the ShortCode resource(s) to update.

                          sid
                          必須
                          post sid<SC> Not PII

                          The Twilio-provided string that uniquely identifies the ShortCode resource to update

                          friendly_name
                          オプション
                          post 文字列 Not PII

                          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.

                          api_version
                          オプション
                          post 文字列 Not PII

                          The API version to use to start a new TwiML session. Can be: 2010-04-01 or 2008-08-01.

                          sms_url
                          オプション
                          post url Not PII

                          The URL we should call when receiving an incoming SMS message to this short code.

                          sms_method
                          オプション
                          post http_method Not PII

                          The HTTP method we should use when calling the sms_url. Can be: GET or POST.

                          sms_fallback_url
                          オプション
                          post url Not PII

                          The URL that we should call if an error occurs while retrieving or executing the TwiML from sms_url.

                          sms_fallback_method
                          オプション
                          post http_method Not PII

                          The HTTP method that we should use to call the sms_fallback_url. Can be: GET or POST.

                          例 1
                                
                                
                                
                                
                                Set the SMS Url on a short code to 'http://demo.twilio.com/docs/sms.xml'

                                Update: Change a short code parameter

                                Set the SMS Url on a short code to 'http://demo.twilio.com/docs/sms.xml'
                                Rate this page:

                                ヘルプが必要ですか?

                                誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。