Skip to main content

Make calls to Monday API from my localhost

  • March 13, 2023
  • 5 replies
  • 1100 views

Hey,
Im running axios call (in nodeJS) service from my local host to Monday API.
but I get - “self signed certificate in certificate chain”/
Searched the web a bit, and saw I can skip it by adding this (Only for debug purpose)
“process.env.NODE_TLS_REJECT_UNAUTHORIZED = “0”;”.
But then I get a new error: “socket hang up”.

Is there a way you can point me to do something to allow me running queries to Monday in order to be able to debug my code? Through postman, I do mange making calls, and I guess the reason is its creates some self sign certificate.

How do I do that?

Thanks for the helper!

5 replies

Matias.Monday
Forum|alt.badge.img
  • monday.com Team Member
  • March 14, 2023

Hello there @eitanal,

I am not experienced with Axios but I installed it and tested it to try to figure out what might be causing the issue for you.

I tried this using nodeJS and exposing my file via ngrok to the internet and it worked for me.

My endpoint is:

app.post("/axios", function(req, res) {
	axios({
		url: 'https://api.monday.com/v2',
		method: 'post',
		headers: {
			'Content-Type': 'application/json',
			'Authorization' : 'MYAPIKEYHERE'
		  },		
		  data: {
		  query: `
		  {
			boards(ids:1234567890){
			  name
			}
		  }
			`
		}
	  }).then((result) => {
		console.log(result.data)
	  });
	  res.status(200).send(req.body);
})

What are you doing differently? Or what am I missing?

Also, maybe someone in the community who has experienced this in the past might know how to solve it 🤞


  • Author
  • Participating Frequently
  • March 19, 2023

Hey,

I cant use NGROK for now at my office…

When I try to make a call to Monday, from my localhost, I receive this error: “self signed certificate in certificate chain”.

What I think that happens, is that Monday blocks me, because my origin is localhost and im not running behind any certificate.

So my question is, what do I need to do in order to pass this?

Because calls through Postman to Monday are working (what postman calls has which I don’t 😊) and how can I configure it also?

Appreciate you assistant!

Thanks,

Eitan.


Matias.Monday
Forum|alt.badge.img
  • monday.com Team Member
  • March 20, 2023

Hello again @eitanal,

What if you use our monday tunnel?

If not, I was advised to try this extension to disable CORS. You can check out if it fits what you need. As a disclaimer, we do not build or maintain that extension so I can not assure anything about it, I was just advised to check it out and since we are thinking out loud here, I wanted to share it with you.

Let me know how that goes!

Cheers,
Matias


  • Author
  • Participating Frequently
  • March 20, 2023

Hey,

I’m very limited using Tunnels, Proxies, NGRock in our network.
What im asking, using Postman, I manage to make calls to Monday API.
But from my local nodeJs service I cant.
Something in the Headers of the request is allowed by Monday when using Postman but not my axios request.

This is what I’m trying to achive…

Thanks!
Eitan


Matias.Monday
Forum|alt.badge.img
  • monday.com Team Member
  • March 21, 2023

Hello again,

Taking into account your limitations, I am not sure how else this can be solved. The ways I found to solve it are to use ngrok, our monday tunnel, any other tunneling solution, or that Chrome extension.

Maybe someone in the community has a different solution that does not require any of these things 🤞