# SmartCover API with Ignition

**URL:** <https://forum.inductiveautomation.com/t/smartcover-api-with-ignition/68064>\
**Category:** Ignition\
**Created:** [December 29, 2022, 1:17pm UTC](https://forum.inductiveautomation.com/t/smartcover-api-with-ignition/68064 "2022-12-29T13:17:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nruimveld](https://avatars.discourse-cdn.com/v4/letter/n/8797f3/32.png) [@nruimveld](https://forum.inductiveautomation.com/u/nruimveld)\
**Post date:** [December 29, 2022, 1:17pm UTC](https://forum.inductiveautomation.com/t/smartcover-api-with-ignition/68064/1 "2022-12-29T13:17:09Z")

</div>

Has anyone done API integration between SmartCover and Ignition? Any info would be greatly appreciated. Thank you!

---

<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:** [December 29, 2022, 1:38pm UTC](https://forum.inductiveautomation.com/t/smartcover-api-with-ignition/68064/2 "2022-12-29T13:38:49Z")

</div>

Never heard of them. Links?

---

<div class="post-metadata">

**Author:** ![nruimveld](https://avatars.discourse-cdn.com/v4/letter/n/8797f3/32.png) [@nruimveld](https://forum.inductiveautomation.com/u/nruimveld)\
**Post date:** [December 29, 2022, 1:41pm UTC](https://forum.inductiveautomation.com/t/smartcover-api-with-ignition/68064/3 "2022-12-29T13:41:22Z")

</div>

> **[Welcome | SmartCover Systems](https://smartcoversystems.com)**
>
> SmartCover Systems offers cost effective satellite manhole monitoring solutions to eliminate sewer overflows, optimize collection system cleaning, minimize odorous H2S gas, and accurately identify inflow and infiltration (I & I).

[25014SD REV D API Documentation.pdf](https://forum.inductiveautomation.com/uploads/short-url/ttVxyqK3lGfwBwAfjpl4Tg91lxP.pdf) (373.7 KB)

---

<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:** [December 29, 2022, 1:48pm UTC](https://forum.inductiveautomation.com/t/smartcover-api-with-ignition/68064/4 "2022-12-29T13:48:04Z")

</div>

They have an API, so Ignition can talk to it with scripted `system.net.httpClient()`.

---

<div class="post-metadata">

**Author:** ![YF129701](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/yf129701/32/60498_2.png) [@YF129701](https://forum.inductiveautomation.com/u/YF129701)\
**Post date:** [December 29, 2022, 3:55pm UTC](https://forum.inductiveautomation.com/t/smartcover-api-with-ignition/68064/5 "2022-12-29T15:55:09Z")

</div>

Looks very doable - they even have a Python example in the docs:

```python
import requests
import csv
# variable to store the location id of interest
location_id = 'LOCATION_ID'
# variable to store the JWT token
token = 'TOKEN'
# set the authorization header
headers = {'Authorization': 'Bearer ' + token}
# set the request parameters
params = {
 'location': location_id,
 'start_time': '2020-07-01 00:00',
 'end_time': '2020-07-10 00:00',
 'data_type': '2' }
# make the GET request
response = requests.get('https://www.mysmartcover.com/api/locations/data.php',
params = params, headers = headers)
# store the response code
response_code = response.json()['response_code']
# store the data from the response
data = response.json()['data'][0]
# write the output to a CSV file
with open('output.csv', mode = 'w') as output_file:
 output_writer = csv.writer(output_file, delimiter = ',')
 output_writer.writerow(['datetime', 'level']) # write the column headers
 for row in data:
 output_writer.writerow(row)

```

In your case, importing the `requests` library will probably be unnecessary because of the built-in `system.net.httpClient`, `system.net.httpGet` and `system.net.httpPost` functions.

If you already have a token, you should be able to do something like this (off the top of my head):

```python
client = system.net.httpClient()
url = "https://www.mysmartcover.com/api/locations/list.php"
headers = {
    "Authorization": "Bearer <YOUR_TOKEN_HERE>"
}
res = client.get(url, headers=headers)

if res.good:
    print res.json

```
