Provider Organizations
About
The endpoints described here are divided into two categories. The Organizations List provides tools for listing organizations that have or have not granted access to Leaf. The Organization Sync offers tools for managing organizations to be processed, which in turn impacts associated resources such as field boundaries, operations, and assets.
All HTTP methods should be prepended by this service's endpoint:
See below the REST resources and their endpoints available in this service.
Endpoints
Description | Endpoints |
---|---|
Get Provider Organizations | GET /users/{leafUserId}/organizations/{provider} |
Get All Provider Organizations | GET /users/{leafUserId}/{provider}/organizations |
Get a Provider Organization | GET /users/{leafUserId}/{provider}/organizations/{provider_org_id} |
Update a Provider Organization Status | PATCH /users/{leafUserId}/{provider}/organizations/{provider_org_id} |
Organizations List
Get Provider Organizations
 GET /users/{leafUserId}/organizations/{provider}
Get provider connected and disconnected organizations from Leaf User.
provider
: can beJohnDeere
orTrimble
.
info
At Trimble it is not possible to differentiate which organizations are connected or not.
Request examples
- cURL
- Python
- JavaScript
Response
Organizations Sync
info
- The
provider
property value can be only beJohnDeere
Resource
The properties available for a Provider Organization are.
- The
providerOrgId
property references the organization ID value from the provider. For example, if the John Deere organization ID is 12345, then theproviderOrgId
should be 12345. - The
providerOrgName
property references the value of the organization name from the provider. - The
status
property represents the current state of the resource. The state of the resource can be eitherPREVIEW
,SELECTED
, orBLOCKED
.- If the
status
property has the valueSELECTED
, all available resources will be fetched from the provider and processed. - If the
status
property has the valuePREVIEW
, no resources beyond the organization itself will be processed. - If the
status
property has the valueBLOCKED
, the organization does not have the required permissions to be processed by Leaf. To troubleshoot this issue please review Step 3 of the John Deere Authentication Guide, once the setup is complete, the resource will be available with thePREVIEW
status. For any additional troubleshooting options, please reach out to help@withleaf.io
- If the
Get All Provider Organizations
 GET /users/{leafUserId}/{provider}/organizations
With this endpoint users can retrieve all organizations.
You can also pass some parameters used exclusively for paging through results. They are:
page
, an integer specifying the page being fetched (default is 0)size
, an integer specifying the size of the page (default is 20, max is 100)
Request examples
- cURL
- Python
- JavaScript
Response
Get a Provider Organization
 GET /users/{leafUserId}/{provider}/organizations
With this endpoint users can retrieve individual provider organizations.
Request examples
- cURL
- Python
- JavaScript
Response
Patch a Provider Organization
 PATCH /users/{leafUserId}/{provider}/organizations
With this endpoint, users can change the status of a provider organization. You can only change the status of a provider organization between SELECTED
or PREVIEW
. Also, as mentioned before, provider organizations with the BLOCKED
status cannot be changed.
Request examples
- cURL
- Python
- JavaScript