Endpoints

About

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

https://api.withleaf.io/services/usermanagement/api

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

Leaf Users Resources

Form of a Leaf User resource:

{
"id": "UUID",
"name": "str",
"email": "help@withleaf.io",
"phone": "str",
"address": "str",
"trimbleCredentials": {"Object"},
"cnhiCredentials": {"Object"},
"johnDeereCredentials": {"Object"},
"ravenCredentials": {"Object"},
"climateFieldViewCredentials": {"Object"}
}

Endpoints:

GET /users/{id}
GET /users/
POST /users
PUT /users
DELETE /users/{id}

John Deere Credentials

Form of a John Deere Credentials resource:

{
"status": "str",
"clientKey": "str",
"clientSecret": "str",
"tokenId": "str",
"tokenSecretKey": "str",
"accessToken": "str",
"refreshToken": "str"
}

Endpoints:

GET /users/{leafUserId}/john-deere-credentials
POST /users/{leafUserId}/john-deere-credentials
DELETE /users/{leafUserId}/john-deere-credentials

Climate FieldView Credentials

Form of a Climate FieldView Credentials resource:

{
"status": "str",
"clientId": "str",
"clientSecret": "str",
"apiKey": "str",
"accessToken": "str",
"refreshToken": "str"
}

Endpoints:

GET /users/{leafUserId}/climate-field-view-credentials
POST /users/{leafUserId}/climate-field-view-credentials
DELETE /users/{leafUserId}/climate-field-view-credentials

Trimble Credentials

Form of a Trimble Credentials resource:

{
"status": "str",
"userName": "str",
"password": "str",
"applicationName": "str",
"serviceIdentityId": "str"
}

Endpoints:

GET /users/{leafUserId}/trimble-credentials
POST /users/{leafUserId}/trimble-credentials
DELETE /users/{leafUserId}/trimble-credentials

CNHI Credentials

Form of a CNHI Credentials resource:

{
"status": "str",
"clientId": "str",
"clientSecret": "str",
"subscriptionKey": "str",
"refreshToken": "str",
"clientEnvironment": "STAGE or PRODUCTION"
}

Endpoints:

GET /users/{leafUserId}/cnhi-credentials
POST /users/{leafUserId}/cnhi-credentials
DELETE /users/{leafUserId}/cnhi-credentials

Raven Credentials

Form of a Raven Credentials resource:

{
"accessToken": "str",
"refreshToken": "str",
"clientId": "str",
"clientSecret": "str",
"status": "str"
}

Endpoints:

GET /users/{leafUserId}/raven-credentials
POST /users/{leafUserId}/raven-credentials
DELETE /users/{leafUserId}/raven-credentials

AgLeader Credentials

Form of an AgLeader Credentials resource:

{
"accessToken": "str",
"refreshToken": "str",
"privateKey": "str",
"publicKey": "str",
"status": "str"
}

Endpoints:

GET /users/{leafUserId}/agleader-credentials
POST /users/{leafUserId}/agleader-credentials
DELETE /users/{leafUserId}/agleader-credentials

Raven Slingshot Credentials

Form of a Raven Slingshot Credentials resource:

{
"apiKey": "str",
"accessKey": "str",
"sharedSecret": "str",
"status": "str"
}

Endpoints:

GET /users/{leafUserId}/raven-slingshot-credentials
POST /users/{leafUserId}/raven-slingshot-credentials
DELETE /users/{leafUserId}/raven-slingshot-credentials

User Endpoints

GET /users/{id}

Get a Leaf User by its id.

Response

A Leaf User as a JSON object.

curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/users/{id}'

GET /users

Get all Leaf Users.

Response

A JSON array containing Leaf Users.

curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/users'

POST /users

Creates a Leaf User.

Request body

{
"name": "str",
"email": "help@withleaf.io",
"phone": "str",
"address": "str",
}

Besides the four properties of the example above, if you already have created credentials for some provider like John Deere, you can add an entry like the following, specifying the id of the credentials object previously created, so it will be bind to the Leaf User being created.

"johnDeereCredentials": {
"id": "UUID"
}

Response

A Leaf User with the id assigned to it and it's credentials.

