NAV Navbar
Shell http Python Java NodeJS go C#

teralytic v1.1.0

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

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

Base URLs:

License: MIT

Authentication

Scope Scope Description
organization.read Read organization properties
organization.write Write organization properties
organization.admin Admin an organization
telemetry.read Query soil telemetry data
telemetry.write Write telemetry data
soil.read Query soil component data
weather.read Query historical weather data

organization

List all Organizations

Code samples

# You can also use wget
curl -X GET /api.teralytic.io/v1/organizations \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}' \
  -H 'x-api-key: API_KEY'

GET /api.teralytic.io/v1/organizations HTTP/1.1

Accept: application/json

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}',
  'x-api-key': 'API_KEY'
}

r = requests.get('/api.teralytic.io/v1/organizations', params={

}, headers = headers)

print r.json()

URL obj = new URL("/api.teralytic.io/v1/organizations");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

var headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}',
  'x-api-key':'API_KEY'

};

$.ajax({
  url: '/api.teralytic.io/v1/organizations',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
        "x-api-key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/api.teralytic.io/v1/organizations", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations

Lists all organization, requires admin scope

Example responses

200 Response

[
  {
    "id": "string",
    "name": "string",
    "slug": "string",
    "type": "string"
  }
]

Unauthorized

{
  "message": "access denied"
}

ServerError

{
  "message": "internal server error"
}

Responses

Status Meaning Description Schema
200 OK Success Inline
401 Unauthorized Unauthorized None
500 Internal Server Error ServerError None

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Organization] false none [Organization defines an organization unit in the Teralytic API]
» Organization Organization false none Organization defines an organization unit in the Teralytic API
»» id string(uuid) true none none
»» name string true none none
»» slug string false none none
»» type string\ null false none

Get a specific organization

Code samples

# You can also use wget
curl -X GET /api.teralytic.io/v1/organizations/{organization_id} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}' \
  -H 'x-api-key: API_KEY'

GET /api.teralytic.io/v1/organizations/{organization_id} HTTP/1.1

Accept: application/json

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}',
  'x-api-key': 'API_KEY'
}

r = requests.get('/api.teralytic.io/v1/organizations/{organization_id}', params={

}, headers = headers)

print r.json()

URL obj = new URL("/api.teralytic.io/v1/organizations/{organization_id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

var headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}',
  'x-api-key':'API_KEY'

};

$.ajax({
  url: '/api.teralytic.io/v1/organizations/{organization_id}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
        "x-api-key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/api.teralytic.io/v1/organizations/{organization_id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{organization_id}

List single Organization details associated with Organization id provided

Parameters

Name In Type Required Description
organization_id path string(uuid) true id of Organization to retrieve

Example responses

200 Response

{
  "id": "string",
  "name": "string",
  "slug": "string",
  "type": "string"
}

Unauthorized

{
  "message": "access denied"
}

ResourceNotFound

{
  "message": "object not found"
}

ServerError

{
  "message": "internal server error"
}

Responses

Status Meaning Description Schema
200 OK OK Organization
401 Unauthorized Unauthorized None
404 Not Found ResourceNotFound None
500 Internal Server Error ServerError None

Response Schema

Get organization applications

Code samples

# You can also use wget
curl -X GET /api.teralytic.io/v1/organizations/{organization_id}/applications \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}' \
  -H 'x-api-key: API_KEY'

GET /api.teralytic.io/v1/organizations/{organization_id}/applications HTTP/1.1

Accept: application/json

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}',
  'x-api-key': 'API_KEY'
}

r = requests.get('/api.teralytic.io/v1/organizations/{organization_id}/applications', params={

}, headers = headers)

print r.json()

URL obj = new URL("/api.teralytic.io/v1/organizations/{organization_id}/applications");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

var headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}',
  'x-api-key':'API_KEY'

};

$.ajax({
  url: '/api.teralytic.io/v1/organizations/{organization_id}/applications',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
        "x-api-key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/api.teralytic.io/v1/organizations/{organization_id}/applications", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{organization_id}/applications

List all applications for an organization

Parameters

Name In Type Required Description
organization_id path string(uuid) true id of Organization for the operation

Example responses

200 Response

[
  {
    "id": "string",
    "organization_id": "string",
    "name": "string",
    "client_secret": "string",
    "expires_at": "2019-04-30T18:03:12Z",
    "scope": null
  }
]

Unauthorized

{
  "message": "access denied"
}

ResourceNotFound

{
  "message": "object not found"
}

ServerError

{
  "message": "internal server error"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
401 Unauthorized Unauthorized None
404 Not Found ResourceNotFound None
500 Internal Server Error ServerError None

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Application] false none [Application credentials which provide third-party access to organiaztion data]
» Application Application false none Application credentials which provide third-party access to organiaztion data
»» id string\ null false none
»» organization_id string(uuid) false read-only The organization this application belongs to
»» name string true none The application name
»» client_secret string\ null false none
»» expires_at string(date-time)\ null false none
»» scope any false none none

Create a new organization client with the specified scope

Code samples

# You can also use wget
curl -X POST /api.teralytic.io/v1/organizations/{organization_id}/applications \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}' \
  -H 'x-api-key: API_KEY'

POST /api.teralytic.io/v1/organizations/{organization_id}/applications HTTP/1.1

Content-Type: application/json
Accept: application/json

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}',
  'x-api-key': 'API_KEY'
}

r = requests.post('/api.teralytic.io/v1/organizations/{organization_id}/applications', params={

}, headers = headers)

print r.json()

URL obj = new URL("/api.teralytic.io/v1/organizations/{organization_id}/applications");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}',
  'x-api-key':'API_KEY'

};

$.ajax({
  url: '/api.teralytic.io/v1/organizations/{organization_id}/applications',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
        "x-api-key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/api.teralytic.io/v1/organizations/{organization_id}/applications", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{organization_id}/applications

Create a new third-party application client

Body parameter

{
  "id": "string",
  "name": "string",
  "client_secret": "string",
  "expires_at": "2019-04-30T18:03:12Z",
  "scope": null
}

Parameters

Name In Type Required Description
body body Application false The application to create
organization_id path string(uuid) true id of Organization for the operation

Example responses

201 Response

{
  "id": "string",
  "organization_id": "string",
  "name": "string",
  "client_secret": "string",
  "expires_at": "2019-04-30T18:03:12Z",
  "scope": null
}

BadRequest

{
  "message": "invalid parameter"
}

Unauthorized

{
  "message": "access denied"
}

ResourceNotFound

{
  "message": "object not found"
}

ServerError

{
  "message": "internal server error"
}

Responses

Status Meaning Description Schema
201 Created Created Application
400 Bad Request BadRequest None
401 Unauthorized Unauthorized None
404 Not Found ResourceNotFound None
500 Internal Server Error ServerError None

Response Schema

Delete an application api client

Code samples

# You can also use wget
curl -X DELETE /api.teralytic.io/v1/organizations/{organization_id}/applications/{client_id} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}' \
  -H 'x-api-key: API_KEY'

DELETE /api.teralytic.io/v1/organizations/{organization_id}/applications/{client_id} HTTP/1.1

Accept: application/json

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}',
  'x-api-key': 'API_KEY'
}

