HTTP integration issue (Tago)

Hello,

I have a problem with a specifique HTTP integration tago IO, I’m trying to post any data to tago.

I recovered this log from the lora-app-server:

level=info msg="device updated" dev_eui=00250c0100001319
level=info msg="handler/mqtt: publishing message" qos=0 topic=application/1/device/00250c0100001319/rx
level=info msg="handler/http: publishing data-up payload" dev_eui=00250c0100001319 
url="https://api.tago.io/data"
level=error msg="handler *httphandler.Handler error: expected 2XX response, got: 400"
level=info msg="handler/influxdb: uplink measurements written" dev_eui=00250c0100001319
level=info msg="finished unary call with code OK" grpc.code=OK grpc.method=HandleUplinkData 
grpc.request.deadline="2018-12-08T15:11:54Z" grpc.service=as.ApplicationServerService 
grpc.start_time="2018-12-08T15:11:53Z" grpc.time_ms=405.177 peer.address="127.0.0.1:59017" 
span.kind=server system=grpc

So I’m facing to this error ==> level=error msg=“handler *httphandler.Handler error: expected 2XX response, got: 400”

Error code 400 = This can be several types of error (Bad URL, Incorrect Cookies, Files too large, Header lines too long)

Here my HTtP integration:

For your information curl command works very well:

root@Debian02:~# curl -H "Content-Type: application/json" -H "Device-Token: 250134c4-efa6-4c53-80c9-170b46aa4914" -X POST -d '{"variable":"temperature","value":27,"unit":"F"}' https://api.tago.io/data
{"status":true,"result":"1 Data Added"}

Do you have an idea of the problem?

Thank you.

Could you change the endpoint in the HTTP integration to for example a https://postb.in/ endpoint to debug which request was received by the endpoint?

Hello @brocaar, thank for the reply.

It works with postb.in I received a json

The log:

level=info msg="device updated" dev_eui=00250c0100001319
level=info msg="device-activation created" dev_eui=00250c0100001319 id=411
level=info msg="handler/mqtt: publishing message" qos=0 topic=application/1/device/00250c0100001319/join
level=info msg="handler/mqtt: publishing message" qos=0 topic=application/1/device/00250c0100001319/rx
level=info msg="handler/http: publishing data-up payload" dev_eui=00250c0100001319 url="https://postb.in/xU5CYJgy"
level=info msg="handler/influxdb: uplink measurements written" dev_eui=00250c0100001319
level=info msg="finished unary call with code OK" grpc.code=OK grpc.method=HandleUplinkData grpc.request.deadline="2018-12-09T14:36:12Z" grpc.service=as.ApplicationServerService grpc.start_time="2018-12-09T14:36:11Z" grpc.time_ms=2826.783 peer.address="127.0.0.1:58525" span.kind=server system=grpc

postb.in:

loraserver http integration:

So regarding tago IO POST example (with postman tool):

This is exactly what I did but instead postman with loraserver http integration…

Wow, postbin is a convenient tool, thank you!

Please note that there is a difference in data format (POST body) between your curl post and what LoRa App Server sends.

Completely and If I make a curl with the loraserver POST body I’m recovering an error.