Open a private message, or post into a conversation
Posts one message. Without conversation, it opens a new conversation with this message as its first; with conversation, it appends the message to that existing conversation.
Opening a conversation. Only a private message (conversation_type: message) can be opened here. Reviews and questions are written by their customers on the storefront; asking for one is refused with 406 and conversation_100_8 (Only its author writes a review., or question). A private message:
may be about an order item (
item_content: orderitemwithitem_id) or about nothing —productis refused withconversation_100_5;may not carry a
rating(conversation_100_7);when it names an order item, that order item must exist (
conversation_100_12) and, when it names a seller, have been sold by the conversation'sdatasource(conversation_100_13) — see Conversation Kinds;is created with
is_public: falseandstatus: null— private messages are never moderated and never reach the storefront.is_publicis ignored if sent;is refused as a duplicate with
conversation_100_1when a conversation with the same customer, seller, subject, kind and item already exists, published or not. A rejected conversation does not count.
These refusals are answered with 406 and {"non_field_errors": "<message>", "error_code": "<code>"}; see Errors under Conversations.
Who writes the message. user is the customer who owns the conversation. content_type and content_id name the author of this one message: datasource with a data source id to write as the seller, or user with a user id to write in the customer's name. This endpoint does not compare the author with the caller or with the conversation's seller — POST /messages/ does.
Appending. When conversation is sent, the message is judged against the existing conversation, not the payload. datasource, user and conversation_type must still be present but are ignored, as are subject, item_content, item_id and rating.
Kind
Seller message (content_type: datasource)
Customer message (content_type: user)
review
Refused: conversation_100_9 (A review cannot be replied to.)
Refused: conversation_100_10 (A review is written once, not added to.)
question
Accepted — the seller's answer
Refused: conversation_100_10 (A question is written once, not added to.)
message
Accepted
Accepted
Effects.
A new conversation records a
submittedevent carrying this first message, before the events the message itself causes.A seller message sets
is_answeredtotrue(recordingmarked_answeredif it wasfalse), records arepliedevent, e-mails the customer and emits theconversation_repliedwebhook. The reply is not moderated: on an approved question it appears on the storefront straight away, on a pending one as soon as the question is approved.A customer message sets
is_answeredtofalse, recordingmarked_unansweredif it wastrue.
The response describes the conversation the message went into; its id is the conversation's identifier, not the message's.
Token credential sent in the Authorization header, in the form: Token <your-token>. Requires a staff (admin) account.
One message, together with the conversation it opens or goes into. Send conversation to append to an existing conversation; leave it out to open a new private message.
The identifier of an existing conversation to append the message to. When sent, the conversation fields below are still validated but ignored.
The identifier of the seller (data source) the conversation is with. Required, but ignored when appending.
The identifier of the customer who owns the conversation. Required, but ignored when appending.
The subject line.
The kind of conversation. Must be message when opening one; required, but ignored when appending.
What the conversation is about. A private message accepts only orderitem, or no item at all.
The identifier of the order item (or product) named by item_content. It must exist and, when it names a seller, belong to datasource.
A star rating. Only reviews carry one, and reviews cannot be opened here, so leave it out — a rating on a private message is refused.
The message text. Must not be blank.
Whether the author writes as a guest or as a registered user.
Who writes this message — the customer (user) or the seller (datasource).
The identifier of the author — a user id for user, a data source id for datasource.
The message was posted. The body describes the conversation it went into.
The message just posted, together with the conversation it went into.
The identifier of the conversation — not of the message.
The identifier of the conversation's seller.
The identifier of the customer who owns the conversation.
The conversation's subject line.
What the conversation is about — product, orderitem, or null.
Storefront visibility. Always false for a new conversation.
The identifier of the item the conversation is about.
The kind of conversation. See Conversation Kinds under Conversations.
review— a customer's rated verdict on an order item they bought; moderatedquestion— a customer's question about a product; moderatedmessage— private correspondence between one customer and one seller; never moderated and never listed on the storefront
The message text.
Whether the author wrote as a guest or as a registered user.
The identifier of the message's author.
Who wrote the message.
The conversation's stored star rating; null for questions and private messages.
The request contains invalid or missing data. Errors are field-keyed lists.
Authentication credentials were not provided or are invalid.
The authenticated user does not have administrator privileges.
The request breaks a rule of the conversation's kind or state. non_field_errors is a single string, not a list; match on error_code.
POST /api/v1/remote/1/conversations/ HTTP/1.1
Host: sandbox.akinon.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 261
{
"datasource": 8,
"user": 1001,
"subject": "About your order",
"conversation_type": "message",
"item_content": "orderitem",
"item_id": 90211,
"message_content": "Your parcel leaves our warehouse tomorrow.",
"user_type": "registered",
"content_type": "datasource",
"content_id": 8
}{
"id": 5830,
"datasource": 8,
"user": 1001,
"subject": "About your order",
"item_content": "orderitem",
"is_public": false,
"item_id": 90211,
"conversation_type": "message",
"message_content": "Your parcel leaves our warehouse tomorrow.",
"user_type": "registered",
"content_id": 8,
"content_type": "datasource",
"rating": null
}Last updated
Was this helpful?

