Hello,
I'm trying to build a flow to upload a pdf file to an third application using API.
I have to use multipart/form-data. With postman it's working well but not with flow. I have no error (code 200) but the file is not created.
Below my http request on flow.
{
"$content-type": "multipart/form-data",
"$multipart": [
{
"headers": {
"Content-Disposition": "form-data; name=\"uploadManifest\""
},
"body": {
"$content": {
"input": {
"name": "upload.pdf",
"_filename": [
"@{items('Appliquer_à_chacun_2')['link']}"
],
"entities_id": 1
}
}
}
},
{
"headers": {
"Content-Disposition": "form-data; name=\"file\"; filename=\"@{items('Appliquer_à_chacun_2')['link']}\""
},
"body": {
"$content": {
"$content-type":"application/pdf",
"$content": "@{base64(body('Get_file_content'))}"
}
}
}
]
}
I have only this instruction :
$ curl -X POST \
-H 'Content-Type: multipart/form-data' \
-H "Session-Token: 83af7e620c83a50a18d3eac2f6ed05a3ca0bea62" \
-H "App-Token: f7g3csp8mgatg5ebc5elnazakw20i9fyev1qopya7" \
-F 'uploadManifest={"input": {"name": "Uploaded document", "_filename" : ["file.txt"]}};type=application/json' \
-F 'filename[0]=@file.txt' \
'http://path/to/glpi/apirest.php/Document/'
Thanks for your help