r = requests.delete('/api.teralytic.io/v1/organizations/{organization_id}/applications/{client_id}', params={

}, headers = headers)

print r.json()

URL obj = new URL("/api.teralytic.io/v1/organizations/{organization_id}/applications/{client_id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

var headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}',
  'x-api-key':'API_KEY'

};

$.ajax({
  url: '/api.teralytic.io/v1/organizations/{organization_id}/applications/{client_id}',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
        "x-api-key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "/api.teralytic.io/v1/organizations/{organization_id}/applications/{client_id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /organizations/{organization_id}/applications/{client_id}

Delete an application client for the organization from the database

Parameters

Name In Type Required Description
organization_id path string(uuid) true id of Organization for the operation
client_id path string(uuid) true client_id of the application to delete

Example responses

Unauthorized

{
  "message": "access denied"
}

ResourceNotFound

{
  "message": "object not found"
}

ServerError

{
  "message": "internal server error"
}

Responses

Status Meaning Description Schema
204 No Content No Content None
401 Unauthorized Unauthorized None
404 Not Found ResourceNotFound None
500 Internal Server Error ServerError None

Response Schema

List all Fields associated with an organization

Code samples

# You can also use wget
curl -X GET /api.teralytic.io/v1/organizations/{organization_id}/fields \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}' \
  -H 'x-api-key: API_KEY'

GET /api.teralytic.io/v1/organizations/{organization_id}/fields HTTP/1.1

Accept: application/json

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}',
  'x-api-key': 'API_KEY'
}

r = requests.get('/api.teralytic.io/v1/organizations/{organization_id}/fields', params={

}, headers = headers)

print r.json()

URL obj = new URL("/api.teralytic.io/v1/organizations/{organization_id}/fields");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

var headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}',
  'x-api-key':'API_KEY'

};

$.ajax({
  url: '/api.teralytic.io/v1/organizations/{organization_id}/fields',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
        "x-api-key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/api.teralytic.io/v1/organizations/{organization_id}/fields", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{organization_id}/fields

Parameters

Name In Type Required Description
points query array[string] false Array of points (lat,lng) describing a polygon search pattern.
organization_id path string(uuid) true id of Organization to retrieve

Example responses

200 Response

[
  {
    "id": "string",
    "organization_id": "string",
    "name": "string",
    "acreage": 0,
    "crop": "string",
    "geometry": {
      "id": "string",
      "type": "Feature",
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [
              0
            ]
          ]
        ]
      }
    }
  }
]

BadRequest

{
  "message": "invalid parameter"
}

Unauthorized

{
  "message": "access denied"
}

ResourceNotFound

{
  "message": "object not found"
}

ServerError

{
  "message": "internal server error"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
400 Bad Request BadRequest None
401 Unauthorized Unauthorized None
404 Not Found ResourceNotFound None
500 Internal Server Error ServerError None

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Field] false none none
» Field Field false none none
»» id string(uuid) true none none
»» organization_id string(uuid) false none none
»» name string true none none
»» acreage number\ null false none
»» crop string false none none
»» geometry FieldGeometry false none none
»»» id string false none none
»»» type string false none none
»»» geometry object false none none
»»»» type string false none none
»»»» coordinates [array] false none none

Enumerated Values

Property Value
type Feature
type Polygon

List single Field details associated with Field id provided (from set of Fields associated with the organization)

Code samples

# You can also use wget
curl -X GET /api.teralytic.io/v1/organizations/{organization_id}/fields/{field_id} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}' \
  -H 'x-api-key: API_KEY'

GET /api.teralytic.io/v1/organizations/{organization_id}/fields/{field_id} HTTP/1.1

Accept: application/json

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}',
  'x-api-key': 'API_KEY'
}

r = requests.get('/api.teralytic.io/v1/organizations/{organization_id}/fields/{field_id}', params={

}, headers = headers)

print r.json()

URL obj = new URL("/api.teralytic.io/v1/organizations/{organization_id}/fields/{field_id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

var headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}',
  'x-api-key':'API_KEY'

};

$.ajax({
  url: '/api.teralytic.io/v1/organizations/{organization_id}/fields/{field_id}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
        "x-api-key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/api.teralytic.io/v1/organizations/{organization_id}/fields/{field_id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{organization_id}/fields/{field_id}

Parameters

Name In Type Required Description
organization_id path string(uuid) true id of Organization to retrieve
field_id path string(uuid) true id of Field to retrieve

Example responses

200 Response

{
  "id": "string",
  "organization_id": "string",
  "name": "string",
  "acreage": 0,
  "crop": "string",
  "geometry": {
    "id": "string",
    "type": "Feature",
    "geometry": {
      "type": "Polygon",
      "coordinates": [
        [
          [
            0
          ]
        ]
      ]
    }
  }
}

Unauthorized

{
  "message": "access denied"
}

ResourceNotFound

{
  "message": "object not found"
}

ServerError

{
  "message": "internal server error"
}

Responses

Status Meaning Description Schema
200 OK OK Field
401 Unauthorized Unauthorized None
404 Not Found ResourceNotFound None
500 Internal Server Error ServerError None

Response Schema

List all Probes associated with an organization

Code samples

# You can also use wget
curl -X GET /api.teralytic.io/v1/organizations/{organization_id}/probes \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}' \
  -H 'x-api-key: API_KEY'

GET /api.teralytic.io/v1/organizations/{organization_id}/probes HTTP/1.1

Accept: application/json

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}',
  'x-api-key': 'API_KEY'
}

r = requests.get('/api.teralytic.io/v1/organizations/{organization_id}/probes', params={

}, headers = headers)

print r.json()

URL obj = new URL("/api.teralytic.io/v1/organizations/{organization_id}/probes");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

var headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}',
  'x-api-key':'API_KEY'

};

$.ajax({
  url: '/api.teralytic.io/v1/organizations/{organization_id}/probes',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
        "x-api-key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/api.teralytic.io/v1/organizations/{organization_id}/probes", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{organization_id}/probes

Parameters

Name In Type Required Description
fields query array[string] false Fields to filter search on
organization_id path string(uuid) true id of Organization to retrieve

Example responses

200 Response

[
  {
    "id": "string",
    "serial_code": "string",
    "field_id": "string",
    "organization_id": "string",
    "location": null
  }
]

BadRequest

{
  "message": "invalid parameter"
}

Unauthorized

{
  "message": "access denied"
}

ResourceNotFound

{
  "message": "object not found"
}

ServerError

{
  "message": "internal server error"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
400 Bad Request BadRequest None
401 Unauthorized Unauthorized None
404 Not Found ResourceNotFound None
500 Internal Server Error ServerError None

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Probe] false none none
» Probe Probe false none none
»» id string(uuid) false none none
»» serial_code string false none none
»» field_id string(uuid)\ null false none
»» organization_id string(uuid)\ null false none
»» location any false none none

List single Probe details associated with Probe id provided (from set of Fields associated with the account key)

Code samples

# You can also use wget
curl -X GET /api.teralytic.io/v1/organizations/{organization_id}/probes/{probe_id} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}' \
  -H 'x-api-key: API_KEY'

GET /api.teralytic.io/v1/organizations/{organization_id}/probes/{probe_id} HTTP/1.1

Accept: application/json

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}',
  'x-api-key': 'API_KEY'
}

r = requests.get('/api.teralytic.io/v1/organizations/{organization_id}/probes/{probe_id}', params={

}, headers = headers)

print r.json()

URL obj = new URL("/api.teralytic.io/v1/organizations/{organization_id}/probes/{probe_id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

var headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}',
  'x-api-key':'API_KEY'

};

