What is an API?
An API (Application Programming Interface) is a set of protocols that allows different software applications to communicate with the Priva Connected platform. You can think of it as a bridge between two systems. It defines how requests and responses should be structured so that an authorized third party software program can retrieve historical data securely from the Priva cloud while unauthorized access is prohibited.
Does the Priva Compass use an API?
Absolutely! With the Priva Compass you can use an API to retrieve your historical data from the Priva Cloud.
Do I need any extra hardware to set this up?
How do I get started?
There are a number of steps that you will need to go through to get this feature. We list the steps below.
Step 1 – Signing up to the Connected package.
The first step is to sign up for the Priva Connected package. Once you are signed up, you can start to use all the benefits of the Priva Connected package. To learn more about subscribing, go to https://connected.priva.com
Step 2 – Choosing your API package
Priva offers three API tiers. You will need to choose which one you want to subscribe to.
| Free | Starter | Professional | |
|
Get API Your application software will request historical data from the Priva cloud |
The free version of the API does not provide access to same-day data. Historical data is available only for the past five days |
The API provides access to current as well as historical data.
|
The API provides access to current as well as historical data. |
A maximum of 2 API GET calls are allowed within any 5 minute window |
A maximum of 25 API GET calls are allowed within any 5 minute window |
A maximum of 50 API GET calls are allowed within any 5 minute window | |
| The last 5 days of historical data are available | The last 90 days of historical data are available | The last 180 days of historical data are available | |
| Concurrent calls are not allowed | One concurrent call per user ∗ | Two concurrent calls per user ∗ | |
| Up to 50 individual data values per call | Up to 100 data values per call** | Up to 300 data values per call ∗∗ | |
|
Push API The Priva Cloud will push historical date to your application at regular intervals. |
Not available | Not available | Data is pushed to your application 5 minutes after data is stored in the Priva Cloud. *** |
|
Add API Measurements from third party sources can be injested into the Priva cloud data platform |
Not available | Not available | Not available |
| Support | Self-service via Developer Portal located at https://horti.developers.priva.com/ | Support via Service Center is available during business hours Central European Time | Support via Service Center is available during business hours Central European Time |
∗ A user can be a Data-Driven Grower making API calls for himself or an Integration Partner making API calls on behalf of the Grower. Both the Grower and an Integration Partner count as a user.
∗∗ The maximum number of data points per call depends on the time period for which data is requested. For example, 180 days of data for 1 data point, or 90 days of data for 2 data points.
*** The default value is 5 minutes and can be configured.
Priva can change these API product specifications from time to time. When changes are made, Priva will publish an update via the Changelog.
Step 3 – Getting permission to access the API.
Next you will need to get access to the API. For security reasons, this access can only be given by a person in your organization with administrative rights to your Priva Cloud services. If that is not you, contact your administrator to request this access. There are two specific accesses you need. They are found under the ‘Feature permissions’ table. The first one is found under ‘Access control’ and is the ‘application management’ feature. This allows you to manage access for external applications to your data via APIs. The second one is under ‘HortiApi Data Access’ and is the ‘Direct Access management’ feature.
Step 4 – Registering your API software program.
At Priva, we take the security of your data seriously. If you want a third party software program to access your data from the Priva cloud, you will need to register that specific software program in your cloud environment. By registering it, it gives you the ability to grant access to your data. More importantly, it gives you the ability to deny access to your data if you need to at any point in the future. To register your application,
- Go use the ‘Access Control’ in your cloud environment and click on the ‘Applications’ tab.
- Click on the ‘Add Application’ button to add your third party software application. Give it a name that you will recognize as the software application you are linking to.
- When you register your software program, it will generate an Application ID and a Application secret for you. The application ID is used so that the API interface will recognize which software program is accessing the data and the Application secret is a password that is required to access the data.
- Be sure to copy these credentials and store them safely—you’ll need them later.
Step 5 – Testing API data access
Priva has provided a testing area to test data access via API. It can be found at https://horti.developers.priva.com/
The testing procedure includes
- Obtaining an access token from Horti Access or Postman by following the authentication instructions on the developer portal.
- Testing the “All Connected Sites” endpoint to retrieve a list of sites and copy a site ID.
- Using the “Available Data Points” endpoint with the site ID, a valid start and end time (less than 100 days apart), and the API version (currently 2.0) to get data point details such as variableId, deviceId, and deviceGroupId.
- Testing the “Measurements Get API” endpoint using the same time range and the IDs collected earlier to retrieve raw measurement data.
It also covers some of the common issues you may see.