Endpoints

About

All HTTP methods should be prepended by this service's endpoint:

https://api.withleaf.io/services/beta/prescriptions/api

See below the REST resources and their endpoints available in this service.

Prescription (BETA)

Prescription Resources

This feature has the following endpoints available:

DescriptionEndpoints
Upload prescription to Raven SlingshotPOST /users/{leafUserId}/ravenSlingshot
List prescriptions from Raven SlingshotGET /users/{leafUserId}/ravenSlingshot
Upload prescription to Climate FieldViewPOST /users/{leafUserId}/climateFieldView
Lists prescriptions from John DeereGET /users/{leafUserId}/johnDeere
Upload prescription to John DeerePOST /users/{leafUserId}/johnDeere

Upload prescription to Raven Slingshot

 POST /users/{leafUserId}/ravenSlingshot

Upload a prescription using the Raven Slingshot credentials of the LeafUserId.

The file to be uploaded needs to be .zip and contain one of each of the following file extension: shp, dbf, shx; and all files must have the same name. The zip file cannot contain subfolders.

Example:

A zip file named “prescription_rx_map”, containing the following files:

  • prescription_rx_map.shp
  • prescription_rx_map.dbf
  • prescription_rx_map.shx
curl -X POST \
-H 'Authorization: Bearer YOUR_TOKEN' \
-F 'file=prescription_rx_map.zip' \
'https://api.withleaf.io/services/beta/prescriptions/api/users/{leafUserId}/ravenSlingshot'

Response

The response is json with the id of the file uploaded to the provider .

{
"id": "str",
"name": "str"
}

List prescriptions from Raven Slingshot

 GET /users/{leafUserId}/ravenSlingshot

List the existing prescriptions available in the provider.

curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/beta/prescriptions/api/users/{leafUserId}/ravenSlingshot'

Response

A json array of prescriptions available in this provider

[
{
"id": "str",
"name": "str"
},
{
"id": "str",
"name": "str"
}
]

Upload prescription to Climate FieldView

 POST /users/{leafUserId}/climateFieldView

Upload a prescription using the Climate FieldView credentials of the LeafUserId.

The file to be uploaded needs to be .zip and contain one of each of the following file extension: shp, dbf, shx; and all files must have the same name. The zip file cannot contain subfolders.

Example:

A zip file named “prescription_rx_map”, containing the following files:

  • prescription_rx_map.shp
  • prescription_rx_map.dbf
  • prescription_rx_map.shx
curl -X POST \
-H 'Authorization: Bearer YOUR_TOKEN' \
-F 'file=prescription_rx_map.zip' \
'https://api.withleaf.io/services/beta/prescriptions/api/users/{leafUserId}/climateFieldView'

Response

The response is json with the id of the file uploaded to the provider.

{
"id": "str",
"name": "str"
}

List prescriptions from John Deere

 GET /users/{leafUserId}/johnDeere

List the existing prescriptions available in the provider.

There is a required request param called organizationId for this endpoint to work. This property should be the id of the organization at JohnDeere.

curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/beta/prescriptions/api/users/{leafUserId}/johnDeere?organizationId={organizationId}'

Response

A json array of prescriptions available in this provider.

[
{
"id": "str",
"name": "str"
},
{
"id": "str",
"name": "str"
}
]

Upload prescription to John Deere

 POST /users/{leafUserId}/johnDeere

Upload a prescription using the John Deere credentials of the LeafUserId.

There is a required request param called organizationId for this endpoint to work. This property should be the id of the organization at JohnDeere.

The file to be uploaded needs to be .zip and have a folder called "Rx" containing one of each of the following file extension: shp, dbf, shx; and all files must have the same name. The zip file cannot contain subfolders.

Example:

A .zip file named “prescription_rx_map”, having a parent folder called "Rx", containing the following files:

  • Rx/
    • prescription_rx_map.shp
    • prescription_rx_map.dbf
    • prescription_rx_map.shx
curl -X POST \
-H 'Authorization: Bearer YOUR_TOKEN' \
-F 'file=prescription_rx_map.zip' \
'https://api.withleaf.io/services/beta/prescriptions/api/users/{leafUserId}/johnDeere?organizationId={organizationId}'

Response

The response is json with the id of the file uploaded to the provider.

{
"id": "str",
"name": "str"
}