Git Product home page Git Product logo

sensorpush-api's Introduction

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

Documentation For Authorization

oauth

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Author

[email protected]

sensorpush-api's People

Contributors

sstallion avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.