Subject: Assistance Needed: Unable to Submit Attachment Action – “inputs must be a simple key value object”
I am encountering an issue when attempting to programmatically trigger an Attachment Action (simulating a user click on an Adaptive Card button).
Problem Description
When calling the Webex REST API endpoint:
```bash
POST /v1/attachment/actions
```
request body:
```json
{
"type": "submit",
"messageId": "*****",
"inputs": {
"txt_search_keyword": "****",
"cardType": "input",
"template_id": "40",
"id": "Summary",
"personEmail": "*****.com",
"oauth_token": "*****",
"header_text": "TnQ Genie - Search",
"option_list": [
{
"operation": "read",
"options": "get_search_summary",
"input": {
"sernum": "$txt_search_keyword"
}
}
]
}
}
```
Using the messageId of a message that contains an Adaptive Card with Action.Submit, the API consistently returns the following error:
```json
{
"message": "inputs must a simple key value object",
"errors": [
{
"description": "inputs must a simple key value object"
}
],
"trackingId": "XXXX"
}
```
However, when I used the CardSampler bot to test the card button clicks mentioned above, the attachmentAction content could be nested.The content is as follows.
```json
{
"id": "****",
"type": "submit",
"messageId": "****",
"inputs": {
"cardType": "input",
"header_text": "TnQ Genie - Search",
"id": "sn_Summary",
"oauth_token": "*****",
"option_list": [
{
"input": {
"sernum": "$txt_search_keyword"
},
"operation": "read",
"options": "get_snsearch_summary"
}
],
"personEmail": "****.com",
"template_id": "40",
"txt_search_keyword": "****"
},
"personId": "****",
"roomId": "****",
"created": "****"
}
```
When trying to simulate a button click, I tried various possible structures for the input object, but all failed, and the card could not be interacted with correctly.
If the card buttons contain "option_list" content, how should I set the "inputs" parameter in the request?
Any guidance or a troubleshooting session would be greatly appreciated.