Level up your Twilio API skills in TwilioQuest, an educational game for Mac, Windows, and Linux. Download Now

メニュー

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?

PhoneNumber Resource

公開ベータ
TwilioのMessaging Service APIは現在パブリックベータ製品として利用可能です。まだ実装されていない機能や、正式版のリリースまでに変更される機能があります。
公開ベータ製品は、Twilioでのサポート対象外となります。

The PhoneNumber subresource of a Service instance represents a phone number you have associated to the Service.

When sending a message with your Messaging Service, Copilot will select a phone number from the service for delivery.

Inbound messages received on any phone number associated to a Messaging Service are passed to the inbound request URL of the Service with the TWiML parameters that describe the message.

PhoneNumber properties

Names in PHP format
sid
sid<PN> Not PII

The unique string that we created to identify the PhoneNumber resource.

accountSid
sid<AC> Not PII

The SID of the Account that created the PhoneNumber resource.

serviceSid
sid<MG> Not PII

The SID of the Service the resource is associated with.

dateCreated
date_time<iso8601> Not PII

The date and time in GMT when the resource was created specified in ISO 8601 format.

dateUpdated
date_time<iso8601> Not PII

The date and time in GMT when the resource was last updated specified in ISO 8601 format.

phoneNumber
phone_number Not PII

The phone number in E.164 format, which consists of a + followed by the country code and subscriber number.

countryCode
文字列 Not PII

The 2-character ISO Country Code of the number.

capabilities
string[] Not PII

An array of values that describe whether the number can receive calls or messages. Can be: Voice, SMS, and MMS.

url
url Not PII

The absolute URL of the PhoneNumber resource.

Create a PhoneNumber resource

post
https://messaging.twilio.com/v1/Services/{ServiceSid}/PhoneNumbers

Each Service can have no more than 400 phone numbers.

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

The SID of the Service to create the resource under.

phone_number_sid
必須
post sid<PN> Not PII

The SID of the Phone Number being added to the Service.

        
        
        
        

        Fetch a PhoneNumber resource

        GET
        https://messaging.twilio.com/v1/Services/{ServiceSid}/PhoneNumbers/{Sid}
        パラメーター
        Names in None format
        service_sid
        必須
        GET sid<MG> Not PII

        The SID of the Service to fetch the resource from.

        sid
        必須
        GET sid_like<PN> Not PII

        The SID of the PhoneNumber resource to fetch.

              
              
              
              

              Read multiple PhoneNumber resources

              GET
              https://messaging.twilio.com/v1/Services/{ServiceSid}/PhoneNumbers
              パラメーター
              Names in None format
              service_sid
              必須
              GET sid<MG> Not PII

              The SID of the Service to read the resources from.

                    
                    
                    
                    

                    Delete a PhoneNumber resource

                    削除する
                    https://messaging.twilio.com/v1/Services/{ServiceSid}/PhoneNumbers/{Sid}

                    Removing a phone number from the Service does not release the number from your account. You must release a phone number from your Account to disassociate and delete the phone number from the Service.

                    電話番号がServiceから正常に削除された場合は、「204 NO CONTENT」を返します。

                    パラメーター
                    Names in None format
                    service_sid
                    必須
                    削除する sid<MG> Not PII

                    The SID of the Service to delete the resource from.

                    sid
                    必須
                    削除する sid_like<PN> Not PII

                    The SID of the PhoneNumber resource to delete.

                          
                          
                          
                          
                          Rate this page:

                          ヘルプが必要ですか?

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