I am trying to use the Lightroom APIs to retrieve images from my Lightroom Cloud store. I have oauth working, and I can do anything but getting a rendition.
I wrote the following script to illustrate my problem. I am able to get my catalog metadata to get the catalog id. I am able to use that catalog id to get an asset id. I am even able to request the metadata for that particular asset, but as soon as I try to get the rendition, I get an error.
# (All personal ids/tokens removed)
CLIENTID=MYCLIENTID
TOKEN=ATOKENFROMOAUTH2
CATALOG_ID=MYCATALOID
AN_ASSET_ID=ANASSETID
# These three all work.
CATALOG_URL="https://lr.adobe.io/v2/catalog"
ASSETS_URL="https://lr.adobe.io/v2/catalogs/${CATALOG_ID}/assets"
ASSET_URL="https://lr.adobe.io/v2/catalogs/${CATALOG_ID}/assets/${AN_ASSET_ID}"
# This one does not.
RENDITION_URL="https://lr.adobe.io/v2/catalogs/${CATALOG_ID}/assets/${AN_ASSET_ID}/renditions/2048"
FILE=`mktemp`
wget --content-on-error -S -O$FILE --header="x-api-key: $CLIENTID" --header="authorization: Bearer $TOKEN" $RENDITION_URL
#tail -n +2 $FILE | jsonpp
cat $FILE
Output from wget:
Resolving lr.adobe.io (lr.adobe.io)... 52.13.231.217, 34.211.127.250, 52.25.171.118
Connecting to lr.adobe.io (lr.adobe.io)|52.13.231.217|:443... connected.
HTTP request sent, awaiting response...
HTTP/1.1 404 Not Found
Server: openresty
Date: Sat, 26 Mar 2022 17:24:56 GMT
Content-Type: application/json
Content-Length: 130
Connection: keep-alive
X-Result-Code: 1000
X-Result-Subtype: ResourceNotFoundError
X-Request-Id: IDREMOVED
X-Client-Identifier: Wget/1.21.3
X-Traffic-Type: customer
X-Account-Id: IDREMOVED
X-Client-Id: IDREMOVED
Access-Control-Allow-Methods: GET,HEAD,PUT,DELETE,POST,OPTIONS
Access-Control-Max-Age: 60
Access-Control-Allow-Credentials: true
Vary: Origin
Saving to: ‘/var/folders/lh/5yh_y_m92cx8jwhty73958vc0000gn/T/tmp.OR8z0liC’
/var/folders/lh/5yh_y_m9 100%[================================>] 130 --.-KB/s in 0s
2022-03-26 13:24:56 ERROR 404: Not Found.
while (1) {}
{"code":1000,"description":"Resource not found","errors":{"type":["not in asset"]},"subtype":"ResourceNotFoundError"}%
I have tried this many ways. I have looked at the Adobe sample code, but I have been unable to figure this out for myself. Any suggestions welcome and appreciated.
Thanks, y'all!
From the HTTP status code 404 and description shows
not found, you probably need to make a POST request to generate renditions(https://developer.adobe.com/lightroom/lightroom-api-docs/api/#operation/generateRenditions) first before getting renditions from server.