1.1.0-dev.14 • Published 5 years ago

teralytic v1.1.0-dev.14

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

teralytic

teralytic - JavaScript client for teralytic The Teralytic API allows clients to manage their organization, view their fields and and probes, and query sensor readings and analytics. For sandbox testing you may use the api key: swagger.teralytic.io This SDK is automatically generated by the Swagger Codegen project:

  • API version: 1.1.0
  • Package version: 1.1.0-dev.14
  • Build package: io.swagger.codegen.languages.JavascriptClientCodegen

Installation

For Node.js

npm

To publish the library as a npm, please follow the procedure in "Publishing npm packages".

Then install it via:

npm install teralytic --save
Local development

To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing package.json (and this README). Let's call this JAVASCRIPT_CLIENT_DIR. Then run:

npm install

Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:

npm link

Finally, switch to the directory you want to use your teralytic from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

You should now be able to require('teralytic') in javascript files from the directory you ran the last command above from.

git

If the library is hosted at a git repository, e.g. https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:

    npm install GIT_USER_ID/GIT_REPO_ID --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file, that's to say your javascript file where you actually use this library):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Getting Started

Please follow the installation instruction and execute the following JS code:

var teralytic = require('teralytic');

var defaultClient = teralytic.ApiClient.instance;

// Configure API key authorization: ApiKeyAuth
var ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix['x-api-key'] = "Token"

// Configure OAuth2 access token for authorization: OAuth2
var OAuth2 = defaultClient.authentications['OAuth2'];
OAuth2.accessToken = "YOUR ACCESS TOKEN"

var api = new teralytic.OrganizationApi()

var organizationId = "organizationId_example"; // {String} id of Organization for the operation

var opts = { 
  'application': new teralytic.Application() // {Application} The application to create
};
api.applicationCreate(organizationId, opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Documentation for API Endpoints

All URIs are relative to https://api.teralytic.io/v1

ClassMethodHTTP requestDescription
teralytic.OrganizationApiapplicationCreatePOST /organizations/{organization_id}/applicationsCreate a new organization client with the specified scope
teralytic.OrganizationApiapplicationDeleteDELETE /organizations/{organization_id}/applications/{application_id}Delete an application api client
teralytic.OrganizationApiapplicationListGET /organizations/{organization_id}/applicationsGet organization applications
teralytic.OrganizationApifieldGetGET /organizations/{organization_id}/fields/{field_id}List single Field details associated with Field id provided (from set of Fields associated with the organization)
teralytic.OrganizationApifieldListGET /organizations/{organization_id}/fieldsList all Fields associated with an organization
teralytic.OrganizationApiorganizationGetGET /organizations/{organization_id}Get a specific organization
teralytic.OrganizationApiorganizationListGET /organizationsList all Organizations
teralytic.OrganizationApiprobeGetGET /organizations/{organization_id}/probes/{probe_id}List single Probe details associated with Probe id provided (from set of Fields associated with the account key)
teralytic.OrganizationApiprobeListGET /organizations/{organization_id}/probesList all Probes associated with an organization
teralytic.SoilsApiqueryGET /soilsQuery the soildb
teralytic.TelemetryApianalyticsQueryGET /organizations/{organization_id}/analyticsQuery reading anlaytics
teralytic.TelemetryApireadingsQueryGET /organizations/{organization_id}/readingsQuery sensor readings

Documentation for Models

Documentation for Authorization

ApiKeyAuth

  • Type: API key
  • API key parameter name: x-api-key
  • Location: HTTP header

OAuth2

1.1.0-dev.14

5 years ago

1.1.0-dev.13

5 years ago

1.1.0-dev.12

5 years ago

1.1.0-dev.5

5 years ago

1.0.6-1

5 years ago

1.0.6

5 years ago

1.0.7-beta.0

5 years ago

1.0.6-beta.6

5 years ago

1.0.6-beta.5

5 years ago

1.0.6-beta.4

5 years ago

1.0.6-beta.3

5 years ago

1.0.6-1.beta

5 years ago

1.0.1-30

6 years ago

1.0.1-29

6 years ago

1.0.1-28

6 years ago

1.0.1-26

6 years ago