messageQuery
query
Requires unauthenticated_read_message access scope.
An access token is required to call this API. Refer to Authorization for more information about how to obtain the token.
Get the message list of a specified conversation from a chat app or messaging system. These messages are sent via the messageSend mutation. Before you call this query, ensure that the conversation has been created using the conversationCreate mutation.
Arguments
The input fields to query a list of messages.
Return
List of messages.
Status and error codes
For detailed information about common codes, see Status and error codes.
Example
Query messages
Code
query MessageQuery {
messageQuery(
input: { conversationId: "gid://shopline/Conversation/******403588", direction: "down", pageSize: 10 }
) {
messages {
conversationId
storeId
userId
content
contentAttachmentUrl
messageType
createAt
sendErrorCode
senderType
sendStatus
id
}
}
}
Response
{
"messageSend": {
"userErrors": [],
"message": {
"content": "demoString",
"messageType": "TEXT",
"sendStatus": "SEND_SUCCESS",
"userId": "gid://shopline/ThirdUser/******5235111",
"contentAttachmentUrl": "",
"conversationId": "gid://shopline/Conversation/******403588",
"createTime": null,
"id": null,
"sendErrorCode": "",
"senderType": "USER",
"storeId": "******2170"
}
}
}
Was this article helpful to you?