# Receiving JSON message with PHP / Gateway

**URL:** https://f.ruuvi.com/t/receiving-json-message-with-php-gateway/4197
**Category:** 🇬🇧 Electronics & programming
**Created:** [14 May 2020 19:38 UTC](https://f.ruuvi.com/t/receiving-json-message-with-php-gateway/4197 "2020-05-14T19:38:14Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Markus\_T](https://f.ruuvi.com/user_avatar/f.ruuvi.com/markus_t/32/2061_2.png) [@Markus\_T](https://f.ruuvi.com/u/Markus_T)
#### Post date: [14 May 2020 19:38 UTC](https://f.ruuvi.com/t/receiving-json-message-with-php-gateway/4197/1 "2020-05-14T19:38:14Z")

</div>

Hi all,

In RuuviStation, I have set my gateway URL to [www.mydomain.com/phpreceiver.php](http://www.mydomain.com/phpreceiver.php)

In php-file, there’s code below that should save the json-message to file.  
But I only receive an empty file?

----klix-----

\<?php $jsonString = file\_get\_contents("php://input"); $myFile = "testFile.txt"; file\_put\_contents($myFile,$jsonString); ?\>

----klix-----

---

<div class="post-metadata">

### Author: ![otso](https://f.ruuvi.com/user_avatar/f.ruuvi.com/otso/32/1651_2.png) [@otso](https://f.ruuvi.com/u/otso)
#### Post date: [15 May 2020 06:39 UTC](https://f.ruuvi.com/t/receiving-json-message-with-php-gateway/4197/2 "2020-05-15T06:39:16Z")

</div>

Hello,

You can use service such as [hookbin.com](http://hookbin.com) to check that you’re receiving valid data from Ruuvi Station.
