メニュー

Expand
ページを評価:

Subscription Resource

You can use the Subscriptions API to subscribe to specific Twilio events and versions, and manage your subscriptions.

With the Subscriptions API you can:

  • Create new Subscriptions.
  • Fetch a specific Subscription.
  • Fetch a list of Subscriptions.
  • Update a Subscription.
  • Delete a Subscription.

A subscription is comprised of a set of pairs of Event Types and Schema versions that can be modified using the SubscribedEvents API.

Subscription properties

Resource Properties in REST API format
account_sid
sid<AC> Not PII

The unique SID identifier of the Account.

sid
sid<DF> Not PII

A 34 character string that uniquely identifies this Subscription.

date_created
date_time<iso8601> Not PII

The date that this Subscription was created, given in ISO 8601 format.

date_updated
date_time<iso8601> Not PII

The date that this Subscription was updated, given in ISO 8601 format.

description
文字列 Not PII

A human readable description for the Subscription

sink_sid
sid<DG> Not PII

The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created.

url
url Not PII

The URL of this resource.

links
uri_map Not PII

Contains a dictionary of URL links to nested resources of this Subscription.

Create a Subscription

post
https://events.twilio.com/v1/Subscriptions

Make a new Subscription.

パラメーター
Parameters in REST API format
description
必須
post 文字列 Not PII

A human readable description for the Subscription This value should not contain PII.

sink_sid
必須
post sid<DG> Not PII

The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created.

types
必須
post object[] Not PII

An array of objects containing the subscribed Event Types

例 1
        
        
        

        Fetch a Subscription

        GET
        https://events.twilio.com/v1/Subscriptions/{Sid}

        Retrieve a specific Subscription using its Subscription ID.

        パラメーター
        Parameters in REST API format
        sid
        Path
        GET sid<DF> Not PII

        A 34 character string that uniquely identifies this Subscription.

        例 1
              
              
              

              Get all Subscriptions

              GET
              https://events.twilio.com/v1/Subscriptions

              Retrieve information on all created subscriptions

              パラメーター
              Parameters in REST API format
              sink_sid
              オプション
              GET sid<DG> Not PII

              The SID of the sink that the list of Subscriptions should be filtered by.

              例 1
                    
                    
                    

                    Update a Subscription

                    post
                    https://events.twilio.com/v1/Subscriptions/{Sid}

                    Modify an existing Subscription identified by its Subscription ID.

                    パラメーター
                    Parameters in REST API format
                    sid
                    Path
                    post sid<DF> Not PII

                    A 34 character string that uniquely identifies this Subscription.

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

                    A human readable description for the Subscription.

                    sink_sid
                    オプション
                    post sid<DG> Not PII

                    The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created.

                    例 1
                          
                          
                          

                          Delete a Subscription

                          削除する
                          https://events.twilio.com/v1/Subscriptions/{Sid}

                          Remove a Subscription identified by its Subscription ID.

                          パラメーター
                          Parameters in REST API format
                          sid
                          Path
                          削除する sid<DF> Not PII

                          A 34 character string that uniquely identifies this Subscription.

                          例 1
                                
                                
                                
                                ページを評価:

                                ヘルプが必要ですか?

                                We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Community Forums or browsing the Twilio tag on Stack Overflow.

                                      
                                      
                                      

                                      フィードバックくださりありがとうございます!

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

                                      Sending your feedback...
                                      🎉 Thank you for your feedback!
                                      Something went wrong. Please try again.

                                      Thanks for your feedback!

                                      Refer us and get $10 in 3 simple steps!

                                      ステップ1

                                      Get link

                                      Get a free personal referral link here

                                      ステップ2:

                                      Give $10

                                      Your user signs up and upgrade using link

                                      ステップ3

                                      Get $10

                                      1,250 free SMSes
                                      OR 1,000 free voice mins
                                      OR 12,000 chats
                                      OR more