I can make API requests to see the elements in a library. I have a library that has .glb files in it. What API do I use to download it in my Node application?
Thanks,
Michael
The download link for the asset should be available from the Elements API (/api/v1/libraries/{id}/elements/{id}
) with the selector=representations
query parameter. One of the representations, assuming the asset was added by the application where the element was created, should have a download link in the representations
array. In an individual array item, look for the storage_href
attribute for the URL or in the _links["http://ns.adobe.com/melville/rel/primary"].href
attribute.
Here’s an example from a juicy AfterEffects template with multiple representations, this being its primary (as noted in the representation’s relationship
attribute):
{
"id": "43f5190f-2721-472f-b4e1-d89d51ed3a90",
"type": "application/vnd.adobe.ae.graphic+zip",
"relationship": "primary",
"path": "a6ebf8c6-a524-4238-b57d-bc07802d0bc9.aegraphic",
"is_full_size": false,
"is_external_link": false,
"content_length": 5532,
"storage_href": "https://platform-cs-stage-va6.adobe.io/content/storage/id/urn:aaid:sc:US:c7d9864d-9219-43a6-a149-5ab6c5444165;version_id=0?component_id=43f5190f-2721-472f-b4e1-d89d51ed3a90",
"name": "project.aegraphic",
"version": "0",
"md5": "SGnRhyiLAjggupanNPH82g==",
"_links": {
"http://ns.adobe.com/melville/rel/primary": {
"href": "https://platform-cs-stage-va6.adobe.io/content/storage/id/urn:aaid:sc:US:c7d9864d-9219-43a6-a149-5ab6c5444165;version_id=0?component_id=43f5190f-2721-472f-b4e1-d89d51ed3a90",
"rel": "http://ns.adobe.com/melville/rel/primary",
"type": "application/vnd.adobe.ae.graphic+zip",
"templated": false
},
"http://ns.adobe.com/melville/rel/rendition": {
"href": "https://platform-cs-stage-va6.adobe.io/content/storage/id/urn:aaid:sc:US:c7d9864d-9219-43a6-a149-5ab6c5444165/:rendition{;page,size,type}?fragment=id%3D43f5190f-2721-472f-b4e1-d89d51ed3a90",
"rel": "http://ns.adobe.com/melville/rel/rendition",
"templated": true
}
},
"etag": "\"4869d187288b023820ba96a734f1fcda\"",
"is_preferred_thumbnail": false,
"is_component": true,
"state": "unmodified"
}