{
"id": "UUID",
"name": "str",
"email": "help@withleaf.io",
"phone": "str",
"address": "str",
}
curl -X POST \
-H 'Authorization: Bearer YOUR_TOKEN' \
-d '{ "name": "str", "email": "help@withleaf.io", "phone": "str", "address": "str"}' \
'https://api.withleaf.io/services/usermanagement/api/users'

PUT /users

Edits an existing Leaf User by submitting a new one.

Request body

{
"id": "UUID",
"name": "str",
"email": "help@withleaf.io",
"phone": "str",
"address": "str",
}

Note that if the existing resource has credentials and you don't include them in the body, the new Leaf User will have no credentials. Said that, for keeping the credentials or updating them, include in the JSON above an entry like this:

"johnDeereCredentials": {
"id": "UUID"
}

Response

A Leaf User with the id assigned to it and it's credentials.

{
"id": "UUID",
"name": "str",
"email": "help@withleaf.io",
"phone": "str",
"address": "str",
}
curl -X PUT \
-H 'Authorization: Bearer YOUR_TOKEN' \
-d '{ "id": "UUID", name": "str", "email": "help@withleaf.io", "phone": "str", "address": "str"}' \
'https://api.withleaf.io/services/usermanagement/api/users'

DELETE /users/{id}

Deletes an existing Leaf User by id.

curl -X DELETE \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/users/{id}'

John Deere Credentials Endpoints

GET /users/{leafUserId}/john-deere-credentials

Get the John Deere credentials of the Leaf User based on its id and returns a JSON with the credentials. If during background processing we detect that this credential is no longer valid, the value of the status will be changed.

Response

{
"clientKey": "str",
"clientSecret": "str",
"tokenId": "str",
"tokenSecretKey": "str",
"accessToken": "str",
"refreshToken": "str",
"status": "str"
}
curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/john-deere-credentials'

POST /users/{leafUserId}/john-deere-credentials

Create a John Deere credentials for the Leaf User.

Request body

{
"clientKey": "str",
"clientSecret": "str",
"accessToken": "str",
"refreshToken": "str"
}

Response

A John Deere credentials with status.

{
"clientKey": "str",
"clientSecret": "str",
"tokenId": "str",
"tokenSecretKey": "str",
"accessToken": "str",
"refreshToken": "str",
"status": "str",
}
curl -X POST \
-H 'Authorization: Bearer YOUR_TOKEN' \
-d '{"clientKey": "str","clientSecret": "str","accessToken": "str","refreshToken": "str"}' \
'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/john-deere-credentials'

DELETE /users/{leafUserId}/john-deere-credentials

Delete Leaf User's John Deere credentials.

curl -X DELETE \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/john-deere-credentials'

Climate Field View Credentials Endpoints

GET /users/{leafUserId}/climate-field-view-credentials

Get a Climate Field View credentials object by its id. If during background processing we detect that this credential is no longer valid, the value of the status will be changed.

Response

{
"clientId": "str",
"clientSecret": "str",
"apiKey": "str",
"refreshToken": "str",
"status": "str"
}
curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/climate-field-view-credentials'

POST /users/{leafUserId}/climate-field-view-credentials

Create a Climate Field View credentials for the Leaf User.

Request body

{
"clientId": "str",
"clientSecret": "str",
"apiKey": "str",
"refreshToken": "str"
}

Response

A Climate Field View credential with status.

{
"clientKey": "str",
"clientSecret": "str",
"tokenId": "str",
"tokenSecretKey": "str",
"status": "str"
}
curl -X POST \
-H 'Authorization: Bearer YOUR_TOKEN' \
-d '{"clientId": "str","clientSecret": "str","apiKey": "str","refreshToken": "str"}' \
'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/climate-field-view-credentials'

DELETE /users/{leafUserId}/climate-field-view-credentials

Delete Leaf User's Climate Field View credentials.

curl -X DELETE \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/climate-field-view-credentials'

Trimble Credentials Endpoints

GET /users/{leafUserId}/trimble-credentials

Get the Trimble credentials of the Leaf User based on its id and returns a JSON with the credentials.

Response

A Trimble credentials resource as a JSON.

curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/trimble-credentials'

POST /users/{leafUserId}/trimble-credentials

Create a Trimble credentials for the Leaf User.

Request body

