Send POST request from a button



Wondering if it’s possible to send an arbitrary POST request over HTTP from a button in Coda? I have a few ideas for Microsoft Flow I’d like to implement, but not sure how best to trigger them.




I don’t think it’s possible to do this directly, but there are certainly a couple of options. The first would be to use a webhook and button with a URL option.

The second would be Zapier or similar services.

1 Like


Thanks Murray. I just wrote a quick microservice with to forward my ‘gets’ as ‘puts’, and respond with some window closing script and it seems to work, but is a bit ‘hacky’.




Can you say a bit more about what you did here? It sounds cool. I’m also looking for ways to increase communication between Coda and the outside world, and I saw someone recently had a related question about reacting to row changes (a case that the Zapier integration currently doesn’t cover)



(Hi Nick, I’m not sure about your level of technical knowledge around APIs and Javascript and HTTP calls and stuff so let me know if you’ve been able to follow or whether I need to go into a bit more detail).

Basically I wrote a quick bit of javascript which just receives a ‘GET’ request and makes a ‘POST’ request.

If the ‘GET’ request contains a URL as a query parameter, then it’ll attempt to format the whole query string as JSON and POST it to the ‘url’ it received.

Once it’s 'POST’ed, it’ll either send a piece of JS which will close the window, or write the error to window.

It needs some tweaking because right now, certain specific parameters which I need to pass on to my API endpoint in the URL (eg: API token) are manually pulled out of the query string and added to the URL to post to. In the next iteration, I’ll accept a few different params: url, data, and headers.

Anyway, long story short, right now, if I ‘GET’, then the lambda function will ‘POST’ to with a JSON payload of

  "firstname": "Joe",
  "lastname": "Innes"

One easy way to make a ‘GET’ request is to try to open the resource in a browser (which you can do using the ‘Open Hyperlink’ button action).

Now, when you use the ‘Open Hyperlink’ button action, a new window opens up. To avoid this window getting in the way, my lambda function returns either the error, or <script>'', '_self', ''); window.close();</script>, which causes the window to close itself again. It’s a bit ugly, but it works.

Once I’ve implemented the proper way of handling the payload/url separation I’ll make my code public along with deployment instructions so that anyone else who’s interested can spin up their own copy (hopefully either today or tomorrow).



Will be interested to see your process here, I think it might help me with my Integromat integrations :+1:



So, the code is as follows:

const axios = require('axios')
const querystring = require('querystring')
const { parse } = require('url')

module.exports = async (req, res) => {
  console.log('Starting... received ' + req)
  const { query } = parse(req.url, true)
  const data = || null
  const headers = query.headers || null
  let url = query.url || null

  if (!url) {
    res.end('You must specify a forwarding url')

  let newQuery = query

  delete newQuery.headers
  delete newQuery.url

  let sep = Object.keys(newQuery).length > 0 ? "&" : "/?"

  url = url + sep + querystring.stringify(newQuery)

  await, data)
  .then(function (response) {
  .catch(function (err) {


I’m deploying with now (, which guides you through the account setup, and lets you deploy to the with a single command.

Code also on, along with config file for Now