We are attempting to automate the injection of standardized responses into active chat interactions using the Genesys Cloud Conversations API. The objective is to trigger specific canned responses based on external system events without requiring agent intervention. We have successfully established the OAuth2 token flow and verified that the POST /api/v2/conversations/messages endpoint accepts basic text messages.
However, when we attempt to use the cannedResponseId field within the message body, the API consistently returns a 400 Bad Request error. The documentation suggests that this field should allow us to reference a pre-defined canned response by its unique identifier. We have confirmed that the IDs we are passing correspond to valid, published canned responses in our organization’s knowledge base.
Here is the JSON payload we are sending:
{
"type": "chat",
"to": [{"id": "interaction_123456789", "type": "interaction"}],
"from": {"id": "system_bot_user_999", "type": "user"},
"text": {
"contentType": "text/plain",
"content": "Please hold for a moment."
},
"cannedResponseId": "cr_abc123def456"
}
The error response indicates that the cannedResponseId field is not recognized or is malformed. We have also tried omitting the text block entirely, assuming the system would fetch the content from the canned response definition, but this results in a different validation error stating that the message content is missing.
We are working with the latest version of the Platform SDK for Python. Has anyone successfully used this endpoint to send canned responses? Or is there a different endpoint we should be using for this specific use case? We need to ensure the response is attributed correctly to the canned response library for analytics purposes.