Cloudinary Nodejs SDK - add_context method

Comments

2 comments

  • Avatar
    Eric Pasos

    Hi Joe,

    You can add contextual metadata to an existing asset in your Media Library by using the Admin API update method. For example:

    cloudinary.api.update("sample_public_id", 
      { 
          type: "upload", 
          context: {
            caption: "YourCaptionDataHere"
          } 
      }, function(error, result) {console.log(result); } );

    Hope this helps.

    0
    Comment actions Permalink
  • Avatar
    Joe Lage

    Hi Eric,

    Thank you for your help. I tried changing the method as you suggested, but now I am getting an error. It saying the resource was not found with that public id, which is clearly not the case.

    To give a quick background I am trying to build a cloud function which gets triggered by Cloudinary's Notify webhook and uploads the newly uploaded video asset to Facebook's video endpoint and gets a unique "id" from facebook which then I would like to attach as the contextual or metadata tot he cloudinary asset.

    **Edit: I might be missing the resource_type param, checking now...

    {
      message: 'Resource not found - jk8pp4lygnt5qvdnxijc',
      http_code: 404
    }

    0
    Comment actions Permalink

Please sign in to leave a comment.