File Uploader: POSTing 'cdnurl' to another API?

I have the File Uplader set up and cinfigured in a PHP file to upload an image - all works!

But - I need to send the ‘cdnurl’ value to a webhook. Can I do this? I was using the older jquery widget before but cannot get it to work with the new Uploader

You can use the LR_UPLOAD_FINISH or LR_DATA_OUTPUT event. See https://uploadcare.com/docs/file-uploader/data-and-events/#events.

For example:

window.addEventListener('LR_UPLOAD_FINISH', (e) => {
  const { cdnUrl } = e.detail.data[0];
  fetch(WEBHOOK_ENDPOINT, {
    method: "POST",
    body: cdnUrl
  })
});

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.