Skip to main content
Community Expert
November 14, 2023
Question

Issue with Cloud Lightroom API Generating Renditions

  • November 14, 2023
  • 1 reply
  • 870 views

I am having an issue with the API to generate assets for 2560 or full-size images:

https://developer.adobe.com/lightroom/lightroom-api-docs/api/#tag/Assets/operation/generateRenditions

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.

This topic has been closed for replies.

1 reply

Adobe Employee
November 16, 2023

Hi Synerigst,

 

I am going to assist you in this

- Could you make sure that you are including both the scopes lr_partner_apis and lr_partner_rendition_apis while generating auth token as mentioned here as well https://developer.adobe.com/lightroom/lightroom-api-docs/getting-started/authenticate_customers/#tag/Albums/operation/listAssetsOfAlbum

- If it does work after making the above change could you please share your api key, your asset_id and the string that are you passing in the "X-Generate-Renditions" header. Don't send all those details here. Please send me over to my email id - slohia@adobe.com

 

I will be happy to help you out.

 

SynerigstCommunity ExpertAuthor
Community Expert
November 16, 2023

Thanks for the offer.  I had omitted the lr_partner_rendition_apis scope in my authorize call to

Once I included it, the authorize call failed with an invalid_scope error.
Please advise.
Michael
Adobe Employee
November 21, 2023

Could you please generate a new client_id and try with that. New client_id should work. If it doesn't then please share the client_id with me over the email.