# HTTP Integration not working!

**URL:** <https://www.thethingsnetwork.org/forum/t/http-integration-not-working/9062>\
**Category:** v2 Backend\
**Created:** [August 21, 2017, 11:35am UTC](https://www.thethingsnetwork.org/forum/t/http-integration-not-working/9062 "2017-08-21T11:35:01Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![tejasa97](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/t/c5a1d2/32.png) [@tejasa97](https://www.thethingsnetwork.org/forum/u/tejasa97)\
**Post date:** [August 21, 2017, 11:35am UTC](https://www.thethingsnetwork.org/forum/t/http-integration-not-working/9062/1 "2017-08-21T11:35:02Z")

</div>

I am conveniently receiving data on my application(Console), and I have set up an HTTP Integration to one of my webhosts. I’ve kept Auth blank, and put a optional custom header ‘Content-Type’:‘application/json’. But i receive absolutely NO post requests. I’ve also configured my site to send me an SMS every time a POST request is made(yes, I tried with a post request using Postman and it does work). I also tried using a temporary http endpoint like Requestbin, but to no avail. Help? Is the HTTP Integration service currently down??

---

<div class="post-metadata">

**Author:** ![BoRRoZ](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/borroz/32/44234_2.png) [@BoRRoZ](https://www.thethingsnetwork.org/forum/u/BoRRoZ)\
**Post date:** [August 21, 2017, 11:51am UTC](https://www.thethingsnetwork.org/forum/t/http-integration-not-working/9062/2 "2017-08-21T11:51:22Z")

</div>

Some network systems are **[experiencing issues](https://status.thethings.network/)** , don’t know if that’s related to you

---

<div class="post-metadata">

**Author:** ![johan](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/johan/32/45177_2.png) [@johan](https://www.thethingsnetwork.org/forum/u/johan)\
**Post date:** [August 21, 2017, 1:18pm UTC](https://www.thethingsnetwork.org/forum/t/http-integration-not-working/9062/3 "2017-08-21T13:18:11Z")

</div>

@tejasa97 sending you a DM

No known issues with HTTP integration

Will follow up here

---

<div class="post-metadata">

**Author:** ![tejasa97](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/t/c5a1d2/32.png) [@tejasa97](https://www.thethingsnetwork.org/forum/u/tejasa97)\
**Post date:** [August 22, 2017, 11:15am UTC](https://www.thethingsnetwork.org/forum/t/http-integration-not-working/9062/4 "2017-08-22T11:15:53Z")

</div>

HTTP Integration seems to be working now (still shaky, though, sometimes goes down without any warning), but it still takes close to 30-40 seconds to forward data (make the HTTP request)

---

<div class="post-metadata">

**Author:** ![Trononimon](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/trononimon/32/28010_2.png) [@Trononimon](https://www.thethingsnetwork.org/forum/u/Trononimon)\
**Post date:** [November 13, 2018, 2:23pm UTC](https://www.thethingsnetwork.org/forum/t/http-integration-not-working/9062/5 "2018-11-13T14:23:43Z")

</div>

Hello,  
I did an HTTP integration to requestb.in. If I’m simulating an upload it works. If i get data from my device it does not work. Any suggestion what might be the difference? I see in the console for the simulated package there is no metadata. Might it be this?

---

<div class="post-metadata">

**Author:** ![Trononimon](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/trononimon/32/28010_2.png) [@Trononimon](https://www.thethingsnetwork.org/forum/u/Trononimon)\
**Post date:** [November 13, 2018, 6:00pm UTC](https://www.thethingsnetwork.org/forum/t/http-integration-not-working/9062/6 "2018-11-13T18:00:15Z")

</div>

is there a way to see the return code from calls from the HTTP integration?

---

<div class="post-metadata">

**Author:** ![arjanvanb](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/arjanvanb/32/46626_2.png) [@arjanvanb](https://www.thethingsnetwork.org/forum/u/arjanvanb)\
**Post date:** [November 13, 2018, 6:01pm UTC](https://www.thethingsnetwork.org/forum/t/http-integration-not-working/9062/7 "2018-11-13T18:01:16Z")

</div>

Return codes are set by your own server, right? (Things like 200 OK and 500 Internal Server Error?)

But maybe the MQTT events topic can show some details; [https://www.thethingsnetwork.org/docs/applications/mqtt/api.html#error-events](https://www.thethingsnetwork.org/docs/applications/mqtt/api.html#error-events)

---

<div class="post-metadata">

**Author:** ![Trononimon](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/trononimon/32/28010_2.png) [@Trononimon](https://www.thethingsnetwork.org/forum/u/Trononimon)\
**Post date:** [November 13, 2018, 8:30pm UTC](https://www.thethingsnetwork.org/forum/t/http-integration-not-working/9062/8 "2018-11-13T20:30:47Z")

</div>

Thanks that was a very good hint. I found out that I get an HTTP 400 Bad request  
The json arrived at my server looks like this

> ```
> 052.169.225.045.60130-192.168.001.137.08080: POST /api/v1/ACxG-redacted-fL0/telemetry HTTP/1.1
> Host: tron.internet-box.ch:89
> User-Agent: http-ttn/2.6.0
> Content-Length: 708
> Content-Type: application/json
> Accept-Encoding: gzip
> 
> {"app_id":"bubble_logger","dev_id":"heltec","hardware_serial":"0123456789AABBCC","port":1,"counter":291,"payload_raw":"Aqc=","payload_fields":{"bubbles":679},"metadata":{"time":"2018-11-13T20:25:35.810596656Z","frequency":868.5,"modulation":"LORA","data_rate":"SF11BW125","coding_rate":"4/5","gateways":[{"gtw_id":"eui-b827ebfffe97f686","timestamp":3645317348,"time":"2018-11-13T20:25:35.792731Z","channel":2,"rssi":-115,"snr":-13.5,"rf_chain":1,"latitude":47.379448,"longitude":8.548805,"altitude":504,"location_source":"registry"}]},"downlink_url":"https://integrations.thethingsnetwork.org/ttn-eu/api/v2/down/bubble_logger/thingsboard_local?key=ttn-account-v2.1UQ-redacted-P7o"}
> 192.168.001.137.08080-052.169.225.045.60130: HTTP/1.1 400 
> X-Content-Type-Options: nosniff
> X-XSS-Protection: 1; mode=block
> Cache-Control: no-cache, no-store, max-age=0, must-revalidate
> Pragma: no-cache
> Expires: 0
> Content-Length: 0
> Date: Tue, 13 Nov 2018 20:25:36 GMT
> Connection: close
> 
> ```

I tried to with postman to modify the content of the POST and as soon as I have a nested json like the metadata and gateway than it fails. If I just send some key:value pairs it is working  
like

> 192.168.001.102.53806-192.168.001.137.08080: POST /api/v1/ACx-redacted-fL0/telemetry?= HTTP/1.1  
> Content-Type: application/json  
> cache-control: no-cache  
> Postman-Token: 892ee8a4-9b13-442f-9899-e49ffbd282b4  
> User-Agent: PostmanRuntime/7.4.0  
> Accept: _/_  
> Host: 192.168.1.137:8080  
> accept-encoding: gzip, deflate  
> content-length: 347  
> Connection: keep-alive
> 
> {  
> “app\_id”:“bubble\_logger”,  
> “dev\_id”:“heltec”,  
> “hardware\_serial”:“0123456789AABBCC”,  
> “port”:1,  
> “counter”:278,  
> “payload\_raw”:“AsQ=”,  
> “bubbles”:555,  
> “downlink\_url”:“[https://integrations.thethingsnetwork.org/ttn-eu/api/v2/down/bubble\_logger/thingsboard\_local?key=ttn-account-v2.1UQ-redacted-7o](https://integrations.thethingsnetwork.org/ttn-eu/api/v2/down/bubble_logger/thingsboard_local?key=ttn-account-v2.1UQ-redacted-7o)”  
> }  
> 192.168.001.137.08080-192.168.001.102.53806: HTTP/1.1 200  
> X-Content-Type-Options: nosniff  
> X-XSS-Protection: 1; mode=block  
> Cache-Control: no-cache, no-store, max-age=0, must-revalidate  
> Pragma: no-cache  
> Expires: 0  
> Content-Length: 0  
> Date: Tue, 13 Nov 2018 20:29:19 GMT

The receiving server is a [Thingsboard.io](http://Thingsboard.io) application running on a raspberry pi. Any Idea why the nested json tags are causing troubles?  
THX Sergio

---

<div class="post-metadata">

**Author:** ![arjanvanb](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/arjanvanb/32/46626_2.png) [@arjanvanb](https://www.thethingsnetwork.org/forum/u/arjanvanb)\
**Post date:** [November 13, 2018, 9:05pm UTC](https://www.thethingsnetwork.org/forum/t/http-integration-not-working/9062/9 "2018-11-13T21:05:57Z")

</div>

We’d need to see the code that’s parsing/interpreting the JSON to make any guess. Note that `gateways` in `metadata` is an array of one or more gateways. But any JSON parser should be able to handle that.

However, you also wrote:

> [@Trononimon](#):
>
> I did an HTTP integration to requestb.in. If I’m simulating an upload it works. If i get data from my device it does not work.

I don’t think requestb.in is doing any parsing/interpretation, but instead it’s just showing the payload? If true, and if showing that payload already fails for true device uplinks, then something odd is going on…

Beware that you posted secrets above. I’ve now redacted those, but once everything is running you might want to change the secrets.

---

<div class="post-metadata">

**Author:** ![Trononimon](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/trononimon/32/28010_2.png) [@Trononimon](https://www.thethingsnetwork.org/forum/u/Trononimon)\
**Post date:** [November 13, 2018, 9:17pm UTC](https://www.thethingsnetwork.org/forum/t/http-integration-not-working/9062/10 "2018-11-13T21:17:19Z")

</div>

actually I see in the thingsboard documentation that the do not allow nested json only on specific case with ts and values, and I think it also worked with the in the console simulated upload because it does not have the nested gateway block. Any chance to be able to format the json with the payload funktions in ttn?

docu from Thingsboard

> The simplest supported data formats are:
> 
> ```auto
> {"key1":"value1", "key2":"value2"}
> 
> ```
> 
> or
> 
> ```auto
> [{"key1":"value1"}, {"key2":"value2"}]
> 
> ```
> 
> **Please note** that in this case, the server-side timestamp will be assigned to uploaded data!
> 
> In case your device is able to get the client-side timestamp, you can use following format:
> 
> ```auto
> {"ts":1451649600512, "values":{"key1":"value1", "key2":"value2"}}
> 
> ```

---

<div class="post-metadata">

**Author:** ![arjanvanb](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/arjanvanb/32/46626_2.png) [@arjanvanb](https://www.thethingsnetwork.org/forum/u/arjanvanb)\
**Post date:** [November 13, 2018, 9:23pm UTC](https://www.thethingsnetwork.org/forum/t/http-integration-not-working/9062/11 "2018-11-13T21:23:12Z")

</div>

Okay, so no problems in requestb.in then?

Indeed, not every third party website will understand the data that the HTTP Integration sends. Using payload functions only affects the value of `payload_fields`; the rest of the JSON will not change.

But it seems ~~you’re~~ those who’re using the Professional Edition are lucky; see (today’s last post at) [Has someone linked TTN with Thingsboard?](https://www.thethingsnetwork.org/forum/t/has-someone-linked-ttn-with-thingsboard/11046)

---

<div class="post-metadata">

**Author:** ![Trononimon](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/trononimon/32/28010_2.png) [@Trononimon](https://www.thethingsnetwork.org/forum/u/Trononimon)\
**Post date:** [November 14, 2018, 12:13am UTC](https://www.thethingsnetwork.org/forum/t/http-integration-not-working/9062/12 "2018-11-14T00:13:16Z")

</div>

funny 🙂 I just managed to get my payload with node-red to thingsboard without professional edition. Thank you
