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
For Node.js
To publish the library as a npm, please follow the procedure in "Publishing npm packages".
Then install it via:
npm install teralytic --save
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.
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
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.
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
}
}
]
}
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);
});
All URIs are relative to https://api.teralytic.io/v1
Class | Method | HTTP request | Description |
---|---|---|---|
teralytic.OrganizationApi | applicationCreate | POST /organizations/{organization_id}/applications | Create a new organization client with the specified scope |
teralytic.OrganizationApi | applicationDelete | DELETE /organizations/{organization_id}/applications/{application_id} | Delete an application api client |
teralytic.OrganizationApi | applicationList | GET /organizations/{organization_id}/applications | Get organization applications |
teralytic.OrganizationApi | fieldGet | GET /organizations/{organization_id}/fields/{field_id} | List single Field details associated with Field id provided (from set of Fields associated with the organization) |
teralytic.OrganizationApi | fieldList | GET /organizations/{organization_id}/fields | List all Fields associated with an organization |
teralytic.OrganizationApi | organizationGet | GET /organizations/{organization_id} | Get a specific organization |
teralytic.OrganizationApi | organizationList | GET /organizations | List all Organizations |
teralytic.OrganizationApi | probeGet | GET /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.OrganizationApi | probeList | GET /organizations/{organization_id}/probes | List all Probes associated with an organization |
teralytic.SoilsApi | query | GET /soils | Query the soildb |
teralytic.TelemetryApi | analyticsQuery | GET /organizations/{organization_id}/analytics | Query reading anlaytics |
teralytic.TelemetryApi | readingsQuery | GET /organizations/{organization_id}/readings | Query sensor readings |
- teralytic.Application
- teralytic.Error
- teralytic.Error2
- teralytic.Feature
- teralytic.FeatureCollection
- teralytic.FeatureType
- teralytic.Field
- teralytic.FieldGeometry
- teralytic.FieldGeometryGeometry
- teralytic.Geometry
- teralytic.GeometryType
- teralytic.OrgRole
- teralytic.Organization
- teralytic.Probe
- teralytic.PropertyRole
- teralytic.Reading
- teralytic.ReadingData
- teralytic.ReadingLocation
- teralytic.ReadingType
- teralytic.RolePermission
- teralytic.StringArray
- teralytic.UUIDArray
- teralytic.User
- teralytic.MicroClimateData
- teralytic.SensorData
- teralytic.WeatherData
- Type: API key
- API key parameter name: x-api-key
- Location: HTTP header
- Type: OAuth
- Flow: application
- Authorization URL:
-
Scopes:
- https://api.teralytic.io/organization.read: Read organization properties
- https://api.teralytic.io/organization.write: Write organization properties
- https://api.teralytic.io/organization.admin: Administer organization properties
- https://api.teralytic.io/reading.read: Query readings and analyics
- https://api.teralytic.io/soils.read: Query soil component data