A Trimble credentials.

{
"userName": "str",
"password": "str",
"applicationName": "str",
"serviceIdentityId": "str"
}

Response

A Trimble credentials with status.

curl -X POST \
-H 'Authorization: Bearer YOUR_TOKEN' \
-d '{"userName": "str","password": "str","applicationName": "str","serviceIdentityId": "str"}'
'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/trimble-credentials'

DELETE /users/{leafUserId}/trimble-credentials

Delete a Leaf User's Trimble credentials.

curl -X DELETE \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/trimble-credentials'

CNHI Credentials Endpoints

GET /users/{leafUserId}/cnhi-credentials

Get the CNHI credentials of the Leaf User based on its id and returns a JSON with the credentials.

Response

A CNHI credentials resource as a JSON.

curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/cnhi-credentials'

POST /users/{leafUserId}/cnhi-credentials

Create a CNHI credentials for the Leaf User.

Request body

A CNHI credentials.

{
"clientId": "str",
"clientSecret": "str",
"subscriptionKey": "str",
"refreshToken": "str",
"clientEnvironment": "STAGE or PRODUCTION"
}

Response

A CNHI Credentials with status.

curl -X POST \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"clientId": "str", "clientSecret": "str", "subscriptionKey": "str", "refreshToken": "str", "clientEnvironment": "STAGE or PRODUCTION"}' \
'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/cnhi-credentials'

DELETE /users/{leafUserId}/cnhi-credentials

Delete Leaf User's CNHI credentials.

curl -X DELETE \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/cnhi-credentials'

Raven Credentials Endpoints

GET /users/{leafUserId}/raven-credentials

Get the Raven credentials of the Leaf User based on its id and returns a JSON with the credentials.

Response

A Raven credentials resource as a JSON.

curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/raven-credentials'

POST /users/{leafUserId}/raven-credentials

Create a Raven credentials for the Leaf User.

Request body

A Raven credentials.

{
"clientId": "str",
"clientSecret": "str",
"refreshToken": "str"
}

Response

A Raven Credentials with status.

curl -X POST \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{ "clientId": "str","clientSecret": "str","refreshToken":"str"}' \
'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/raven-credentials'

DELETE /users/{leafUserId}/raven-credentials

Delete Leaf User's Raven credentials.

curl -X DELETE \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/raven-credentials'
tip

Please don't hesitate to contact us to schedule a demo, ask a question, request sample data, or suggest a feature!

AgLeader Credentials Endpoints

GET /users/{leafUserId}/agleader-credentials

Get the AgLeader credentials of the Leaf User based on its id and returns a JSON with the credentials.

Response

A AgLeader credentials resources as a JSON.

curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/agleader-credentials'

POST /users/{leafUserId}/agleader-credentials

Create a AgLeader credentials for the Leaf User.

Request body

A AgLeader credentials.

{
"accessToken": "str",
"refreshToken": "str",
"publicKey": "str",
"privateKey": "str",
}

Response

A Raven Credentials with status.

curl -X POST \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{ "accessToken": "str","refreshToken": "str","privateKey":"str", "publicKey":"str"}' \
'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/agleader-credentials'

DELETE /users/{leafUserId}/agleader-credentials

Delete Leaf User's AgLeader credentials.

curl -X DELETE \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/agleader-credentials'

Raven Slingshot Credentials Endpoints

GET /users/{leafUserId}/raven-slingshot-credentials

Get the Raven Slingshot credentials of the Leaf User based on its id and returns a JSON with the credentials.

Response

A Raven Slingshot credentials resources as a JSON.

curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/raven-slingshot-credentials'

POST /users/{leafUserId}/raven-slingshot-credentials

Create a Raven Slingshot credentials for the Leaf User.

Request body

A Raven Slingshot credentials.

{
"apiKey": "str",
"accessKey": "str",
"sharedSecret": "str"
}

Response

A Raven Slingshot Credentials with status.

curl -X POST \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{ "apiKey": "str", "accessKey": "str", "sharedSecret": "str" }' \
'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/raven-slingshot-credentials'

DELETE /users/{leafUserId}/raven-slingshot-credentials

Delete Leaf User's Raven Slingshot credentials.

curl -X DELETE \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/raven-slingshot-credentials'