messageSend
mutation
Requires unauthenticated_write_message access scope.
An access token is required to call this API. Refer to Authorization for more information about how to obtain the token.
Send a new message in a chat app or messaging system. Before you call this mutation, ensure that a conversation has been created using the conversationCreate mutation.
Arguments
The input fields to send a message.
Return
Details of the message.
Errors related to the user information.
Status and error codes
For detailed information about common codes, see Status and error codes.
Example
Send a message
Code
mutation {
messageSend(
input: {
storeId: "******2170"
conversationId: "gid://shopline/Conversation/******403588"
content: "demoString"
contentAttachmentUrl: "demoString"
messageType: TEXT
}
) {
userErrors {
code
field
message
}
message {
contentAttachmentUrl
messageType
createAt
conversationId
sendErrorCode
senderType
sendStatus
id
storeId
userId
content
}
}
}
Response
{
"messageSend": {
"message": {
"createTime": null,
"messageType": "TEXT",
"sendErrorCode": "",
"userId": "gid://shopline/ThirdUser/******5235111",
"content": "demoString",
"conversationId": "gid://shopline/Conversation/******403588",
"id": null,
"sendStatus": "SEND_SUCCESS",
"senderType": "USER",
"storeId": "******2170",
"contentAttachmentUrl": ""
},
"userErrors": []
}
}
Was this article helpful to you?