WindmillWWindmill
Powered by
NatN
Windmill•2y ago•
1 reply
Nat

Get a image from an api

Hello, we download a image from an api. And we want to send this image in slack channel

The script below get our image, and another script send the image on slack. These two scripts are in a flow.
How to pass this image from a script to another script ? How we should process ? We tried to encode it in utf8 and then encore it in base64 to send it, but the image don't work. If we don't encode it in utf8, windmill throw an error saying it's bad unicode character for the database

const url = `https://creator.zoho.eu/api/v2.1/${account}/${application}/report/${report}/${recordId}/${field}/download`;

// REQUEST
const response = await fetch(url, {
  method: "GET",
  headers: { Authorization: "Zoho-oauthtoken " + token },
});

const blob = await response.blob();
const text = await blob.text();
const data = utf8.encode(text);

if (response.status >= 300) throw new Error(response.statusText);

return { success: true, data };
const url = `https://creator.zoho.eu/api/v2.1/${account}/${application}/report/${report}/${recordId}/${field}/download`;

// REQUEST
const response = await fetch(url, {
  method: "GET",
  headers: { Authorization: "Zoho-oauthtoken " + token },
});

const blob = await response.blob();
const text = await blob.text();
const data = utf8.encode(text);

if (response.status >= 300) throw new Error(response.statusText);

return { success: true, data };
WindmillJoin
3,362Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?
Recent Announcements
henri-c

Weekly kenote to tell you about our latest updates https://discord.com/channels/930051556043276338/1278977038430240813 https://youtube.com/live/2dGd9TdT8xs?feature=share

henri-c · 4d ago

Pyra

### HTTP tracing (EE) Capture HTTP requests made by job scripts as observability spans Features: - View HTTP request traces (method, URL, status, timing) in the job details UI - Auto-instrumentation for Native TypeScript, MITM proxy for other languages - Integrates with external OpenTelemetry collectors changelog: https://www.windmill.dev/changelog/http-tracing docs: https://www.windmill.dev/docs/advanced/instance_settings#http-tracing Additionally jobs memory metrics are now fully OSS!

Pyra · 2w ago

henri-c

First keynote of the year here https://discord.com/channels/930051556043276338/1278977038430240813 🙂

henri-c · 4w ago

Similar Threads

Different response from an API
LeandroLLeandro / help
13mo ago
i am facing an issue in get webhook when parsing a query parameter
AngadAAngad / help
3y ago
How to copy all windmill artifacts from windmill base image?
ericEeric / help
3y ago
Returning a PDF from a webhook
EggingtonEEggington / help
2y ago