I’m trying to pass an image from a URL to a POST Webhook. The API endpoint will only accept an image payload in Base64. Looking to use Code by Zapier to accomplish the translation, but I’m coming up short. Has anyone managed to devise a similar solution?
Best answer
Converting an image to Base64
Best answer by ikbelkirasanBest answer by ikbelkirasan
Hi
const response = await fetch(inputData.url);
const content = await response.buffer();
const data = content.toString("base64");
output = [{ data }];
This post has been closed for comments. Please create a new post if you need help or have a question about this topic.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.