Overview

APIs

Topics

Data API

The Data API allows fieldmargin to contact your integration when we require data to show to the user. This is typically used for large datasets that we don't store on our platform, and for real-time data that we want as fresh as possible.

Configuration

When creating an integration you should specify a URI that will be used to fetch data from you. You can also enable the types of data that we can request from you and other related configuration settings.

Communication

Example request

{
    "type": "vehicles.locations",
    "farm_id": "8740a65d-1fdd-4c2b-bb52-d5b84984fa63",
    "token": "3d0daa4b484743bfaf20721f9bf76eb4"
}

All requests from fieldmargin to your endpoint will be POST requests with JSON request bodies containing the following fields:

Field Description
type The type of data request being made.
farm_id The ID of the fieldmargin farm we would like data about. This ID is provided to you during during the authorization flow.
token The verification token shown to you when you created the integration.

You should check if the token matches the verification token we provided when you created your integration. If it is incorrect you should immediately disregard the request as it hasn't originated from fieldmargin.

Your endpoints should respond to our requests with a 2xx status code when the data can successfully be returned. We will treat all 4xx and 5xx as failed requests.

Requests must receive a response within 30 seconds.