Make requests to the Discourse API with Zapier

OK, I figured out what I needed to do:

  1. Install cors-anywhere locally and run the server
  2. Modify the request to include the reverse proxy before the API endpoint and call the json method in the Fetch Response object:
await (fetch("http://localhost:8080/mycommunity.com/g.json", {
  headers: {
    "Api-Username": Secret("DISCOURSE_USERNAME"),
    "Api-Key": Secret("DISCOURSE_KEY")
  },
})).json()
2 likes