External API call

Hi,

My website required to call a external API.
The API required to authenticate by a query params(eg: {{authUrl}}?email={{email}}&pw={{pw}}), then retrieve the token from a nested map and put in header in subsequent response. The token will expired in 30mins.

From the current “Logic” authentication method available, it seem doesn’t applicable to me as the header cannot have dynamic content and the query params cannot be stored encrypted also.

What is the alternative to this other than using 3rd party service like Zapier as client doesn’t want to use them.

The point of automation platforms like Zapier, Make, n8n, Pipedream, is that they provide a nocode approach to solving integration problems like this.

If you don’t want to do that, you can build your own. Netlify has a good serverless functions framework and is free for most basic implementations. I also like cloudflare workers for this purpose.

Thank you for your clarification,
As I am only doing POC currently , so still using the “Basic Plan”.
Is it possible to do such integration without the “Custom Code” function ?
It will be great if there is existing example to guide.

You’re on the basic site plan, so you have custom code support.
It’s only unavailable when you have both a free site plan and a free workspace plan.

I’m not sure what you’re trying to do with the API, but if your integration were e.g. solely between the external API and the CMS, you might be able to achieve what you need using the Webflow API, your target API, and webhooks as triggers.

I am sorry, i mean i am still on the free site plan and a free workspace plan and doesnt hv access the “Custom code”.

The API will process the form data sent and respond a response to be populate in frontend for user selection. The response is user specify and contain private info thus might not appropriate to be stored in the CMS before populate to the frontend.

Based on ur suggestion, i can create a “Webhook” on form submission to my backend with form data, i could decide the action based on the form ID in the payload of webhook,
but how can i send such data back to Webflow and populate the response data to frontend?

You can achieve that with custom code :wink:

In theory you could use the API webhook to trigger your external automation, and create CMS data.

  • Form submits to webhook directly via action setting
  • Webhook performs its operations
  • Webhook uses the CMS API to push data back, and publish it
  • Optional delay to ensure sync
  • Webhook then returns a redirect to the page which will contain that new published data

Timing would be tricky, and you have a good deal less control.