SensorPush Public API
Project description
sensorpush-api
This is a swagger definition for the SensorPush public REST API. Download the definition file here.
This Python package is automatically generated by the Swagger Codegen project:
- API version: v1.0.20240629
- Package version: 1.0.0
- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen
Requirements.
Python 2.7 and 3.4+
Installation & Usage
pip install
If the python package is hosted on Github, you can install directly from Github
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
(you may need to run pip
with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
)
Then import the package:
import sensorpush_api
Setuptools
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install
to install the package for all users)
Then import the package:
import sensorpush_api
Getting Started
Please follow the installation procedure and then run the following:
from __future__ import print_function
import time
import sensorpush_api
from sensorpush_api.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = sensorpush_api.ApiApi(sensorpush_api.ApiClient(configuration))
body = sensorpush_api.AccessTokenRequest() # AccessTokenRequest |
try:
# Request a temporary oAuth access code.
api_response = api_instance.access_token(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ApiApi->access_token: %s\n" % e)
# Configure API key authorization: oauth
configuration = sensorpush_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = sensorpush_api.ApiApi(sensorpush_api.ApiClient(configuration))
body = sensorpush_api.ReportsRequest() # ReportsRequest |
try:
# Download bulk reports.
api_instance.download(body)
except ApiException as e:
print("Exception when calling ApiApi->download: %s\n" % e)
# Configure API key authorization: oauth
configuration = sensorpush_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = sensorpush_api.ApiApi(sensorpush_api.ApiClient(configuration))
body = sensorpush_api.GatewaysRequest() # GatewaysRequest |
try:
# Lists all gateways.
api_response = api_instance.gateways(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ApiApi->gateways: %s\n" % e)
# Configure API key authorization: oauth
configuration = sensorpush_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = sensorpush_api.ApiApi(sensorpush_api.ApiClient(configuration))
body = sensorpush_api.ReportsRequest() # ReportsRequest |
try:
# Lists reports available for download.
api_response = api_instance.list(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ApiApi->list: %s\n" % e)
# create an instance of the API class
api_instance = sensorpush_api.ApiApi(sensorpush_api.ApiClient(configuration))
body = sensorpush_api.AuthorizeRequest() # AuthorizeRequest |
try:
# Sign in and request an authorization code
api_response = api_instance.oauth_authorize_post(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ApiApi->oauth_authorize_post: %s\n" % e)
# create an instance of the API class
api_instance = sensorpush_api.ApiApi(sensorpush_api.ApiClient(configuration))
try:
# SensorPush API status
api_response = api_instance.root_post()
pprint(api_response)
except ApiException as e:
print("Exception when calling ApiApi->root_post: %s\n" % e)
# Configure API key authorization: oauth
configuration = sensorpush_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = sensorpush_api.ApiApi(sensorpush_api.ApiClient(configuration))
body = sensorpush_api.SamplesRequest() # SamplesRequest |
try:
# Queries for sensor samples.
api_response = api_instance.samples(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ApiApi->samples: %s\n" % e)
# Configure API key authorization: oauth
configuration = sensorpush_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = sensorpush_api.ApiApi(sensorpush_api.ApiClient(configuration))
body = sensorpush_api.SensorsRequest() # SensorsRequest |
try:
# Lists all sensors.
api_response = api_instance.sensors(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ApiApi->sensors: %s\n" % e)
# Configure API key authorization: oauth
configuration = sensorpush_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = sensorpush_api.ApiApi(sensorpush_api.ApiClient(configuration))
body = sensorpush_api.TagsRequest() # TagsRequest |
try:
# Updates tags on devices.
api_response = api_instance.tags_response(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ApiApi->tags_response: %s\n" % e)
# create an instance of the API class
api_instance = sensorpush_api.ApiApi(sensorpush_api.ApiClient(configuration))
body = sensorpush_api.TokenRequest() # TokenRequest |
try:
# oAuth 2.0 for authorization, access, and refresh tokens
api_response = api_instance.token(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ApiApi->token: %s\n" % e)
Documentation for API Endpoints
All URIs are relative to https://api.sensorpush.com/api/v1
Class | Method | HTTP request | Description |
---|---|---|---|
ApiApi | access_token | POST /oauth/accesstoken | Request a temporary oAuth access code. |
ApiApi | download | POST /reports/download | Download bulk reports. |
ApiApi | gateways | POST /devices/gateways | Lists all gateways. |
ApiApi | list | POST /reports/list | Lists reports available for download. |
ApiApi | oauth_authorize_post | POST /oauth/authorize | Sign in and request an authorization code |
ApiApi | root_post | POST / | SensorPush API status |
ApiApi | samples | POST /samples | Queries for sensor samples. |
ApiApi | sensors | POST /devices/sensors | Lists all sensors. |
ApiApi | tags_response | POST /tags | Updates tags on devices. |
ApiApi | token | POST /oauth/token | oAuth 2.0 for authorization, access, and refresh tokens |
Documentation For Models
- AccessTokenRequest
- AccessTokenResponse
- AuthorizeRequest
- AuthorizeResponse
- Error
- Gateway
- Gateways
- GatewaysRequest
- ListResponse
- ReportListing
- ReportsRequest
- Sample
- Samples
- SamplesRequest
- Sensor
- SensorAlerts
- SensorAlertsHumidity
- SensorAlertsTemperature
- SensorCalibration
- Sensors
- SensorsRequest
- Status
- Tags
- TagsRequest
- TagsResponse
- TokenRequest
- TokenResponse
Documentation For Authorization
oauth
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header
Author
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for sensorpush_api-1.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb9a7f117ce9504cd14c89faf4d45b51d1c2523c1974641405a9c76795408e14 |
|
MD5 | 167656dd2d04daa7ed7820366b121cac |
|
BLAKE2b-256 | 60a73dfe6427f6e0540f77ca33661c0237123c19ea98fdb44514dc91d5710b8d |