$.ajax({
  url: '/api.teralytic.io/v1/organizations/{organization_id}/probes/{probe_id}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
        "x-api-key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/api.teralytic.io/v1/organizations/{organization_id}/probes/{probe_id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{organization_id}/probes/{probe_id}

Parameters

Name In Type Required Description
organization_id path string(uuid) true id of Organization to retrieve
probe_id path string true id of Probe to retrieve

Example responses

200 Response

{
  "id": "string",
  "serial_code": "string",
  "field_id": "string",
  "organization_id": "string",
  "location": null
}

Unauthorized

{
  "message": "access denied"
}

ResourceNotFound

{
  "message": "object not found"
}

ServerError

{
  "message": "internal server error"
}

Responses

Status Meaning Description Schema
200 OK OK Probe
401 Unauthorized Unauthorized None
404 Not Found ResourceNotFound None
500 Internal Server Error ServerError None

Response Schema

telemetry

Query sensor readings

Code samples

# You can also use wget
curl -X GET /api.teralytic.io/v1/organizations/{organization_id}/readings?start_date=string \
  -H 'Accept: application/csv' \
  -H 'Authorization: Bearer {access-token}' \
  -H 'x-api-key: API_KEY'

GET /api.teralytic.io/v1/organizations/{organization_id}/readings?start_date=string HTTP/1.1

Accept: application/csv

import requests
headers = {
  'Accept': 'application/csv',
  'Authorization': 'Bearer {access-token}',
  'x-api-key': 'API_KEY'
}

r = requests.get('/api.teralytic.io/v1/organizations/{organization_id}/readings', params={
  'start_date': 'string'
}, headers = headers)

print r.json()

URL obj = new URL("/api.teralytic.io/v1/organizations/{organization_id}/readings?start_date=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

var headers = {
  'Accept':'application/csv',
  'Authorization':'Bearer {access-token}',
  'x-api-key':'API_KEY'

};

$.ajax({
  url: '/api.teralytic.io/v1/organizations/{organization_id}/readings',
  method: 'get',
  data: '?start_date=string',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/csv"},
        "Authorization": []string{"Bearer {access-token}"},
        "x-api-key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/api.teralytic.io/v1/organizations/{organization_id}/readings", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{organization_id}/readings

Query sensor readings associated with organization

Parameters

Name In Type Required Description
start_date query string true Start date and time for the query format. Specifying first will return the oldest available data.
end_date query string false End date and time for the query, the implied default is now
fields query array[string] false The fields to return readings for
probes query array[string] false The probes to return readings for
location query string false A bounding geohash of <= 7 bytes or a lat/lng string pair '-40.357589721679 175.60340881347' that will be convert to a geohash with 7 byte precision.
properties query array[string] false The properties to return readings for
extended query boolean false Return extended attributes
options query string false Options for the call
operation query string false The analytics operations to perform
sample_rate query string false The query sample rate
fill query string false The missing value fill method
limit query integer(int) false Limit the number of readings to return per probe, the max is 7 days,
offset query integer(int) false offset into the query to return
profile query string false Specify the calibration profile
sort query string false Specify the sort field for the results.
organization_id path string(uuid) true id of Organization to retrieve

Detailed descriptions

start_date: Start date and time for the query format. Specifying first will return the oldest available data.

Example - 2019-03-15T00:00:00-00:00

end_date: End date and time for the query, the implied default is now

Example - 2019-03-15T00:00:00-00:00

location: A bounding geohash of <= 7 bytes or a lat/lng string pair '-40.357589721679 175.60340881347' that will be convert to a geohash with 7 byte precision.

fill: The missing value fill method

limit: Limit the number of readings to return per probe, the max is 7 days, the default is 24 hours.

offset: offset into the query to return

profile: Specify the calibration profile

sort: Specify the sort field for the results. * ASC - ascending and group by timestamp * DEC - decending and group by timestamp * NONE - sort by full group by tags which effectively results in sorting by organization, field, and location.

Enumerated Values

Parameter Value
operation first
operation last
operation min
operation max
operation mean
operation median
operation stddev
operation derivative
operation difference
fill 0
fill none
fill previous
fill linear
sort ASC
sort DEC
sort NONE

Example responses

200 Response

[
  {
    "organization_id": "string",
    "field_id": "string",
    "probe": {
      "id": "string",
      "serial_code": "string",
      "field_id": "string",
      "organization_id": "string",
      "location": null
    },
    "timestamp": "2019-04-30T18:03:12Z",
    "location": null,
    "irrigation": {
      "schedule": 0,
      "vol_acre_in": 0,
      "vol_acre_cm": 0,
      "gross_in": 0,
      "gross_cm": 0,
      "net_in": 0,
      "net_cm": 0,
      "recommendation": "string",
      "stream": 0,
      "aw_6": 0,
      "aw_18": 0,
      "aw_36": 0,
      "aw_total": 0,
      "fc_6": 0,
      "fc_18": 0,
      "fc_36": 0,
      "pwp_6": 0,
      "pwp_18": 0,
      "pwp_36": 0
    },
    "microclimate": {
      "humidity": 0,
      "lux": 0,
      "temperature": 0,
      "eto": 0
    },
    "readings": [
      {
        "depth": 0,
        "depth_units": "string",
        "terascore": 0,
        "nitrogen": 0,
        "nitrogen_ppm": 0,
        "phosphorus": 0,
        "phosphorus_ppm": 0,
        "potassium": 0,
        "potassium_ppm": 0,
        "ec": 0,
        "o2": 0,
        "pH": 0,
        "co2": 0,
        "awc": 0,
        "moisture": 0,
        "temperature": 0,
        "extended_attributes": {
          "property1": {},
          "property2": {}
        }
      }
    ],
    "profile": "string"
  }
]

BadRequest

{
  "message": "invalid parameter"
}

Unauthorized

{
  "message": "access denied"
}

ResourceNotFound

{
  "message": "object not found"
}

ServerError

{
  "message": "internal server error"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
400 Bad Request BadRequest None
401 Unauthorized Unauthorized None
404 Not Found ResourceNotFound None
500 Internal Server Error ServerError None

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Reading] false none none
» Reading Reading\ null false none
»» organization_id string false none The field id of the probe
»» field_id string false none The field id of the probe
»» probe Probe false none none
»»» id string(uuid) false none none
»»» serial_code string false none none
»»» field_id string(uuid)\ null false none
»»» organization_id string(uuid)\ null false none
»»» location any false none none
»» timestamp string(date-time) false none Time when Reading was measured
»» location any false none none
»» irrigation object false none Irrigation data near probe
»»» schedule integer(int64)\ null false none
»»» vol_acre_in number(float64)\ null false none
»»» vol_acre_cm number(float64)\ null false none
»»» gross_in number(float64)\ null false none
»»» gross_cm number(float64)\ null false none
»»» net_in number(float64)\ null false none
»»» net_cm number(float64) false none Net irrigation in cm3
»»» recommendation string\ null false none
»»» stream number(float64)\ null false none
»»» aw_6 number(float)\ null false none
»»» aw_18 number(float)\ null false none
»»» aw_36 number(float)\ null false none
»»» aw_total number(float)\ null false none
»»» fc_6 number(float)\ null false none
»»» fc_18 number(float)\ null false none
»»» fc_36 number(float)\ null false none
»»» pwp_6 number(float)\ null false none
»»» pwp_18 number(float)\ null false none
»»» pwp_36 number(float)\ null false none
»» microclimate object false none Microclimate data near probe
»»» humidity number(float64)\ null false none
»»» lux number(float64)\ null false none
»»» temperature number(float64)\ null false none
»»» eto number(float64)\ null false none
»» readings [DepthReading] false none probe depth readings
»»» depth integer(int64) false none The depth value
»»» depth_units string false none The depth units (i.e. in, cm)
»»» terascore number(float64)\ null false none
»»» nitrogen number(float64)\ null false none
»»» nitrogen_ppm number(float64)\ null false none
»»» phosphorus number(float64)\ null false none
»»» phosphorus_ppm number(float64)\ null false none
»»» potassium number(float64)\ null false none
»»» potassium_ppm number(float64)\ null false none
»»» ec number(float64)\ null false none
»»» o2 number(float64)\ null false none
»»» pH number(float64)\ null false none
»»» co2 number(float64)\ null false none
»»» awc number(float64)\ null false none
»»» moisture number(float64)\ null false none
»»» temperature number(float64)\ null false none
»»» extended_attributes object false none Additional properties
»»»» additionalProperties object false none none
»»» profile string false none The calibration profile

Response Headers

Status Header Type Format Description
200 X-Result-Length integer int64 none
200 X-Result-End-Date string date-time none

Execute sensor calibrations

Code samples

# You can also use wget
curl -X POST /api.teralytic.io/v1/organizations/{organization_id}/calibrations \
  -H 'Content-Type: multipart/form-data' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}' \
  -H 'x-api-key: API_KEY'

POST /api.teralytic.io/v1/organizations/{organization_id}/calibrations HTTP/1.1

Content-Type: multipart/form-data
Accept: application/json

import requests
headers = {
  'Content-Type': 'multipart/form-data',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}',
  'x-api-key': 'API_KEY'
}

r = requests.post('/api.teralytic.io/v1/organizations/{organization_id}/calibrations', params={

}, headers = headers)

print r.json()

URL obj = new URL("/api.teralytic.io/v1/organizations/{organization_id}/calibrations");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

var headers = {
  'Content-Type':'multipart/form-data',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}',
  'x-api-key':'API_KEY'

};

$.ajax({
  url: '/api.teralytic.io/v1/organizations/{organization_id}/calibrations',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"multipart/form-data"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
        "x-api-key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/api.teralytic.io/v1/organizations/{organization_id}/calibrations", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{organization_id}/calibrations

Execute a calibration script on a set of raw data

Body parameter

profile_name: string
handler: handler
file: string
url: string

Parameters

Name In Type Required Description
start_date query string(date-time) false Start date and time for the query in RFC3339 format, the default is 24h prior
end_date query string(date-time) false End date and time for the query in RFC3339 format, the implied default is now
fields query array[string] false The fields to return readings for
probes query array[string] false The probes to return readings for
properties query array[string] false The properties to return readings for
limit query integer(int) false Limit the number of readings per probe returned.
persist query boolean false publish the results to the timeseries database
log_group query string false Debug log group to log to cloudwatch
body body object false none
» profile_name body string false Specify the calibration profile identifier
» handler body string false The calibration script hander
» file body string(binary) false The profile source document
» url body string false The profile source url
organization_id path string(uuid) true id of Organization to retrieve

Detailed descriptions

start_date: Start date and time for the query in RFC3339 format, the default is 24h prior

end_date: End date and time for the query in RFC3339 format, the implied default is now

limit: Limit the number of readings per probe returned. The default is 24 hours of readings The maximum is 7 days of readings

Example responses

200 Response

[
  {
    "organization_id": "string",
    "field_id": "string",
    "probe": {
      "id": "string",
      "serial_code": "string",
      "field_id": "string",
      "organization_id": "string",
      "location": null
    },
    "timestamp": "2019-04-30T18:03:12Z",
    "location": null,
    "irrigation": {
      "schedule": 0,
      "vol_acre_in": 0,
      "vol_acre_cm": 0,
      "gross_in": 0,
      "gross_cm": 0,
      "net_in": 0,
      "net_cm": 0,
      "recommendation": "string",
      "stream": 0,
      "aw_6": 0,
      "aw_18": 0,
      "aw_36": 0,
      "aw_total": 0,
      "fc_6": 0,
      "fc_18": 0,
      "fc_36": 0,
      "pwp_6": 0,
      "pwp_18": 0,
      "pwp_36": 0
    },
    "microclimate": {
      "humidity": 0,
      "lux": 0,
      "temperature": 0,
      "eto": 0
    },
    "readings": [
      {
        "depth": 0,
        "depth_units": "string",
        "terascore": 0,
        "nitrogen": 0,
        "nitrogen_ppm": 0,
        "phosphorus": 0,
        "phosphorus_ppm": 0,
        "potassium": 0,
        "potassium_ppm": 0,
        "ec": 0,
        "o2": 0,
        "pH": 0,
        "co2": 0,
        "awc": 0,
        "moisture": 0,
        "temperature": 0,
        "extended_attributes": {
          "property1": {},
          "property2": {}
        }
      }
    ],
    "profile": "string"
  }
]

BadRequest

{
  "message": "invalid parameter"
}

Unauthorized

{
  "message": "access denied"
}

ResourceNotFound

{
  "message": "object not found"
}

ServerError

{
  "message": "internal server error"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
400 Bad Request BadRequest None
401 Unauthorized Unauthorized None
404 Not Found ResourceNotFound None
500 Internal Server Error ServerError None

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [Reading] false none none
» Reading Reading\ null false none
»» organization_id string false none The field id of the probe
»» field_id string false none The field id of the probe
»» probe Probe false none none
»»» id string(uuid) false none none
»»» serial_code string false none none
»»» field_id string(uuid)\ null false none
»»» organization_id string(uuid)\ null false none
»»» location any false none none
»» timestamp string(date-time) false none Time when Reading was measured
»» location any false none none
»» irrigation object false none Irrigation data near probe
»»» schedule integer(int64)\ null false none
»»» vol_acre_in number(float64)\ null false none
»»» vol_acre_cm number(float64)\ null false none
»»» gross_in number(float64)\ null false none
»»» gross_cm number(float64)\ null false none
»»» net_in number(float64)\ null false none
»»» net_cm number(float64) false none Net irrigation in cm3
»»» recommendation string\ null false none
»»» stream number(float64)\ null false none
»»» aw_6 number(float)\ null false none
»»» aw_18 number(float)\ null false none
»»» aw_36 number(float)\ null false none
»»» aw_total number(float)\ null false none
»»» fc_6 number(float)\ null false none
»»» fc_18 number(float)\ null false none
»»» fc_36 number(float)\ null false none
»»» pwp_6 number(float)\ null false none
»»» pwp_18 number(float)\ null false none
»»» pwp_36 number(float)\ null false none
»» microclimate object false none Microclimate data near probe
»»» humidity number(float64)\ null false none
»»» lux number(float64)\ null false none
»»» temperature number(float64)\ null false none
»»» eto number(float64)\ null false none
»» readings [DepthReading] false none probe depth readings
»»» depth integer(int64) false none The depth value
»»» depth_units string false none The depth units (i.e. in, cm)
»»» terascore number(float64)\ null false none
»»» nitrogen number(float64)\ null false none
»»» nitrogen_ppm number(float64)\ null false none
»»» phosphorus number(float64)\ null false none
»»» phosphorus_ppm number(float64)\ null false none
»»» potassium number(float64)\ null false none
»»» potassium_ppm number(float64)\ null false none
»»» ec number(float64)\ null false none
»»» o2 number(float64)\ null false none
»»» pH number(float64)\ null false none
»»» co2 number(float64)\ null false none
»»» awc number(float64)\ null false none
»»» moisture number(float64)\ null false none
»»» temperature number(float64)\ null false none
»»» extended_attributes object false none Additional properties
»»»» additionalProperties object false none none
»»» profile string false none The calibration profile

weather

Get historical weather data

Code samples

# You can also use wget
curl -X GET /api.teralytic.io/v1/weather \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}' \
  -H 'x-api-key: API_KEY'

GET /api.teralytic.io/v1/weather HTTP/1.1

Accept: application/json

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}',
  'x-api-key': 'API_KEY'
}

r = requests.get('/api.teralytic.io/v1/weather', params={

}, headers = headers)

print r.json()

URL obj = new URL("/api.teralytic.io/v1/weather");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

var headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}',
  'x-api-key':'API_KEY'

};

