Leaf Link > 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.

API key

The API keys are the required authentication info for the Leaf widgets. It is created at a Leaf user level.

Endpoints

DescriptionEndpoints
Get all Leaf user API keysGET /api-keys
Create a Leaf user API keyPOST /api-keys
Revoke a Leaf user API keyDELETE /api-keys

Get all Leaf user API keys

 GET /api-keys

Get all API keys from a Leaf user.

Request examples

curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/api-keys?leafUserId={leafUserId}'
Response
[
{
"id": "uuid",
"key": "xxxx...xxxx",
"leafUserId": "uuid",
"expiresAt": "2024-04-25T18:32:25.530259",
"description": "test",
"valid": true
},
{
"id": "uuid",
"key": "xxxx...xxxx",
"leafUserId": "uuid",
"expiresAt": "2024-04-25T18:36:37.965906",
"description": "test",
"revokedAt": "2023-04-26T21:27:55.674731",
"valid": false
}
]

Create a Leaf user API key

 POST /api-keys

Creates a Leaf user API key.

Request body

It is requires few properties:

{
"leafUserId": "string",
"expiresIn": int,
"description": "string"
}
  • leafUserId: leaf user Id
  • expiresIn: time to expiration, in seconds. The minimum allowed value is 900 (15 minutes). The default value is one year.
  • description: description to identify the API Key

Request examples

curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
-d '{ "leafUserId": "string", "expiresIn": 900, "description": "string" }'
'https://api.withleaf.io/services/usermanagement/api/api-keys'
Response
{
"key": "xxxxxxx",
"expiresAt": "2024-04-25T18:36:37.965906",
"valid": true
}

Revoke a Leaf user API key

 DELETE /api-keys

Revokes a Leaf user API key.

Request examples

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

Providers application info

This section is about your application information from the provider, basically related to the required properties for each one, like the client ID, keys, and secrets.

Provider setup

Setting up the provider application information is mandatory to use the provider in the authentication widgets/links from Leaf Link.

AgLeader

To enable AgLeader as a provider in the widget you need to have your application already registered with AgLeader. You can find more info on how to create a developer account here.

Endpoints

DescriptionEndpoints
Get all AgLeader app informationGET /app-keys/AgLeader
Get an AgLeader app informationGET /app-keys/AgLeader/{appName}
Create an AgLeader app informationPOST /app-keys/AgLeader/{appName}
Update an AgLeader app informationPUT /app-keys/AgLeader/{appName}
Delete an AgLeader app informationDELETE /app-keys/AgLeader/{appName}

Get all AgLeader app information

 GET /app-keys/AgLeader

Get all AgLeader app information from the API Owner.

Request examples
curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/app-keys/AgLeader'
Response
[
{
"provider": "providerName",
"appName": "yourAppName",
"clientEnvironment": "PRODUCTION",
"createdTime": "yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'"
},
{
"provider": "providerName",
"appName": "yourAppName",
"clientEnvironment": "PRODUCTION",
"createdTime": "yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'"
}
]

Get an AgLeader app information

 GET /app-keys/AgLeader/{appName}

Get an AgLeader app information from the API Owner.

Request examples
curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/app-keys/AgLeader/{appName}'
Response
{
"provider": "providerName",
"appName": "yourAppName",
"clientEnvironment": "PRODUCTION",
"createdTime": "yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'"
}

Create an AgLeader app information

 POST /app-keys/AgLeader/{appName}

Create an AgLeader app information.

Request body
{
"privateKey": "string",
"publicKey": "string"
}
Request examples
curl -X POST \
-H 'Authorization: Bearer YOUR_TOKEN' \
-d '{ "privateKey": "string", "publicKey": "string" }'
'https://api.withleaf.io/services/usermanagement/api/app-keys/AgLeader/{appName}'

Update an AgLeader app information

 PUT /app-keys/AgLeader/{appName}

Update an AgLeader app information.

Request body
{
"privateKey": "string",
"publicKey": "string"
}
Request examples
curl -X PUT \
-H 'Authorization: Bearer YOUR_TOKEN' \
-d '{ "privateKey": "string", "publicKey": "string" }'
'https://api.withleaf.io/services/usermanagement/api/app-keys/AgLeader/{appName}'

Delete an AgLeader app information

 DELETE /app-keys/AgLeader/{appName}

Delete an AgLeader app information.

Request examples
curl -X DELETE \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/app-keys/AgLeader/{appName}'

Climate FieldView

To enable Climate FieldView as a provider in the widget you need to have your application already registered with Climate FieldView. You can find more info on how to create a developer account here.

Endpoints

