メニュー

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?

チャンネルリソース

Programmable ChatのChannelリソースは「チャットルーム」、すなわちMessageの送受信できる範囲を表しています。

Memberを追加したり、Channelへの参加を招待できます。 ChannelはChat Serviceスコープ内に存在します。

指定されたUserがMemberである全Channelを返すUsers Channelの一覧を取得できます。

チャンネルには、オプションで、アドレス可能なユニーク名を付けることもできます。これにより、チャンネルに何か具体的な名前を付けて、直接検索したり、識別したりできます。ユニーク名は、サービスインスタンス内でユニークであるように強制されます。

Twilio コンソール

You can view your Chat Channels using your Twilio console when logged in to the console. Within a Service, you will be able to browse the Channels within the Service.

プロパティ

各チャンネルに次のプロパティがあります。

Names in Ruby format
sid
sid<CH> Not PII

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

account_sid
sid<AC> Not PII

The SID of the Account that created the Channel resource.

service_sid
sid<IS> Not PII

The SID of the Service the resource is associated with.

friendly_name
文字列 PII MTL: 120 DAYS

The string that you assigned to describe the resource.

unique_name
文字列 PII MTL: 120 DAYS

An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's sid in the URL.

attributes
文字列 PII MTL: 120 DAYS

The JSON string that stores application-specific data. Note If this property has been assigned a value, it's only displayed in a FETCH action that returns a single resource; otherwise, it's null. If the attributes have not been set, {} is returned.

type
enum:channel_type Not PII

The visibility of the channel. Can be: public or private.

date_created
date_time<iso8601> Not PII

The date and time in GMT when the resource was created specified in RFC 2822 format.

date_updated
date_time<iso8601> Not PII

The date and time in GMT when the resource was last updated specified in RFC 2822 format.

created_by
文字列 PII MTL: 120 DAYS

The identity of the User that created the channel. If the Channel was created by using the API, the value is system.

members_count
integer Not PII

The number of Members in the Channel.

messages_count
integer Not PII

The number of Messages in the Channel.

url
url Not PII

The absolute URL of the Channel resource.

links
uri_map Not PII

The absolute URLs of the Members, Messages , Invites and, if it exists, the last Message for the Channel.


すべてのチャンネルをリストにする

GET /Services/{Service SID}/Channels
Names in Ruby format
service_sid
必須
GET sid<IS> Not PII

The SID of the Service to read the resources from.

type
オプション
GET enum:channel_type[] Not PII

The visibility of the Channels to read. Can be: public or private and defaults to public.

        
        
        
        

        チャンネルを作成する

        POST /Services/{Service SID}/Channels
        

        パラメーター

        Names in Ruby format
        service_sid
        必須
        post sid<IS> Not PII

        The SID of the Service to create the resource under.

        friendly_name
        オプション
        post 文字列 PII MTL: 120 DAYS

        A descriptive string that you create to describe the new resource. It can be up to 64 characters long.

        unique_name
        オプション
        post 文字列 PII MTL: 120 DAYS

        An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's sid in the URL. This value must be 64 characters or less in length and be unique within the Service.

        attributes
        オプション
        post 文字列 PII MTL: 120 DAYS

        A valid JSON string that contains application-specific data.

        type
        オプション
        post enum:channel_type Not PII

        The visibility of the channel. Can be: public or private and defaults to public.

        date_created
        オプション
        post date_time<iso8601> Not PII

        The date, specified in ISO 8601 format, to assign to the resource as the date it was created. The default is the current time set by the Chat service. Note that this should only be used in cases where a Channel is being recreated from a backup/separate source.

        date_updated
        オプション
        post date_time<iso8601> Not PII

        The date, specified in ISO 8601 format, to assign to the resource as the date it was last updated. The default value is null. Note that this should only be used in cases where a Channel is being recreated from a backup/separate source and where a Message was previously updated.

        created_by
        オプション
        post 文字列 PII MTL: 120 DAYS

        The identity of the User that created the channel. Default is: system.

        主なレスポンスコード

        code description
        409 Conflict 指定された一意な名前のChannelがすでに存在します。
              
              
              
              

              チャンネルを取得する

              ChannelはSIDまたはUniqueName(一意な名前)から取得できます

              Channel SID

              GET /Services/{Service SID}/Channels/{Channel SID}
              

              UniqueName

              GET /Services/{Service SID}/Channels/{Unique Name}
              
                    
                    
                    
                    

                    チャンネルを更新する

                    You are able to update a Channel via the SID or UniqueName

                    Channel SID

                    POST /Services/{Service SID}/Channels/{Channel SID}
                    

                    UniqueName

                    POST /Services/{Service SID}/Channels/{Unique Name}
                    

                    パラメーター

                    Names in Ruby format
                    service_sid
                    必須
                    post sid<IS> Not PII

                    The SID of the Service to update the resource from.

                    sid
                    必須
                    post sid_like<CH> Not PII

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

                    friendly_name
                    オプション
                    post 文字列 PII MTL: 120 DAYS

                    A descriptive string that you create to describe the resource. It can be up to 64 characters long.

                    unique_name
                    オプション
                    post 文字列 PII MTL: 120 DAYS

                    An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's sid in the URL. This value must be 64 characters or less in length and be unique within the Service.

                    attributes
                    オプション
                    post 文字列 PII MTL: 120 DAYS

                    A valid JSON string that contains application-specific data.

                    date_created
                    オプション
                    post date_time<iso8601> Not PII

                    The date, specified in ISO 8601 format, to assign to the resource as the date it was created.

                    date_updated
                    オプション
                    post date_time<iso8601> Not PII

                    The date, specified in ISO 8601 format, to assign to the resource as the date it was last updated.

                    created_by
                    オプション
                    post 文字列 PII MTL: 120 DAYS

                    The identity of the User that created the channel. Default is: system.

                          
                          
                          
                          

                          チャンネルを削除する

                          You are able to delete a Channel via the SID or UniqueName

                          Channel SID

                          DELETE /Services/{Service SID}/Channels/{Channel SID}
                          

                          UniqueName

                          DELETE /Services/{Service SID}/Channels/{Unique Name}
                          
                                
                                
                                
                                
                                Rate this page:

                                ヘルプが必要ですか?

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