メニュー

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?

Channel Webhook Resource

A Channel Webhook resource describes a webhook target that is specific to a Channel. By default, events in a Programmable Chat instance are delivered to a webhook address that is specified for the whole Chat Service. However, you can use this resource to specify up to five unique webhook targets for each channel to handle exceptional cases.

The webhook target can be a Web URL or a Studio Flow.

ChannelWebhook properties

Names in REST API format
sid
sid<WH> Not PII

The unique string that we created to identify the Channel Webhook resource.

account_sid
sid<AC> Not PII

The SID of the Account that created the Channel Webhook resource.

service_sid
sid<IS> Not PII

The SID of the Service the Channel Webhook resource is associated with.

channel_sid
sid<CH> Not PII

The SID of the Channel the Channel Webhook resource belongs to.

type
文字列 Not PII

The type of webhook. Can be: webhook, studio, or trigger.

url
url Not PII

The absolute URL of the Channel Webhook resource.

configuration
オブジェクト Not PII

The JSON string that describes how the channel webhook is configured. The configuration object contains the url, method, filters, and retry_count values that are configured by the create and update actions.

date_created
date_time<iso8601> Not PII

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

date_updated
date_time<iso8601> Not PII

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

Create a ChannelWebhook resource

post
https://chat.twilio.com/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Webhooks

The {ChannelSid} value can be the Channel's sid or its unique_name.

パラメーター
Names in REST API format
service_sid
Path
post sid<IS> Not PII

The SID of the Service with the Channel to create the Webhook resource under.

channel_sid
Path
post sid_like<CH> Not PII

The SID of the Channel the new Channel Webhook resource belongs to. This value can be the Channel resource's sid or unique_name.

type
必須
post enum:type Not PII

The type of webhook. Can be: webhook, studio, or trigger.

configuration.url
オプション
post 文字列 Not PII

The URL of the webhook to call using the configuration.method.

configuration.method
オプション
post enum:method Not PII

The HTTP method used to call configuration.url. Can be: GET or POST and the default is POST.

configuration.filters
オプション
post string[] Not PII

The events that cause us to call the Channel Webhook. Used when type is webhook. This parameter takes only one event. To specify more than one event, repeat this parameter for each event. For the list of possible events, see Webhook Event Triggers.

configuration.triggers
オプション
post string[] Not PII

A string that will cause us to call the webhook when it is present in a message body. This parameter takes only one trigger string. To specify more than one, repeat this parameter for each trigger string up to a total of 5 trigger strings. Used only when type = trigger.

configuration.flow_sid
オプション
post sid<FW> Not PII

The SID of the Studio Flow to call when an event in configuration.filters occurs. Used only when type is studio.

configuration.retry_count
オプション
post integer Not PII

The number of times to retry the webhook if the first attempt fails. Can be an integer between 0 and 3, inclusive, and the default is 0.

例 1
        
        
        
        

        Fetch a ChannelWebhook resource

        GET
        https://chat.twilio.com/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Webhooks/{Sid}

        The {ChannelSid} value can be the Channel's sid or its unique_name.

        パラメーター
        Names in REST API format
        service_sid
        Path
        GET sid<IS> Not PII

        The SID of the Service with the Channel to fetch the Webhook resource from.

        channel_sid
        Path
        GET sid_like<CH> Not PII

        The SID of the Channel the Channel Webhook resource to fetch belongs to. This value can be the Channel resource's sid or unique_name.

        sid
        Path
        GET sid<WH> Not PII

        The SID of the Channel Webhook resource to fetch.

        例 1
              
              
              
              

              Read multiple ChannelWebhook resources

              GET
              https://chat.twilio.com/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Webhooks

              The {ChannelSid} value can be the Channel's sid or its unique_name.

              パラメーター
              Names in REST API format
              service_sid
              Path
              GET sid<IS> Not PII

              The SID of the Service with the Channel to read the resources from.

              channel_sid
              Path
              GET sid_like<CH> Not PII

              The SID of the Channel the Channel Webhook resources to read belong to. This value can be the Channel resource's sid or unique_name.

              例 1
                    
                    
                    
                    

                    Update a ChannelWebhook resource

                    post
                    https://chat.twilio.com/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Webhooks/{Sid}

                    The {ChannelSid} value can be the Channel's sid or its unique_name.

                    パラメーター
                    Names in REST API format
                    service_sid
                    Path
                    post sid<IS> Not PII

                    The SID of the Service with the Channel that has the Webhook resource to update.

                    channel_sid
                    Path
                    post sid_like<CH> Not PII

                    The SID of the Channel the Channel Webhook resource to update belongs to. This value can be the Channel resource's sid or unique_name.

                    sid
                    Path
                    post sid<WH> Not PII

                    The SID of the Channel Webhook resource to update.

                    configuration.url
                    オプション
                    post 文字列 Not PII

                    The URL of the webhook to call using the configuration.method.

                    configuration.method
                    オプション
                    post enum:method Not PII

                    The HTTP method used to call configuration.url. Can be: GET or POST and the default is POST.

                    configuration.filters
                    オプション
                    post string[] Not PII

                    The events that cause us to call the Channel Webhook. Used when type is webhook. This parameter takes only one event. To specify more than one event, repeat this parameter for each event. For the list of possible events, see Webhook Event Triggers.

                    configuration.triggers
                    オプション
                    post string[] Not PII

                    A string that will cause us to call the webhook when it is present in a message body. This parameter takes only one trigger string. To specify more than one, repeat this parameter for each trigger string up to a total of 5 trigger strings. Used only when type = trigger.

                    configuration.flow_sid
                    オプション
                    post sid<FW> Not PII

                    The SID of the Studio Flow to call when an event in configuration.filters occurs. Used only when type = studio.

                    configuration.retry_count
                    オプション
                    post integer Not PII

                    The number of times to retry the webhook if the first attempt fails. Can be an integer between 0 and 3, inclusive, and the default is 0.

                    例 1
                          
                          
                          
                          

                          Delete a ChannelWebhook resource

                          削除する
                          https://chat.twilio.com/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Webhooks/{Sid}

                          The {ChannelSid} value can be the Channel's sid or its unique_name.

                          パラメーター
                          Names in REST API format
                          service_sid
                          Path
                          削除する sid<IS> Not PII

                          The SID of the Service with the Channel to delete the Webhook resource from.

                          channel_sid
                          Path
                          削除する sid_like<CH> Not PII

                          The SID of the Channel the Channel Webhook resource to delete belongs to. This value can be the Channel resource's sid or unique_name.

                          sid
                          Path
                          削除する sid<WH> Not PII

                          The SID of the Channel Webhook resource to delete.

                          例 1
                                
                                
                                
                                
                                Rate this page:

                                ヘルプが必要ですか?

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