Gardin API
Our API is built around RESTful principles. It has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.
The API is organised into common functionality groups:
Authentication: The Login API is the first step for all API use cases, providing secure token-based authentication that identifies your Gardin tenancy and establishes your access permissions across all Gardin services.
Data analysis: The Query API unlocks deep analysis and data sharing through user-submitted queries and bulk data downloads of chlorophyll fluorescence† and Gardin indices data.
Sensor management: The Sensor Management API facilitates the management of your Gardin sensors, offering endpoints to allow developers to list, describe, and group their sensors, as well as operate device schedules and measurement jobs.
† Available on selected license plans.
The base URL for the Gardin API is: https://api.gardin.ag/v2
.
Getting started
To get started:
- Obtain your client ID and secret by contacting the Gardin Support team.
- Get a new access token.
- Make a call to any Gardin API endpoint, making sure to always provide your access token in the
Authorization: Bearer {token}
HTTP header.
You can find a complete code example for Python demonstrating an end-to-end workflow for the Query API on Github.
Authentication
- OAuth 2.0: ClientCredentials
- HTTP: Basic Auth
To access the Gardin API, users are required to authenticate using the OAuth2 Client Credentials flow. This authentication method is designed for applications that need to access resources on behalf of themselves, not on behalf of a user. It involves the application presenting its own credentials to obtain an access token, which then grants it permission to call the desired API endpoints.
The Client Credentials flow is particularly suitable for server-to-server interactions where the application needs to access resources without user intervention. Upon successful authentication, the application is issued an access token.
Access tokens are represented as JSON Web Tokens (JWTs), which are compact, URL-safe means of representing claims to be transferred between two parties. These tokens contain a set of claims that grant specific rights and are securely signed, allowing the recipient to verify their authenticity and integrity.
See POST /oauth2/token endpoint documentation for more information.
Security Scheme Type: | oauth2 |
---|---|
OAuth Flow (clientCredentials): | Token URL: https://login.gardin.ag/oauth2/token/ Scopes: |
Use this flow to acquire a new access token - a string which contains the credentials and permissions that can be used to access resources across the Gardin API suite using the client credentials flow.
See POST /oauth2/token endpoint documentation for more information.
Security Scheme Type: | http |
---|---|
HTTP Authorization Scheme: | basic |