Hi there!
I am trying to implement an Action that sends a message to a conversation but it is not working. I get this error message:
- REST call for action execute failed. Message: Request to backend service failed. Response from web service: {"message":"User is not an active member on the conversation","code":"forbidden","status":403,"contextId":"869fbb1c-8f50-4e85-8a03-810a435d4197","details":[],"errors":[]} [65ab3a4a-0a2d-4f38-9ec9-cdae4dc0cef9]
{
"message": "You are not authorized to perform the requested action.",
"code": "not.authorized",
"status": 403,
"messageParams": {},
"contextId": "cd787782-0aae-4249-92d1-793422a18fdd",
"details": [
{
"errorCode": "ACTION.REMOTE_ENDPOINT"
}
],
"errors": [
{
"message": "REST call for action execute failed. Message: Request to backend service failed. Response from web service: {\"message\":\"User is not an active member on the conversation\",\"code\":\"forbidden\",\"status\":403,\"contextId\":\"ec0ecd2f-04f9-4d9a-af2f-b510410f2b0c\",\"details\":[],\"errors\":[]} [cd787782-0aae-4249-92d1-793422a18fdd]",
"code": "NOT_AUTHORIZED",
"status": 403,
"messageParams": {},
"details": [],
"errors": []
}
]
}
I would appreciate any comments about anything I am overlooking, or what to try.
Steps I Took
I first used API Explorer to fetch the communicationId using the conversationId. I have successfullly created a Data Action to fetch the communicationID..
I then used API Explorer to successfully send a message to an active chat conversation (version 2) using the communication ID and conversation ID. This is the endpoint I am using:
/api/v2/conversations/chats/{conversationId}/communications/{communicationId}/messages
I used existing Actions created by a former developer as a starting point to create the Action in question. Here is how I set it up
Configuration Tab
Request URL Template (POST)
/api/v2/conversations/chats/${input.conversationId}/communications/${input.communicationId}/messages
Request Body Template
{
"body": "${input.messageToSend}",
"bodyType": "standard"
}
Output
{
"translationMap": {},
"translationMapDefaults": {},
"successTemplate": "${rawResult}"
}
Contracts Tab
Input Contract
{
"title": "SendMessageToConversation",
"description": "A request to send a message to an active conversation",
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"required": [
"conversationId",
"communicationId",
"messageToSend"
],
"properties": {
"conversationId": {
"description": "The conversation ID.",
"type": "string"
},
"communicationId": {
"description": "The communication ID. Session ID for chats",
"type": "string"
},
"messageToSend": {
"description": "The message to send to an existing conversation",
"type": "string"
}
}
}
Output Contract
{
"title": "Response",
"type": "object",
"properties": {
"message": {
"type": "string"
},
"code": {
"type": "string"
},
"status": {
"type": "string"
},
"messageWithParams": {
"type": "string"
},
"messageParams": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
},
"additionalProperties": true
},
"contextId": {
"type": "string"
}
},
"additionalProperties": true
}
#DigitalChannels#Integrations------------------------------
Waqar Mahmood
Herbalife International of America, Inc.
------------------------------