HTTP Endpoint not working

Hello

I’ve been experimenting with a DHT11 sensor, a NodeMCU, and Thinger.io. Everything has gone well until I tried to define and use a Thinger HTTP endpoint. The endpoint has no headers and I’ve selected the ‘Send call data as JSON’ option. I make a call to the endpoint, using the following statement:

thing.call_endpoint("add_weather_record_to_db");

However, the URL resource behind the endpoint (a PHP file that writes to a database) doesn’t get called. I’ve tried using GET and POST, I’ve tried using the call_endpoint function both with and without a pson data argument but nothing works.

From my description, have I configured the endpoint correctly? If so, does anyone have a simple and complete working example of a sketch that successfullyPreformatted text invokes a Thinger endpoint that they’d be willing to share with me?

Thanks

Hi @awarren,

There is an Endpoint testing tool available in the platform, you can access to it in the Endpoint configuration page… have you used? what was the result?

more info at this topic=> REST API GET value for a single resource

hope it helps!

Hi Jorge

Yes, I’ve used the testing tool and the endpoint works fine. However, it does not work when I call the same endpoint from the NodeMCU sketch.

Thanks

Alan

Hello @awarren,

Are you sure that the endpoint is being called properly? I mean, if you configure it as email endpoint… do you receive the message?

If this works, the problem should be in the API requirements, maybe it is not receiving the right structure or data, but I don’t know how to check it. Go to their documentation and check if there is any additional header that should be added… then test it with Postman or similar and finally, when you became sure that it is working properly, introduce it in thigner.io.

hope it helps

Hi Jorge

Yes, I’m receiving emails from an endpoint with no issue. Thanks for the suggestion. It could be a missing header, so I’ll experiment using curl.

Thanks
Alan