メニュー

Expand
ページを評価:

Conversations Attributes

概要

The attributes property unlocks the potential to add additional context about specific objects. You can use this functionality to build many capabilities into your application. Some common use cases you could build are:

  • Skill-based routing for Conversations
  • Avatar URLs in a User profile
  • Context about customers (i.e. referral source, product type, etc.)
  • Message replies/threading
  • Emoji reactions to messages
  • Profile information
  • Message metadata
  • Customer loyalty status
  • Non-chat Participant display name

This property is optional, and the field value is a JSON object that can store up to 16 KB. If the attributes are not set, then an empty object is returned.

You can use the attributes field in any of the following Conversations objects:

  • Participant (参加者)
  • ユーザー
  • カンバセーション
  • Message

Set or modify Attributes

You can set the attributes of an object by calling the update method on the object you want to add to. For example, you can add attributes to an existing Message by passing the correct method and specifying the attributes on that Message object.

You can also add attributes to objects when you create them. For example, you can set attributes when you add a Participant to a Conversation.

To retrieve the attributes for an object, just make sure to invoke the corresponding method or property. The attributes will be returned in JSON format.

        
        
        

        Listen for changes to these objects

        To receive events about updates to object attributes, listen for "update" events at the Client object (e.g. conversationUpdated, messageUpdated, etc.). The event update reason will indicate that the attributes were changed and include the updated object.

        関連トピック

        Well done! You can continue learning more about Conversations by checking out the following guides:

        ページを評価:

        ヘルプが必要ですか?

        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 Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

              
              
              

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

              Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

              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