getOrCreateMessage
Retrieves the Message object for given discriminating tags. If the message does not exist, it will be created. If the message already exists, its tags and payload will be updated with the provided values if they are defined.
POST
/v1/chat/messages/get-or-createAuthorization
AuthorizationBearerBearer authentication header of the form Bearer <token>, where <token> is your auth token.
Header parameters
x-bp-authenticated-principalstringAuthenticated principal. Injected by the authentication middleware.
x-bot-idstringBot id
x-integration-id?stringIntegration id
x-integration-alias?stringIntegration alias
Request body
Message data
payload?objectPayload is the content type of the message. Accepted payload options: Text, Image, Choice, Dropdown, Card, Carousel, File, Audio, Video, Location
userIdstringID of the User(min length: 28, max length: 36)
conversationIdstringID of the Conversation(min length: 28, max length: 36)
typestringType of the Message represents the resource type that the message is related to(max length: 200)
tagsobjectTags for the message. Set to null or empty string to remove.
schedule?objectSchedule the Message to be sent at a specific time. Either dateTime or delay must be provided.
origin?enum<string>Available options:
"synthetic"discriminateByTags?string[]Optional list of tag names to use for strict matching when looking up existing messages. If provided, all specified tags must match exactly for a message to be considered a match. For example, with an existing message whose tags are {"foo": "a", "bar": "b", baz: "c"}: Without this parameter, ALL tags must match exactly. With ["bar","baz"], all listed tags must match their values, and other tags are not considered.
Response
Returns a Message object if a valid identifier was provided. Returns an Error otherwise
messageobjectThe Message object represents a message in a Conversation for a specific User.
metaobject