You are not logged in.
In the workflow followed by our client, media elements are searched by an ID in the search bar. It is being referred to as Asset ID or Reference ID. I couldn't find any api in the swagger api docs to fetch the media using this ID. Can you please help with the apis required to fetch & download an asset(media element) by asset ID/Reference ID
Offline
The endpoint to get a direct URL of a file is:
/rest/v1/files/{fileId}/directUrl
with the ID added in instead of the {field} bit of course
You will need to authenticate first and provide the sessionId as a header for this request
As an example, if I do this in Python:
import requests
fileId = "66285385883"
fetch_endpoint = f"/rest/v1/files/{fileId}/directUrl"
fetch_response = requests.get(url=URL+fetch_endpoint, headers=headers)
print(fetch_response.text)
I get back
{"response":"https://d1br04p5jdm344.cloudfront.net/file/26/mu2J6ywmeRX4cqmu-M2mh.fmifP_JR/rev=2/Food-packaging-08.jpg"}
which is a direct URL for this file. If you look at the documentation in our API docs here:
https://infosys.thirdlight.com//apidocs … tDirectUrl
you can see that you are also allowed to make some modifications to the version of the picture you are fetching, without affecting the original file in Chorus.
Note that you can also use the Chorus UI to create derivatives of any given file to have different versions of it (such as crops or different file types) and then use their IDs instead to get those direct URL.
Offline
addendum: if it's about creating downloads it's better to use this endpoint instead:
/rest/v1/files/{fileId}/temporaryDirectUrl
as links created this way don't check for permissions in the same way and will automatically expire
Offline
Thank you for the swift response. That api worked.
Offline