401 error when trying to create a custom record

I’m writing a node js Azure function to create a record in a custom module and when I post the JSON values it returns with a 401. Using the same API key I call a “GET” function on that same custom module and I am able to list filters and drill down a specific record. I’ve setup Postman with variables for the api key so I know the key works. The only difference between Postman and my app I find is the headers, I’ve included the same Authorization headers and content-type headers. The other headers Postman specific so I doubt they are relevant.
I have verified the url is in the correct format according to the documentation

Question is
What are the required headers needed to POST to a custom module?
If I call a GET method on a custom module then simply switch the method to a POST, why is it returning a 401?

So, you were able to list GET the records using Postman and not using your app?

Could you elaborate a bit more about your app? So may be code snippet (with sensitive info removed) of the request?

Hi Saif,
I was able to get the issue resolved through our rep: turns out there was a space between the “=” and “token” (i.e. Token token= xxxxxx). Once I removed the space it all worked.

Thank you
Guy

1 Like

Thanks for sharing the mistake in the hindsight. We all do it.

Appreciating returning on to this thread and sharing it with us.

Happy coding. Cheers!