$.ajax({
  url: '/api.teralytic.io/v1/weather',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
        "x-api-key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/api.teralytic.io/v1/weather", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /weather

Query the weather data for the location

Parameters

Name In Type Required Description
start_date query string(date-time) false Start date and time for the query in RFC3339 format, the default is 24h prior
end_date query string(date-time) false End date and time for the query in RFC3339 format, the implied default is now
operation query string false analytics or selection method
sample_rate query string false The query sample rate
location query string false A bounding geohash of <= 5 bytes or a lat/lng string pair '-40.357589721679 175.60340881347' that will be convert to a geohash with 5 byte precision.
limit query integer(int) false Limit the number of readings per probe returned.

Detailed descriptions

start_date: Start date and time for the query in RFC3339 format, the default is 24h prior

end_date: End date and time for the query in RFC3339 format, the implied default is now

location: A bounding geohash of <= 5 bytes or a lat/lng string pair '-40.357589721679 175.60340881347' that will be convert to a geohash with 5 byte precision.

limit: Limit the number of readings per probe returned. The default is 24 hours of readings The maximum is 7 days of readings

Example responses

200 Response

[
  {
    "summary": "Mostly Cloudy",
    "precip_type": "string",
    "apparent_temp": 0,
    "cloud_cover": 0,
    "dew_point": 0,
    "humidity": 0,
    "ozone": 0,
    "precip_intensity": 0,
    "precip_probability": 0,
    "pressure": 0,
    "temperature": 0,
    "time": "2019-04-30T18:03:12Z",
    "location": null,
    "uv_index": 0,
    "wind_bearing": 0,
    "wind_gust": 0,
    "wind_speed": 0,
    "visibility": 0
  }
]

BadRequest

{
  "message": "invalid parameter"
}

Unauthorized

{
  "message": "access denied"
}

ResourceNotFound

{
  "message": "object not found"
}

ServerError

{
  "message": "internal server error"
}

Responses

Status Meaning Description Schema
200 OK OK Inline
400 Bad Request BadRequest None
401 Unauthorized Unauthorized None
404 Not Found ResourceNotFound None
500 Internal Server Error ServerError None

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [WeatherData] false none [Current weather data from DarkSky]
» summary string\ null false none
» precip_type string\ null false none
» apparent_temp number(float64)\ null false none
» cloud_cover number(float64)\ null false none
» dew_point number(float64)\ null false none
» humidity number(float64)\ null false none
» ozone number(float64)\ null false none
» precip_intensity number(float64)\ null false none
» precip_probability number(float64)\ null false none
» pressure number(float64)\ null false none
» temperature number(float64)\ null false none
» time string(date-time)\ null false none
» location any false none none
» uv_index integer\ null false none
» wind_bearing integer\ null false none
» wind_gust number(float64)\ null false none
» wind_speed number(float64)\ null false none
» visibility number(float64)\ null false none

Response Headers

Status Header Type Format Description
200 X-Next-Start-Date string date-time The next start date to use, if less than request end this should be used to paginate results
200 X-Result-Length integer int64 The length of the result array returned

soil

Query the soildb

Code samples

# You can also use wget
curl -X GET /api.teralytic.io/v1/soil?geometry=string \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}' \
  -H 'x-api-key: API_KEY'

GET /api.teralytic.io/v1/soil?geometry=string HTTP/1.1

Accept: application/json

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}',
  'x-api-key': 'API_KEY'
}

