I can’t seem to figure out why the Open Messaging API rejects my structured content payload despite following the schema outlined in the documentation. I am attempting to send a quick reply card via POST /api/v2/conversations/messaging/contacts/{contactId}/messages using the Genesys Cloud Python SDK. The request returns a 400 Bad Request with the message Invalid content type for message. My payload structure is as follows: {'content': {'type': 'card', 'card': {'title': 'Support Options', 'buttons': [{'type': 'quick_reply', 'label': 'Chat', 'value': 'chat_option'}, {'type': 'quick_reply', 'label': 'Email', 'value': 'email_option'}]}}, 'to': {'id': 'web_messaging', 'type': 'channel'}}. I have verified that the contactId is valid and the conversation is active. When I send a simple text message with {'content': {'text': 'Hello'}, 'to': {'id': 'web_messaging', 'type': 'channel'}}, it succeeds immediately. The issue appears specific to the card type. I have checked the Accept header and it is set to application/json. Is there a specific nesting requirement for the buttons array or a missing field in the card object that the API expects? I am using SDK version 105.0.0. The error response body is minimal: {'code': 'invalidRequest', 'message': 'Invalid content type for message', 'status': 'Bad Request'}. I have also tried using the raw HTTP request via requests.post with the same result. The value fields in the buttons are strings as per spec. Is the type field inside buttons required to be postback instead of quick_reply for this endpoint? I need to send interactive cards to reduce agent handle time. Any insight into the exact JSON structure required for card content in the POST request would be appreciated. I have reviewed the API docs multiple times but the examples are sparse for complex card types.
Check the type field in your content object. It should be quick-reply, not card. The API rejects card as a top-level content type for this endpoint. Here is the corrected payload structure I use in Guzzle:
{
"content": {
"type": "quick-reply",
"title": "Options",
"quickReplies": [
{ "title": "Option 1", "payload": "opt1" }
]
}
}