DescriptionEndpoints
Get all Climate FieldView app informationGET /app-keys/ClimateFieldView
Get a Climate FieldView app informationGET /app-keys/ClimateFieldView/{appName}
Create a Climate FieldView app informationPOST /app-keys/ClimateFieldView/{appName}
Update a Climate FieldView app informationPUT /app-keys/ClimateFieldView/{appName}
Delete a Climate FieldView app informationDELETE /app-keys/ClimateFieldView/{appName}

Get all Climate FieldView app information

 GET /app-keys/ClimateFieldView

Get all Climate FieldView app information from the API Owner.

Request examples
curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/app-keys/ClimateFieldView'
Response
[
{
"provider": "providerName",
"appName": "yourAppName",
"clientEnvironment": "PRODUCTION",
"createdTime": "yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'"
},
{
"provider": "providerName",
"appName": "yourAppName",
"clientEnvironment": "PRODUCTION",
"createdTime": "yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'"
}
]

Get a Climate FieldView app information

 GET /app-keys/ClimateFieldView/{appName}

Get a Climate FieldView app information from the API Owner.

Request examples
curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/app-keys/ClimateFieldView/{appName}'
Response
{
"provider": "providerName",
"appName": "yourAppName",
"clientEnvironment": "PRODUCTION",
"createdTime": "yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'"
}

Create a Climate FieldView app information

 POST /app-keys/ClimateFieldView/{appName}

Create a Climate FieldView app information.

Request body
{
"apiKey": "string",
"clientId": "string",
"clientSecret": "string"
}
Request examples
curl -X POST \
-H 'Authorization: Bearer YOUR_TOKEN' \
-d '{ "apiKey": "string", "clientId": "string", "clientSecret": "string" }'
'https://api.withleaf.io/services/usermanagement/api/app-keys/ClimateFieldView/{appName}'
Scopes

If any additional permission is required during the authentication process, use the scopes parameter to require it as displayed below:

{
"apiKey": "string",
"clientId": "string",
"clientSecret": "string",
"scopes": ["string"]
}

Check the allowed values in this scopes table.

Update a Climate FieldView app information

 PUT /app-keys/ClimateFieldView/{appName}

Update a Climate FieldView app information.

Request body
{
"apiKey": "string",
"clientId": "string",
"clientSecret": "string"
}
Request examples
curl -X PUT \
-H 'Authorization: Bearer YOUR_TOKEN' \
-d '{ "apiKey": "string", "clientId": "string", "clientSecret": "string" }'
'https://api.withleaf.io/services/usermanagement/api/app-keys/ClimateFieldView/{appName}'

Delete a Climate FieldView app information

 DELETE /app-keys/ClimateFieldView/{appName}

Delete a Climate FieldView app information.

Request examples
curl -X DELETE \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/app-keys/ClimateFieldView/{appName}'

CNHI

To enable CNHI as a provider in the widget you need to have your application already registered with CNHI. You can find more info on how to create a developer account here.

Integration requirements

https://widget.withleaf.io

The Leaf widget URL must be registered as a valid "App OAuth Callback URL(s)" in your CNHi application. Check this section for more information.

Endpoints

DescriptionEndpoints
Get all CNHI app informationGET /app-keys/CNHI
Get a CNHI app informationGET /app-keys/CNHI/{appName}/{clientEnvironment}
Create a CNHI app informationPOST /app-keys/CNHI/{appName}/{clientEnvironment}
Update a CNHI app informationPUT /app-keys/CNHI/{appName}/{clientEnvironment}
Delete a CNHI app informationDELETE /app-keys/CNHI/{appName}/{clientEnvironment}

Get all CNHI app information

 GET /app-keys/CNHI

Get all CNHI app information from the API Owner.

Request examples
curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/app-keys/CNHI'
Response
[
{
"provider": "providerName",
"appName": "yourAppName",
"clientEnvironment": "STAGE or PRODUCTION",
"createdTime": "yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'"
},
{
"provider": "providerName",
"appName": "yourAppName",
"clientEnvironment": "STAGE or PRODUCTION",
"createdTime": "yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'"
}
]

Get a CNHI app information

 GET /app-keys/CNHI/{appName}/{clientEnvironment}

Get a CNHI app information from the API Owner.

Request examples
curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/app-keys/CNHI/{appName}/{clientEnvironment}'
Response
{
"provider": "providerName",
"appName": "yourAppName",
"clientEnvironment": "STAGE or PRODUCTION",
"createdTime": "yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'"
}

Create a CNHI app information

 POST /app-keys/CNHI/{appName}/{clientEnvironment}

Create a CNHI app information.

Request body
{
"clientId": "string",
"clientSecret": "string",
"subscriptionKey": "string"
}
Request examples
curl -X POST \
-H 'Authorization: Bearer YOUR_TOKEN' \
-d '{ "clientId": "string", "clientSecret": "string", "subscriptionKey": "string" }'
'https://api.withleaf.io/services/usermanagement/api/app-keys/CNHI/{appName}/{clientEnvironment}'

