Table of Contents

Connect external systems

The Agritec Web API provides a development experience that can be used across a wide variety of programming languages, platforms, and devices. The Web API uses the RESTful architectural style. Details about the Agritec WEB API are available at https://api.agritecsoft.com/apidoc/index.html. To access these services, you will need a Personal Access Token.

Important

The public Agritec Web API is currently in public preview. This preview version is provided without a service level agreement, and it's not recommended for production workloads. Certain features might not be supported or might have constrained capabilities. Some of these services run directly over the farm live database, acceding to raw data. It can consume resources and be time consuming. This may affect the performance and user experience when using the regular apps. The API has been designed for punctual queries, not for mirroring the database or massive consults. The conditions for use of this service may change without prior notice, including pay as you go. If you do not agree, please do not use it. You can export data using SQL queries and by exporting to CSV format.

Personal Access Tokens (PAT)

Personal access tokens (PATs) are a secure way to use scripts and integrate external applications with Agritec data. If an external system is compromised, you simply revoke the token instead of changing the password and consequently changing it in all scripts and integrations. Personal access tokens are a safe alternative to using username and password for authentication with various services. Agritec API exposes several services to exchange data such as farm performance, inventories, daily monitor, group closures, etc. This data can be used by your ERP, a visualization tool like Power BI, or any other process.

Creating a Personal Access Token

You should create a personal access token to use in place of a password with the API from Power BI, Excel, ERPs or other external services that need to exchange data with your account.

  1. Login in your Agritec portal.
  2. Under Subscription, select Subscription settings and then Personal Access Tokens.
  3. Select Generate new token.
  4. Give your token a descriptive name.
  5. To give your token an expiration date, select the Expiration drop-down menu, then select the period.
  6. By default, the PAT provides access to all farms. Tap Select Farms to limit the access to specific farms.
  7. Under Permissions, select the type:
    • API read and write: access to read the farm database and the datamart, and write to the farm database.
    • API only read: access to read the farm database and the datamart.
    • Kiosk Dashboard: access to Kiosk Dashboards.
    • Datamart Sharing: allow to upload a datamart to a different subscription.
  8. Complete the possible from according the selected type.
  9. Select Generate.

When you are done, make sure to copy the token and store it in a secure location. For your security, it won't be shown again.

Caution

Treat and use a PAT like your password and keep it secret.

Using a token on external systems

Once you have a token, you can enter it instead of your password when performing operations over HTTPS to the Agritec API.

For each call to the Agritec API, you must add the header with the PAT. The following example shows a header:

Authorization: Bearer {YOUR PAT}

Revoke a PAT

You can revoke a PAT at any time.

  1. From your home page, select Subscription settings.
  2. Select Personal Access Tokens.
  3. Select Delete to delete and revoke the PAT.