Hello,
I am trying to upload an attachment to smartsheet, which isn't supported by thier actions so i'm using the http action to do so.
It works fine in postman, here is the representation from postman:
POST /2.0/sheets/1184818672232324/attachments HTTP/1.1
Host: api.smartsheet.com
Authorization: Bearer ybu7z0jtr3h55lt8tho5e4nu5t
Content-Type: text/plain
content-disposition: attachment; filename="test.txt"
a simple text file
But when I plug this data into the http action in flow, I get the error:
{
"errorCode": 1008,
"message": "Unable to parse request. The following error occurred: Unrecognized token 'a': was expecting ('true', 'false' or 'null')\n at [Source: REST input; line: 1, column: 3]",
"refId": "11pm1pf5s81ed"
}
I figured out that if I drop the "Content-Disposition" header from the http call in postman, I also get this error.
Then I tried pointing the http post call to a different flow so I could see what is getting passed through, and these where the headers received:
{
"Accept-Encoding": "gzip,deflate",
"Accept-Language": "en-US",
"Host": "prod-21.westus.logic.azure.com",
"User-Agent": "azure-logic-apps/1.0,(workflow 859c9a1dd97c4fd8b4eaa67caf2ff035; version 08586684549956232978)",
"x-ms-activity-vector": "IN.03.05",
"Content-Length": "18",
"Content-Type": "text/plain"
}
This lead me to think that the Http action in flow is removing the content-disposition header from the post call, which in turn triggers the smartsheet error to occur.
Does anyone have a solution or workaround for this?
Hey Mabel, here is the screenshot. I just tested again this morning and have the same issue.
Here is the postman "code" that is generated, I tested again in Postman this morning and it still works:
POST /2.0/sheets/1184818672232324/attachments HTTP/1.1
Host: api.smartsheet.com
Authorization: Bearer ****************************
content-disposition: attachment; filename="notype.txt"
test file data
In what way would you suggest using the parse json action to help test this?
Lucas
Hi @Anonymous,
what’s your current situation? Are you still having the issue?
How is your flow created? Please share a screenshot of your flow.
Could you try to use action Parse JSON in your flow to see if it will work? More details about Parse JSON, please check it at here:
https://flow.microsoft.com/en-us/blog/five-services-json-http/
Best regards,
Mabel Mao
WarrenBelz
146,745
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,091
Most Valuable Professional