Update a CNHI app information

 PUT /app-keys/CNHI/{appName}/{clientEnvironment}

Update a CNHI app information.

Request body
{
"clientId": "string",
"clientSecret": "string",
"subscriptionKey": "string"
}
Request examples
curl -X PUT \
-H 'Authorization: Bearer YOUR_TOKEN' \
-d '{ "clientId": "string", "clientSecret": "string", "subscriptionKey": "string" }'
'https://api.withleaf.io/services/usermanagement/api/app-keys/CNHI/{appName}/{clientEnvironment}'

Delete a CNHI app information

 DELETE /app-keys/CNHI/{appName}/{clientEnvironment}

Delete a CNHI app information.

Request examples
curl -X DELETE \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/app-keys/CNHI/{appName}/{clientEnvironment}'

John Deere

To enable John Deere as a provider in the widget you need to have your application already registered with John Deere. You can find more info on how to create a developer account here.

Integration requirements

https://widget.withleaf.io

The Leaf widget URL must be registered as a valid "Redirect URI" in your John Deere application. Check this section for more information.

Endpoints

DescriptionEndpoints
Get all John Deere app informationGET /app-keys/JohnDeere
Get a John Deere app informationGET /app-keys/JohnDeere/{appName}/{clientEnvironment}
Create a John Deere app informationPOST /app-keys/JohnDeere/{appName}/{clientEnvironment}
Update a John Deere app informationPUT /app-keys/JohnDeere/{appName}/{clientEnvironment}
Delete a John Deere app informationDELETE /app-keys/JohnDeere/{appName}/{clientEnvironment}

Get all John Deere app information

 GET /app-keys/JohnDeere

Get all John Deere app information from the API Owner.

Request examples
curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/app-keys/JohnDeere'
Response
[
{
"provider": "providerName",
"appName": "yourAppName",
"clientEnvironment": "STAGE or PRODUCTION",
"createdTime": "yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'"
},
{
"provider": "providerName",
"appName": "yourAppName",
"clientEnvironment": "STAGE or PRODUCTION",
"createdTime": "yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'"
}
]

Get a John Deere app information

 GET /app-keys/JohnDeere/{appName}/{clientEnvironment}

Get a John Deere app information from the API Owner.

Request examples
curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/app-keys/JohnDeere/{appName}/{clientEnvironment}'
Response
{
"provider": "providerName",
"appName": "yourAppName",
"clientEnvironment": "STAGE or PRODUCTION",
"createdTime": "yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'"
}

Create a John Deere app information

 POST /app-keys/JohnDeere/{appName}/{clientEnvironment}

Create a John Deere app information.

Request body
{
"clientKey": "string",
"clientSecret": "string"
}
Request examples
curl -X POST \
-H 'Authorization: Bearer YOUR_TOKEN' \
-d '{ "clientKey": "string", "clientSecret": "string" }'
'https://api.withleaf.io/services/usermanagement/api/app-keys/JohnDeere/{appName}/{clientEnvironment}'

Update a John Deere app information

 PUT /app-keys/JohnDeere/{appName}/{clientEnvironment}

Update a John Deere app information.

Request body
{
"clientKey": "string",
"clientSecret": "string"
}
Request examples
curl -X PUT \
-H 'Authorization: Bearer YOUR_TOKEN' \
-d '{ "clientKey": "string", "clientSecret": "string" }'
'https://api.withleaf.io/services/usermanagement/api/app-keys/JohnDeere/{appName}/{clientEnvironment}'
Scopes

If any additional permission is required during the authentication process, use the scopes parameter to require it as displayed below:

{
"clientKey": "string",
"clientSecret": "string",
"scopes": ["string"]
}

Check the allowed values in this scopes table.

Delete a John Deere app information

 DELETE /app-keys/JohnDeere/{appName}/{clientEnvironment}

Delete a John Deere app information.

Request examples
curl -X DELETE \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/app-keys/JohnDeere/{appName}/{clientEnvironment}'

Trimble

To enable Trimble as a provider in the widget you need to have your application already registered with Trimble. You can find more info on how to create a developer account here.

Integration requirements

https://widget.withleaf.io

The Leaf widget URL must be registered as a valid "Authentication Callback URL" in your Trimble application. Check this section for more information.

Endpoints

DescriptionEndpoints
Get all Trimble app informationGET /app-keys/Trimble
Get a Trimble app informationGET /app-keys/Trimble/{appName}
Create a Trimble app informationPOST /app-keys/Trimble/{appName}
Update a Trimble app informationPUT /app-keys/Trimble/{appName}
Delete a Trimble app informationDELETE /app-keys/Trimble/{appName}

