Picture

Documentation

Prerequisite

Some actions are needed in order to start using Smag Link APIs which are not described in this section.

Please go to the Get Started section.

FarmsAndFields

Which data can be accessed ?

This API has been designed to retrieve information about :

  • farms

  • fields

  • crop zones

Example Use Case : I want to get all the crop zones for a farm

STEP 1 : Retrieve all the farms associated with a token

Use the "get a farm list" endpoint in order to get the complete list of farms for a given token.

https://api.smag.tech/farmsandfields/v1/farms[?farmCode][&cropYear]

The response will be a farm list.

In each farm, you will find informations about this farm and an "uid" attribute.

Picture
Picture

STEP 2 : Get the crop zone list for a farm

Use the "get a crop zone list" endpoint with the farmUid you got on STEP 1.

https://api.smag.tech/farmsandfields/v1/farms/{farmUid}/cropZones[?cropYear]

Picture
Picture

Crops

Which data can be accessed

This API has been designed to retrieve informations about :

  • Crops

  • Varieties

  • Vegetative stages

Example Use Case : I want to get the crop for a crop zone

STEP 1 : Get a crop zone / a crop zone list

See the FarmsAndFields section.

In the crop resource, you will find a "cropUid" attribute.

STEP 2 : Get the crop

Use the "get a crop" endpoint to get detailled information about the crop

https://api.smag.tech/crop/v1/crops/{cropUid}

Picture
Picture

Event

Which data can be accessed

This API has been designed to retrieve informations about :

  • WorkOrder : a planned event on a crop zone

  • WorkRecord : an actual event on a crop zone

Example Use Case : I want to get the list of planned events for a crop zone

STEP 1 : Get a crop zone / a crop zone list

See the FarmsAndFields section.

In the cropZone resource, you will find a "uid" attribute.

STEP 2 : Get the work orders

Use the "get a work order list" endpoint to get the complete list of work orders for a crop zone.

https://api.smag.tech/event/v1/workOrders?cropZoneUid={cropZoneUid}[&cropYear]

Picture

How does it work?

With this API, you can retrieve all the WorkOrders for a specified crop zone, thanks to the cropZoneUid param.

WorkOrder represents a planned work on one or more crop zones.

Each WorkOrder contains a WorkItem list.

As a WorkOrder might concern several crop zones, you will retrieve the WorkItems concerning the cropzone you asked for, but also these concerning other crop zones.

WorkItem is a set of operations on a given crop zone.

Example Use Case : I want to get the list of actual events for a crop zone

STEP 1 : Get a crop zone / a crop zone list

See the FarmsAndFields section.

In the cropZone resource, you will find a "uid" attribute.

STEP 2 : Get the work records

Use the "get a work order list" endpoint to get the complete list of work orders for a crop zone.

https://api.smag.tech/event/v1/workOrders?cropZoneUid={cropZoneUid}[&cropYear]

Picture

How does it work?

With this API, you can retrieve all the WorkRecords for a specified crop zone, thanks to the cropZoneUid param.

WorkRecord represents an actual work on one or more crop zones.

Each WorkRecord contains a Summary list.

As a WorkRecord might concern several crop zones, you will retrieve the Summaries concerning the cropzone you asked for, but also these concerning other crop zones.

Summary is a set of operations on a given crop zone.

SmagTask

Jobs:

  • ExportTask

Create and queue an export task allowing you to export big quantities of data from SmagLink.

The POST operation will require an object specifying the export content (crop year, entities such as CropZone or WorkRecord and optional filters). Please refer to the endpoint contract interface for up-to-date specifications.

The result returned when this task is completed is an URI appended with a SAS (Shared Access Signature) token that will grant you location and temporary access to your export data.

To learn how to consume it, please read "Consuming a result containing a SAS token".

NOTE: In the current beta, entities and filters are ignored and will default to an export including your farms, crop zones, and work records from the provided crop year.