0
votes

I could http post only with Input.Number now, but Input.Date and Input.Text both receive 400 error.

I was planning to create a Microsoft Flow to receive some value from Outlook Adaptive Card Action.Http Post method, I followed some articles from internet show me how to do that, finally I get rid of the 401 error because it needs Authorisation header.

Okay, then I moved on to test http payload. The body couldn't be something like "body": "test", otherwise it will either gives me an 400 or even not shows adaptive card in email at all. After I learned that I have to use they officially suggested {{someId.value}} into "body".

I succeeded for the first time with Input.Number:

{
    "type": "Input.Number",
    "id": "test1",
    "title": "New Input.Toggle",
    "value": "",
    "validation": null,
    "placeholder": "Placeholder text",
    "min": "0",
    "max": "60"
}

Then outlook tells me it is successful and I did get the endpoint flow run and receive correct payload. And this is the "Action.Http" part:

"actions": [
{
    "type": "Action.Http",
    "title": "Say hello",
    "method": "POST",
    "url": "myflowhttptriggerurl",
    "body": "{{nameInput.value}}",
    "headers": [
    { "name": "Authorization", "value": "" }
    ]
}
]

enter image description here


Below is what get error: After then, I tried with Input.Text and Input.Date, they all give me 400, below is payload, and don't worry for Action.Http, I change id each time when testing:

    {
        "type": "Input.Date",
        "id": "h",
        "title": "New Input.Toggle",
        "value": "",
        "validation": null
    }

Text payload:

    {                                        
        "type": "Input.Text",                                    
        "id": "newTask",                                     
        "isRequired": true,                                  
        "placeholder": "Enter a new task"                                    
    }

enter image description here

1

1 Answers

0
votes

OK, first I would install the "Actionable Messages Debugger" into Microsoft Office to make it easier to understand if the contents of your card is correct.

It appears from the card you are doing it correct, what happening on your flow that is receiving the message?

You could always try send through a JSON object, so your body will be

"body": "{\"comment\":\"{{comment.value}}\"}"

Where comment is the id of your Input.Text as such:

{
   "id": "comment",
   "type": "Input.Text"
   "isMultiline": true,
   "placeholder": "Comments" 
}