Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
OlivierS
Partner - Contributor III
Partner - Contributor III

Store Image through API reply with 415

Hi, 

I try to use the Put request through postman to store an image into a media file:

curl "https://your-tenant.us.qlikcloud.com/api/v1/apps/{appId}/media/files/{path}" \
 -X PUT \
 -H "Authorization: Bearer <API-key>" \
 -H "Content-type: application/octet-stream" \
 --data-binary "@/path/to/file"


Link to the documentation here:
https://qlik.dev/apis/rest/apps#%23%2Fentries%2Fv1%2Fapps%2F-appId%2Fmedia%2Ffiles%2F-path-get


I'm blocked on a 415 error due to Unsupported Media Type. Not sure what i am doing wrong here. Any clue ?

OlivierS_0-1692652081638.png

 

OlivierS_1-1692652095812.png

 




Labels (2)
2 Replies
DaveChannon
Employee
Employee

Hey @OlivierS the API expects an octet-stream, so in postman the only way of doing this (that I'm aware of) is to select binary and select the file you wish to upload. At the moment you're just passing a string that the API doesn't know what to do with.

If you build your own app, then you have the flexibility to retrieve and stream the file when you make the API call, but I don't believe Postman has features to download and stream a file during an API call.

OlivierS
Partner - Contributor III
Partner - Contributor III
Author

Hi Channon,

I succeeded uploading a file using the API using the same method but I really need to avoid downloading the file on my device between the get URL and the PUT method. I try to find a way to download serie image into the media file through a script on the Saas. 😉

Thanks for you quick feedback 😉