Hi, I’ve been trying to get custom actions and triggers working but don’t understand how to set up the API. I’ve set up the base URL using ngrok and the built-in apps work. However, the following block for both trigger and action when set up with the paths specific return the following error:
Hi Matais, thanks for responding to my call for help. I set the URLs to the example suggested
/monday/subscribe and monday/unsubscribe so it would point to my ngrok address.
I don’t have the endpoints running in the project, in the same port. Maybe if you can point me to what file or code I have to insert where to set that up.
You have to add that URL in your app, in your integration feature, in the “Feature details” tab, in the “Base URL” field.
Your ngrok is working on a specific port. You will see in your terminal when you start ngrok that it says something like https://111-22-333-44-555.ngrok.io → http://localhost:3000. In this case, 3000 would be that port. Then you have to run the file/project in which you have those endpoints (/monday/subscribe and /monday/unsubscribe) in the same port.
For example, in my example code, those endpoints look like this:
app.post("/monday/subscribe", function (req, res) {
console.log(req.body)
res.send(res.body);
});
And to run my project y open the terminal in Visual Studio Code, go to the folder which contains my file (the file that contains these endpoints) and in the terminal I run node filename.js
It is important to note that I have these lines of code in my file:
import express from "express";
import http from "http";
import bodyParser from "body-parser";
const app = express();
app.use(bodyParser.json());
const server = http.createServer(app);
server.listen(process.env.PORT || 3000, function() {
console.log('Express server listening on port 3000.');
})