r = requests.get('/api.teralytic.io/v1/soil', params={
  'geometry': 'string'
}, headers = headers)

print r.json()

URL obj = new URL("/api.teralytic.io/v1/soil?geometry=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

var headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}',
  'x-api-key':'API_KEY'

};

$.ajax({
  url: '/api.teralytic.io/v1/soil',
  method: 'get',
  data: '?geometry=string',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
        "x-api-key": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/api.teralytic.io/v1/soil", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /soil

Query the soildb using various parameters

Parameters

Name In Type Required Description
geometry query string true The geometry to query
component query string false Filter on component values
component_fields query array[string] false The component fields to return, '*' will return all columns, "None" will return return an empty object. Default value is '*'
component_aggregation query string false Component aggregation method: * highest_percentage - return a single component representing the highest percentage of the parent map unit
horizon query string false Filter on horizons
horizon_fields query array[string] false The horizon fields to return, '*' will return all columns, "None" will return return an empty object. Default value is '*'
horizon_depth query integer false Horizon depth to filter on
filter query string false the named filter to use
geo_tolerance query integer(int) false Geometry simplification tolerance this will be inverted to 10^(10-value). A tolerance of zero can return very large (1000+ point) geometries. Use smaller tolerance with caution.

Detailed descriptions

component_aggregation: Component aggregation method: * highest_percentage - return a single component representing the highest percentage of the parent map unit

geo_tolerance: Geometry simplification tolerance this will be inverted to 10^(10-value). A tolerance of zero can return very large (1000+ point) geometries. Use smaller tolerance with caution.

Enumerated Values

Parameter Value
component_aggregation highest_percentage

Example responses

Server Error

{
  "message": "Internal server error"
}

Responses

Status Meaning Description Schema
200 OK OK None
500 Internal Server Error Server Error None

Response Schema

Schemas

Organization

{
  "id": "string",
  "name": "string",
  "slug": "string",
  "type": "string"
}

Organization

Properties

Name Type Required Restrictions Description
id string(uuid) true none none
name string true none none
slug string false none none
type string\ null false none

Application

{
  "id": "string",
  "organization_id": "string",
  "name": "string",
  "client_secret": "string",
  "expires_at": "2019-04-30T18:03:12Z",
  "scope": null
}

Application

Properties

Name Type Required Restrictions Description
id string\ null false none
organization_id string(uuid) false read-only The organization this application belongs to
name string true none The application name
client_secret string\ null false none
expires_at string(date-time)\ null false none
scope https://api.swaggerhub.com/domains/ModelRocket/common/1.4.0/#/definitions/StringArray false none none

Field

{
  "id": "string",
  "organization_id": "string",
  "name": "string",
  "acreage": 0,
  "crop": "string",
  "geometry": {
    "id": "string",
    "type": "Feature",
    "geometry": {
      "type": "Polygon",
      "coordinates": [
        [
          [
            0
          ]
        ]
      ]
    }
  }
}

Field

Properties

Name Type Required Restrictions Description
id string(uuid) true none none
organization_id string(uuid) false none none
name string true none none
acreage number\ null false none
crop string false none none
geometry FieldGeometry false none none

FieldGeometry

{
  "id": "string",
  "type": "Feature",
  "geometry": {
    "type": "Polygon",
    "coordinates": [
      [
        [
          0
        ]
      ]
    ]
  }
}

FieldGeometry

Properties

Name Type Required Restrictions Description
id string false none none
type string false none none
geometry object false none none
» type string false none none
» coordinates [array] false none none

Enumerated Values

Property Value
type Feature
type Polygon

Probe

{
  "id": "string",
  "serial_code": "string",
  "field_id": "string",
  "organization_id": "string",
  "location": null
}

Probe

Properties

Name Type Required Restrictions Description
id string(uuid) false none none
serial_code string false none none
field_id string(uuid)\ null false none
organization_id string(uuid)\ null false none
location https://api.swaggerhub.com/domains/ModelRocket/Geometry/1.0.0/#/definitions/Location false none none

Reading

{
  "organization_id": "string",
  "field_id": "string",
  "probe": {
    "id": "string",
    "serial_code": "string",
    "field_id": "string",
    "organization_id": "string",
    "location": null
  },
  "timestamp": "2019-04-30T18:03:12Z",
  "location": null,
  "irrigation": {
    "schedule": 0,
    "vol_acre_in": 0,
    "vol_acre_cm": 0,
    "gross_in": 0,
    "gross_cm": 0,
    "net_in": 0,
    "net_cm": 0,
    "recommendation": "string",
    "stream": 0,
    "aw_6": 0,
    "aw_18": 0,
    "aw_36": 0,
    "aw_total": 0,
    "fc_6": 0,
    "fc_18": 0,
    "fc_36": 0,
    "pwp_6": 0,
    "pwp_18": 0,
    "pwp_36": 0
  },
  "microclimate": {
    "humidity": 0,
    "lux": 0,
    "temperature": 0,
    "eto": 0
  },
  "readings": [
    {
      "depth": 0,
      "depth_units": "string",
      "terascore": 0,
      "nitrogen": 0,
      "nitrogen_ppm": 0,
      "phosphorus": 0,
      "phosphorus_ppm": 0,
      "potassium": 0,
      "potassium_ppm": 0,
      "ec": 0,
      "o2": 0,
      "pH": 0,
      "co2": 0,
      "awc": 0,
      "moisture": 0,
      "temperature": 0,
      "extended_attributes": {
        "property1": {},
        "property2": {}
      }
    }
  ],
  "profile": "string"
}

Reading

Properties

Name Type Required Restrictions Description
organization_id string false none The field id of the probe
field_id string false none The field id of the probe
probe Probe false none none
timestamp string(date-time) false none Time when Reading was measured
location https://api.swaggerhub.com/domains/ModelRocket/Geometry/1.0.0/#/definitions/Feature false none none
irrigation IrrigationData false none Irrigation data near probe
microclimate MicroClimate false none Microclimate data near probe
readings [DepthReading] false none probe depth readings
profile string false none The calibration profile

DepthReading

{
  "depth": 0,
  "depth_units": "string",
  "terascore": 0,
  "nitrogen": 0,
  "nitrogen_ppm": 0,
  "phosphorus": 0,
  "phosphorus_ppm": 0,
  "potassium": 0,
  "potassium_ppm": 0,
  "ec": 0,
  "o2": 0,
  "pH": 0,
  "co2": 0,
  "awc": 0,
  "moisture": 0,
  "temperature": 0,
  "extended_attributes": {
    "property1": {},
    "property2": {}
  }
}

Teralytic probe depth reading

Properties

Name Type Required Restrictions Description
depth integer(int64) false none The depth value
depth_units string false none The depth units (i.e. in, cm)
terascore number(float64)\ null false none
nitrogen number(float64)\ null false none
nitrogen_ppm number(float64)\ null false none
phosphorus number(float64)\ null false none
phosphorus_ppm number(float64)\ null false none
potassium number(float64)\ null false none
potassium_ppm number(float64)\ null false none
ec number(float64)\ null false none
o2 number(float64)\ null false none
pH number(float64)\ null false none
co2 number(float64)\ null false none
awc number(float64)\ null false none
moisture number(float64)\ null false none
temperature number(float64)\ null false none
extended_attributes object false none Additional properties
» additionalProperties object false none none

MicroClimate

{
  "humidity": 0,
  "lux": 0,
  "temperature": 0,
  "eto": 0
}

Microclimate data near probe

Properties

Name Type Required Restrictions Description
humidity number(float64)\ null false none
lux number(float64)\ null false none
temperature number(float64)\ null false none
eto number(float64)\ null false none

IrrigationData

{
  "schedule": 0,
  "vol_acre_in": 0,
  "vol_acre_cm": 0,
  "gross_in": 0,
  "gross_cm": 0,
  "net_in": 0,
  "net_cm": 0,
  "recommendation": "string",
  "stream": 0,
  "aw_6": 0,
  "aw_18": 0,
  "aw_36": 0,
  "aw_total": 0,
  "fc_6": 0,
  "fc_18": 0,
  "fc_36": 0,
  "pwp_6": 0,
  "pwp_18": 0,
  "pwp_36": 0
}

Irrigation data near probe

Properties

Name Type Required Restrictions Description
schedule integer(int64)\ null false none
vol_acre_in number(float64)\ null false none
vol_acre_cm number(float64)\ null false none
gross_in number(float64)\ null false none
gross_cm number(float64)\ null false none
net_in number(float64)\ null false none
net_cm number(float64) false none Net irrigation in cm3
recommendation string\ null false none
stream number(float64)\ null false none
aw_6 number(float)\ null false none
aw_18 number(float)\ null false none
aw_36 number(float)\ null false none
aw_total number(float)\ null false none
fc_6 number(float)\ null false none
fc_18 number(float)\ null false none
fc_36 number(float)\ null false none
pwp_6 number(float)\ null false none
pwp_18 number(float)\ null false none
pwp_36 number(float)\ null false none

WeatherData

{
  "summary": "Mostly Cloudy",
  "precip_type": "string",
  "apparent_temp": 0,
  "cloud_cover": 0,
  "dew_point": 0,
  "humidity": 0,
  "ozone": 0,
  "precip_intensity": 0,
  "precip_probability": 0,
  "pressure": 0,
  "temperature": 0,
  "time": "2019-04-30T18:03:12Z",
  "location": null,
  "uv_index": 0,
  "wind_bearing": 0,
  "wind_gust": 0,
  "wind_speed": 0,
  "visibility": 0
}

Current weather data from DarkSky

Properties

Name Type Required Restrictions Description
summary string\ null false none
precip_type string\ null false none
apparent_temp number(float64)\ null false none
cloud_cover number(float64)\ null false none
dew_point number(float64)\ null false none
humidity number(float64)\ null false none
ozone number(float64)\ null false none
precip_intensity number(float64)\ null false none
precip_probability number(float64)\ null false none
pressure number(float64)\ null false none
temperature number(float64)\ null false none
time string(date-time)\ null false none
location https://api.swaggerhub.com/domains/ModelRocket/Geometry/1.0.0/#/definitions/Location false none none
uv_index integer\ null false none
wind_bearing integer\ null false none
wind_gust number(float64)\ null false none
wind_speed number(float64)\ null false none
visibility number(float64)\ null false none

User

{
  "id": "string",
  "organizations": null,
  "first_name": "string",
  "last_name": "string",
  "email": "user@example.com",
  "email_verified": true,
  "username": "string",
  "org_roles": [
    {
      "id": "string",
      "user_id": "string",
      "organization_id": "string",
      "permission_ids": null,
      "permissions": [
        {
          "id": "string",
          "domain": "property",
          "action": "export_data"
        }
      ],
      "owner": true
    }
  ],
  "property_roles": [
    {
      "id": "string",
      "user_id": "string",
      "property_id": "string",
      "permission_ids": null,
      "permissions": [
        {
          "id": "string",
          "domain": "property",
          "action": "export_data"
        }
      ]
    }
  ]
}

A platform user

Properties

Name Type Required Restrictions Description
id string(uuid) false none The users uuid
organizations https://api.swaggerhub.com/domains/ModelRocket/common/1.4.0/#/definitions/UUIDArray false none none
first_name string false none The user's first name
last_name string false none The user's last name
email string(email) false none The user's email address
email_verified boolean false none Set if the user's email address is verified
username string false none The users login name
org_roles [OrgRole] false none [Organization role mapping]
property_roles [PropertyRole] false none [Property role mapping]

RolePermission

{
  "id": "string",
  "domain": "property",
  "action": "export_data"
}

User role permission

Properties

Name Type Required Restrictions Description
id string(uuid) false none The role id
domain string false none The role domain
action string false none The role action

Enumerated Values

Property Value
domain property
domain org
action export_data
action manage_property
action manage_properties
action manage_team
action manage_orders

OrgRole

{
  "id": "string",
  "user_id": "string",
  "organization_id": "string",
  "permission_ids": null,
  "permissions": [
    {
      "id": "string",
      "domain": "property",
      "action": "export_data"
    }
  ],
  "owner": true
}

Organization role mapping

Properties

Name Type Required Restrictions Description
id string(uuid) false none Role id
user_id string(uuid) false none The user id
organization_id string(uuid) false none The organization id
permission_ids https://api.swaggerhub.com/domains/ModelRocket/common/1.4.0/#/definitions/UUIDArray false none none
permissions [RolePermission] false none [User role permission]
owner boolean false none Flag is the user role is an owner

PropertyRole

{
  "id": "string",
  "user_id": "string",
  "property_id": "string",
  "permission_ids": null,
  "permissions": [
    {
      "id": "string",
      "domain": "property",
      "action": "export_data"
    }
  ]
}

Property role mapping

Properties

Name Type Required Restrictions Description
id string(uuid) false none Role id
user_id string(uuid) false none The user id
property_id string(uuid) false none The property id
permission_ids https://api.swaggerhub.com/domains/ModelRocket/common/1.4.0/#/definitions/UUIDArray false none none
permissions [RolePermission] false none [User role permission]

Client Libraries

The Teralytic API is available for a number of different platforms, prepackaged for convenience. However, since it is a REST API, any simple HTTP client can interface with the API.

#Library not available.
<!--Library not available-->
// Library not available.
> npm install --save teralytic
> mvn install
> pip install teralytic
> Install-Package IO.Teralytic

Javascript (npm)

NPM Package.

Public Repository

Python (pip)

The python client is compatible with python 2.7+ and python 3.3+.

PyPi Package

Public Repository

Java (maven)

Follow the detailed instructions found here to install the local mvn repository.

.NET (nuget)

The recommended method for installing the .NET dependecies is to use the nuget utility. This can be found here.

MacOS/iOS (CocoaPod)

To install the obj-c client using CocoaPods add the following to your Podfile:

OAuth 2.0 Examples

To authorize, use this code:

var teralytic = require("teralytic");
var client = teralytic.ApiClient.instance;

// With node you can use a library like simple-oauth2 (https://github.com/lelylan/simple-oauth2)
// npm install --save simple-oauth2
const credentials = {
  client: {
    id: "<client-id>",
    secret: "<client-secret>"
  },
  auth: {
    tokenHost: "https://auth.teralytic.io/oauth2/token"
  }
};

const oauth2 = require("simple-oauth2").create(credentials);
const tokenConfig = {
  scope: "<scope>" // also can be an array of multiple scopes, ex. ['<scope1>, '<scope2>', '...']
};

// Get the access token object for the client
try {
  const result = await oauth2.clientCredentials.getToken(tokenConfig);
  const accessToken = oauth2.accessToken.create(result);

  var OAuth2 = client.authentications["OAuth2"];
  OAuth2.accessToken = accessToken;
  client.defaultHeaders["x-api-key"] = "<api key>";
} catch (error) {
  console.log("Access Token error", error.message);
}
# For python, making the oauth2 request is fairly simple

import requests, json

token_url = "https://auth.teralytic.io/oauth2/token"

#client (application) credentials on apim.byu.edu
client_id = '<<client_id goes here>>'
client_secret = '<<client_secret goes here>>'

#step A, B - single call with client credentials as the basic auth header - will return access_token
data = {'grant_type': 'client_credentials'}

access_token_response = requests.post(token_url, data=data, verify=False, allow_redirects=False, auth=(client_id, client_secret))

print access_token_response.headers
print access_token_response.text

tokens = json.loads(access_token_response.text)

print "access token: " + tokens['access_token']
import com.google.api.client.auth.oauth2.*;
import com.google.api.client.http.BasicAuthentication;
import com.google.api.client.http.GenericUrl;
import com.google.api.client.http.javanet.NetHttpTransport;
import com.google.api.client.json.jackson.JacksonFactory;
import java.io.IOException;
import io.teralytic.api.*;

public class MyClass {
  static ApiClient apiClient;

  // In this example we use the google-oauth-client to get a token.
  // See: https://github.com/googleapis/google-oauth-java-client
  static String requestAccessToken() throws IOException {
    TokenResponse response = new ClientCredentialsTokenRequest(new NetHttpTransport(), new JacksonFactory(),
                new GenericUrl("https://auth.teralytic.io/oauth2/token"))
                .setClientAuthentication(
                        new BasicAuthentication("<client-id>", "<client-secret>")).execute();
    return response.getAccessToken();
  }

  public static void main(String[] args) throws IOException {
    apiClient = new ApiClient();
    apiClient.addDefaultHeader("x-api-key", "<api-key>");
    apiClient.setAccessToken(requestAccessToken());
  }
}
curl -X POST \
  -d "client_id=<client-id>&client_secret=<client-secret>&grant_type=client_credentials" \
  https://auth.teralytic.io/oauth2/token
  <!--Example not available-->
  No example
  No example

Make sure to replace <api key> and <jwt token> with your key and access token.

The Teralytic API uses two separate methods for Authorization. The first is a partner API key that must be present in all client calls. This key is passed in the HTTP header and identifies the quality of service the parnter is entitled to within the platform.

x-api-key: <api key>

The second authorization is an OAuth 2.0 Bearer token that is created by the Organization with access to their specific resources.

Authorization: Bearer <jwt token>

For these examples you will replace <jwt token> with the token you generate using a third party oauth 2.0 library for your chosen language.

You can decode and examine the JWT token using a tool like the one found here