ServiceDesk Plus Cloud API - upload file attachments using MS Power Automate
Hello,
I am using MS Power Automate ("PA") to upload file attachments from Sharepoint to a ServiceDesk request via the API. I am getting a response from the API that I am not understanding. The response is:
{
"response_status": {
"status_code": 4000,
"messages": [
{
"status_code": 4001,
"field": "file_list",
"type": "failed"
}
],
"status": "failed"
}
}
I have tested using a standalone python script and it was successful. My suspicion is there is a problem with the way PA is inserting the binary file data into the http request body.
Headers are:
{
"Content-Type": "multipart/form-data; boundary=<boundary>",
"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization": "*sanitized*"
}
Body is:
--<boundary>\r\n
Content-Disposition: form-data; name="addtoattachment"\r\n\r\n
true\r\n
--<boundary>\r\n
Content-Disposition: form-data; name="filename"; filename="filename.png"\r\n
Content-Type: application/octet-stream\r\n\r\n
<binary content>
--<boundary>--