How to make the custom api work

Hello everybody,

Last week I installed the sensors in my garden and published the data on the different portals. To learn some more I have been trying to configure a custom api. I used the simple data php file:
(data_simple.php from github)
I copied this page on my own website: https://ruitergeo.nl/sensoren/sensorapi.php. In the configuration of the sensor I filled in the location of the page see:


This didn’t work out fine because the logger produces errors:

*## Sending to custom api: *
Request failed with error: -1
Time for Sending (ms): 15461

What did I do wrong?
Can anybody help me with this?

Welcome !

Can you firstly try without the https ?

Then try to remove the .php extension.

Then remove the / or try to put it on the Pad line.

I can remember there are such kind of kleinigkeiten…

And what happens if you try to post with POSTMAN for example. Does it works ?

Check structure here:

Hi pjg!

Thanks for your suggestions. I tried all combinations of server and path but did didn’t work out.
I also tried some efforts with postman. For instance:
https://ruitergeo.nl/sensoren/sensorapi.php?temperature=“2”&humidity=“3”&BME280_temperature=“1000”&BME280_humidity=“79”&BME280_pressure=“999”&Sensor=“esp8266-15109343”&HTTPS_SENSOR=“esp8266-15109343”

But the php file doesnot understand the parameters. I have little experience with this environment and hoped that somebody else had a working example.
Do you have another idea?

Hi. Could you try the following in the API-setup:

Serveradres: ruitergeo.nl
Pad: /sensoren/sensorapi.php
Poort: 443

The leading / in Pad is needed and if you want to use HTTPS the port should be set to 443

Hi!

That did the job!
This was the last logging:

Sending to custom api:

Succeeded - ruitergeo.nl
Time for Sending (ms): 2979

Thanks for helping me out!

2 Likes