Question
Issue with Cloud Lightroom API Generating Renditions
I am having an issue with the API to generate assets for 2560 or full-size images:
The
API is returning this error:
code:'4300'
description: 'Access is forbidden'
Here is my TypeScript code to call it from Node:
async generateRenditionAsync(catalogId: string, assetId: string, rendition:string){
const uri = `https://lr.adobe.io/v2/catalogs/${catalogId}/assets/${assetId}/renditions`;
const adobeApiKey = process.env.AdobeApiKeyGallery;
let requestOptions = {
headers: {
Authorization: `Bearer ${this._token}`,
"X-API-Key": `${adobeApiKey}`,
"X-Generate-Renditions": rendition
}
};
try{
const result = await axios.post(uri, null, requestOptions);
return result;
}catch(error:any){
const data = _processJSONResponse(error.response.data);
const newError = new Error(data.description);
newError.name = data.code;
throw newError;
}
}
Note: I just made a slight revision to the code to set the second parameter to the axios.post to null for the body of the post. The third parameter is the header. Fixing that showed another error.

