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",
"somarCredentials": {"Object"},
"trimbleCredentials": {"Object"},
"cnhiCredentials": {"Object"},
"johnDeereCredentials": {"Object"},
"ravenCredentials": {"Object"},
"climatempoCredentials": {"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:

{
"id": "UUID",
"clientKey": "str",
"clientSecret": "str",
"tokenId": "str",
"tokenSecretKey": "str"
}

Endpoints:

GET /john-deere-credentials/{id}
GET /john-deere-credentials
POST /john-deere-credentials
DELETE /john-deere-credentials/{id}

Climate FieldView Credentials

Form of a Climate FieldView Credentials resource:

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

Endpoints:

GET /climate-field-view-credentials/{id}
GET /climate-field-view-credentials
POST /climate-field-view-credentials
DELETE /climate-field-view-credentials/{id}

Trimble Credentials

Form of a Trimble Credentials resource:

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

Endpoints:

GET /trimble-credentials/{id}
GET /trimble-credentials
POST /trimble-credentials
DELETE /trimble-credentials/{id}

CNHI Credentials

Form of a CNHI Credentials resource:

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

Endpoints:

GET /cnhi-credentials/{id}
GET /cnhi-credentials
POST /cnhi-credentials
DELETE /cnhi-credentials/{id}

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 '{ "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' \
-d '{ "name": "str", "email": "help@withleaf.io", "phone": "str", "address": "str"}'
'https://api.withleaf.io/services/usermanagement/api/users/{id}'

GET /john-deere-credentials/{id}

Get the John Deere credentials of the user based own his id and returns a JSON with the credentials.

Response

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

GET /john-deere-credentials

Gets all John Deere Credentials.

Response

[
{
"id": "UUID",
"clientKey": "str",
"clientSecret": "str",
"tokenId": "str",
"tokenSecretKey": "str"
}
]
curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/john-deere-credentials'

POST /john-deere-credentials

Create a John Deere credential for the Leaf User.

Request body

{
"clientKey": "str",
"clientSecret": "str",
"tokenId": "str",
"tokenSecretKey": "str"
}

Response

A John Deere Credentials object with the id assigned to it.

{
"id": "UUID",
"clientKey": "str",
"clientSecret": "str",
"tokenId": "str",
"tokenSecretKey": "str"
}
curl -X POST \
-H 'Authorization: Bearer YOUR_TOKEN' \
-d '{ "name": "str", "email": "help@withleaf.io", "phone": "str", "address": "str"}'
'https://{{url}}/services/usermanagement/api/john-deere-credentials'

DELETE john-deere-credentials/{id}

Delete a John Deere credentials by id.

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

GET climate-field-credentials/{id}

Get a Climate Field View Credentials object by its id.

Response

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

GET /climate-field-credentials

Gets all the Climate Field View credentials.

Response

[
{
"id": "UUID",
"clientId": "",
"clientSecret": "",
"apiKey": "",
"refreshToken": ""
}
]
curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/climate-field-view-credentials'

DELETE /climate-field-view-credentials/{id}

Deletes a "Climate Field View Credentials" by id.

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

POST /climate-field-credentials

Create a Climate Field View credential for the Leaf User.

Request body

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

Response

A Leaf User with the id assigned to it.

{
"id": "UUID",
"clientKey": "str",
"clientSecret": "str",
"tokenId": "str",
"tokenSecretKey": "str"
}
curl -X POST \
-H 'Authorization: Bearer YOUR_TOKEN' \
-d '{ "name": "str", "email": "help@withleaf.io", "phone": "str", "address": "str"}'
'https://{{url}}/services/usermanagement/api/climate-field-view-credentials'

GET /trimble-credentials/{id}

Get a "Trimble Credentials" resource by its id.

Response

A "Trimble Credentials" resource as a JSON.

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

GET /trimble-credentials

Gets all Trimble Credentials.

Response

A JSON array with Trimble Credentials.

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

POST /trimble-credentials

Create a "Trimble Credentials" for the Leaf User.

Request body

A "Trimble Credentials" without id.

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

Response

A "Trimble Credentials" with the id assigned to it.

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

DELETE trimble-credentials/{id}

Delete a Trimble Credentials resource by id.

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

GET /cnhi-credentials/{id}

Get a "CNHI Credentials" resource by its id.

Response

A "CNHI Credentials" resource as a JSON.

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

GET /cnhi-credentials

Gets all CNHI Credentials.

Response

A JSON array with CNHI Credentials.

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

POST /cnhi-credentials

Create a "CNHI Credentials" for the Leaf User.

Request body

A "CNHI Credentials" without id.

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

Response

A "CNHI Credentials" with the id assigned to it.

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

DELETE cnhi-credentials/{id}

Delete a CNHI Credentials resource by id.

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

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