# Getting data from external source with REST

**URL:** <https://forum.inductiveautomation.com/t/getting-data-from-external-source-with-rest/60248>\
**Category:** Ignition\
**Created:** [June 1, 2022, 11:08am UTC](https://forum.inductiveautomation.com/t/getting-data-from-external-source-with-rest/60248 "2022-06-01T11:08:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ivan.ivanov](https://avatars.discourse-cdn.com/v4/letter/i/839c29/32.png) [@ivan.ivanov](https://forum.inductiveautomation.com/u/ivan.ivanov)\
**Post date:** [June 1, 2022, 11:08am UTC](https://forum.inductiveautomation.com/t/getting-data-from-external-source-with-rest/60248/1 "2022-06-01T11:08:38Z")

</div>

Hey all,

It has been some time since I have used Ignition and things have changed.

I am now trying log data from an web platform collecting data from wireless sensors in the field.

The 3rd party system generates the JSON text to get the data for a particular sensor but I am unsure how to integrate the data in Ignition.

Ideally I would like to have it in a tag.

```auto
curl --location --request POST 'https://us-central1-neuron2.cloudfunctions.net/sensorInfo' \
--header 'Content-Type: application/json' \
--data-raw '{ 
	"apiKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
	"sn": "3000568345"
}'

```

Any ideas?

Thanks  
Ivan

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [June 1, 2022, 12:08pm UTC](https://forum.inductiveautomation.com/t/getting-data-from-external-source-with-rest/60248/2 "2022-06-01T12:08:55Z")

</div>

You’ll probably want to use the `httpPost()` system function.  
[system.net.httpPost - Ignition User Manual 8.1 - Ignition Documentation (inductiveautomation.com)](https://docs.inductiveautomation.com/display/DOC81/system.net.httpPost)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [June 1, 2022, 12:17pm UTC](https://forum.inductiveautomation.com/t/getting-data-from-external-source-with-rest/60248/3 "2022-06-01T12:17:44Z")

</div>

Not httpPost. Use httpClient.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [June 1, 2022, 12:28pm UTC](https://forum.inductiveautomation.com/t/getting-data-from-external-source-with-rest/60248/4 "2022-06-01T12:28:00Z")

</div>

Are those your real API key and such ?  
You might want to hide them if that’s the case.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [June 1, 2022, 3:31pm UTC](https://forum.inductiveautomation.com/t/getting-data-from-external-source-with-rest/60248/5 "2022-06-01T15:31:44Z")

</div>

```python
client = system.net.httpClient()
data = {
	"apiKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
	"sn": "3000568345"
}
client.post("https://us-central1-neuron2.cloudfunctions.net/sensorInfo", data=data)

```

This would be an exactly equivalent request to the CURL example above, though POST is probably not the verb I would expect to use to _retrieve_ data.

---

<div class="post-metadata">

**Author:** ![ivan.ivanov](https://avatars.discourse-cdn.com/v4/letter/i/839c29/32.png) [@ivan.ivanov](https://forum.inductiveautomation.com/u/ivan.ivanov)\
**Post date:** [June 2, 2022, 7:10am UTC](https://forum.inductiveautomation.com/t/getting-data-from-external-source-with-rest/60248/6 "2022-06-02T07:10:01Z")

</div>

Paul,

Many thanks!

This worked straight away.

Cheers  
Ivan
