Skip to content

Send IM Message

POST
/affiliate_seller/202412/conversations/{conversation_id}/messages

Sends a message of the selected type in the specified conversation.

conversation_id
required
string

Conversation_id

shop_cipher
required
string

Identifies the shop. Obtain it from the Get Authorized Shops API.

Media typeapplication/json
object
msg_type
required

Message type. The value determines the decoded JSON object required in content. Possible values:

  • TEXT
  • PRODUCT_CARD
  • TARGET_COLLABORATION_CARD
  • FREE_SAMPLE_CARD
  • IMAGE
  • CRM_TEXT_WITH_IMAGE_CARD
  • CRM_TEXT_WITH_PRODUCTS_CARD
string
Allowed values: TEXT PRODUCT_CARD TARGET_COLLABORATION_CARD FREE_SAMPLE_CARD IMAGE CRM_TEXT_WITH_IMAGE_CARD CRM_TEXT_WITH_PRODUCTS_CARD
content
required

Message content as a JSON-serialized string. The decoded JSON object depends on msg_type:

  • TEXT: {"content": "simple text"}. content is required, must not be empty, and supports up to 2,000 Unicode characters.
  • PRODUCT_CARD: {"product_id": "12345"}. product_id is required.
  • TARGET_COLLABORATION_CARD: {"target_collaboration_id": "1234"}. target_collaboration_id is required and is the invitation group ID.
  • FREE_SAMPLE_CARD: {"apply_id": "1234"}. apply_id is required.
  • IMAGE: {"url": "https://p16-oec-va.ibyteimg.com/tos-maliva-i-o3syd03w52-us/2ca53c34ad8443e6b39f4e0153d3aed4~tplv-o3syd03w52-origin-image.image?from=1320446476", "width": 1280, "height": 720}. url, width, and height are required; width and height must be integers. You can obtain url by calling Upload Messages Image.
  • CRM_TEXT_WITH_PRODUCTS_CARD: {"product_ids": "12345,123456", "title": "abc", "content": "abc"}. product_ids is required and contains one to five comma-separated positive product IDs. content is required, must not be empty, and supports up to 500 Unicode characters. title supports up to 50 Unicode characters.
  • CRM_TEXT_WITH_IMAGE_CARD: {"image_url": "https://p16-oec-va.ibyteimg.com/tos-maliva-i-o3syd03w52-us/2ca53c34ad8443e6b39f4e0153d3aed4~tplv-o3syd03w52-origin-image.image?from=1320446476", "title": "abc", "content": "abc"}. image_url and content are required. content must not be empty and supports up to 500 Unicode characters. title supports up to 50 Unicode characters.
string
Example
{
"msg_type": "TEXT",
"content": "{\"content\": \"simple text message\"}"
}

Success

Media typeapplication/json
object
code

Status code; 0 means success.

integer format: int64
message

Success or failure message.

string
request_id

Request log ID.

string
data
object
message_id

The message ID. The message_id field is not always returned upon successful message submission.

string
Example
{
"code": 0,
"data": {
"message_id": "1234444"
},
"message": "Success",
"request_id": "202203070749000101890810281E8C70B7"
}