Hi,
I am trying to upload a ".csv" file into Anaplan using Postman. Below is the API used.
PUT https://api.anaplan.com/2/0/workspaces/((workspace_id}}/models/{{model_id}}/files/{{file_id}}
But it is throwing an error of "Unsupported Media Type". Below images(also uploaded) are the configurations used.
Can someone help me in fixing this issue?
Thanks,
Akhilesh
Solved! Go to Solution.
Hey @Akhilesh9025 , I did and updated my reply.
Select the "binary" option and select your file there.
Remember to mark the problem as solved so other people also can find the answer!
Set the body as "raw" rather than "form-data", and then copy the contents of your file into the body.
Figured out how to do it in Postman. Set it to "binary" rather than "form-data" and select your file there.
The cURL command for this is:
--data-b "@<path_to_file>"
e.g
--data-b "@/mypath/myfilename"
I've confirmed this works - copy out the cURL code you get from Postman for your "raw" type, and then replace the --data-raw component with the snip above.
See this StackOverflow post for more info: post - How to send file contents as body entity using cURL - Stack Overflow
Hey @Akhilesh9025 , I did and updated my reply.
Select the "binary" option and select your file there.
Remember to mark the problem as solved so other people also can find the answer!