Get all Trimble app information

 GET /app-keys/Trimble

Get all Trimble app information from the API Owner.

Request examples
curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/app-keys/Trimble'
Response
[
{
"provider": "providerName",
"appName": "yourAppName",
"clientEnvironment": "PRODUCTION",
"createdTime": "yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'"
},
{
"provider": "providerName",
"appName": "yourAppName",
"clientEnvironment": "PRODUCTION",
"createdTime": "yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'"
}
]

Get a Trimble app information

 GET /app-keys/Trimble/{appName}

Get a Trimble app information from the API Owner.

Request examples
curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/app-keys/Trimble/{appName}'
Response
{
"provider": "providerName",
"appName": "yourAppName",
"clientEnvironment": "PRODUCTION",
"createdTime": "yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'"
}

Create a Trimble app information

 POST /app-keys/Trimble/{appName}

Create a Trimble app information.

Request body
{
"applicationName": "string",
"clientId": "string",
"clientSecret": "string"
}
Request examples
curl -X POST \
-H 'Authorization: Bearer YOUR_TOKEN' \
-d '{ "applicationName": "string", "clientId": "string", "clientSecret": "string" }'
'https://api.withleaf.io/services/usermanagement/api/app-keys/Trimble/{appName}'

Update a Trimble app information

 PUT /app-keys/Trimble/{appName}

Update a Trimble app information.

Request body
{
"applicationName": "string",
"clientId": "string",
"clientSecret": "string"
}
Request examples
curl -X PUT \
-H 'Authorization: Bearer YOUR_TOKEN' \
-d '{ "applicationName": "string", "clientId": "string", "clientSecret": "string" }'
'https://api.withleaf.io/services/usermanagement/api/app-keys/Trimble/{appName}'

Delete a Trimble app information

 DELETE /app-keys/Trimble/{appName}

Delete a Trimble app information.

Request examples
curl -X DELETE \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/app-keys/Trimble/{appName}'

Raven Slingshot

To enable Raven Slingshot as a provider in the widget you need to have your application already registered with Raven Slingshot. You can find more info on how to create a developer account here.

Endpoints

DescriptionEndpoints
Get all Raven Slingshot app informationGET /app-keys/RavenSlingshot
Get a Raven Slingshot app informationGET /app-keys/RavenSlingshot/{appName}
Create a Raven Slingshot app informationPOST /app-keys/RavenSlingshot/{appName}
Update a Raven Slingshot app informationPUT /app-keys/RavenSlingshot/{appName}
Delete a Raven Slingshot app informationDELETE /app-keys/RavenSlingshot/{appName}

Get all Raven Slingshot app information

 GET /app-keys/RavenSlingshot

Get all Raven Slingshot app information from the API Owner.

Request examples
curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/app-keys/RavenSlingshot'
Response
[
{
"provider": "providerName",
"appName": "yourAppName",
"clientEnvironment": "PRODUCTION",
"createdTime": "yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'"
},
{
"provider": "providerName",
"appName": "yourAppName",
"clientEnvironment": "PRODUCTION",
"createdTime": "yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'"
}
]

Get a Raven Slingshot app information

 GET /app-keys/RavenSlingshot/{appName}

Get a Raven Slingshot app information from the API Owner.

Request examples
curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/app-keys/RavenSlingshot/{appName}'
Response
{
"provider": "providerName",
"appName": "yourAppName",
"clientEnvironment": "PRODUCTION",
"createdTime": "yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'"
}

Create a Raven Slingshot app information

 POST /app-keys/RavenSlingshot/{appName}

Create a Raven Slingshot app information.

Request body
{
"apiKey": "string",
"sharedSecret": "string"
}
Request examples
curl -X POST \
-H 'Authorization: Bearer YOUR_TOKEN' \
-d '{ "apiKey": "string", "sharedSecret": "string" }'
'https://api.withleaf.io/services/usermanagement/api/app-keys/RavenSlingshot/{appName}'

Update a Raven Slingshot app information

 PUT /app-keys/RavenSlingshot/{appName}

Update a Raven Slingshot app information.

Request body
{
"apiKey": "string",
"sharedSecret": "string"
}
Request examples
curl -X PUT \
-H 'Authorization: Bearer YOUR_TOKEN' \
-d '{ "apiKey": "string", "sharedSecret": "string" }'
'https://api.withleaf.io/services/usermanagement/api/app-keys/RavenSlingshot/{appName}'

Delete a Raven Slingshot app information

 DELETE /app-keys/RavenSlingshot/{appName}

Delete a Raven Slingshot app information.

Request examples
curl -X DELETE \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/app-keys/RavenSlingshot/{appName}'