From edae2a1129aac61af8868572a78fced8e7b4a4fe Mon Sep 17 00:00:00 2001 From: ricardosantacattarina Date: Mon, 28 Jun 2021 14:09:43 -0300 Subject: [PATCH 1/3] Add new credentials endpoints and update part of old endpoints documentation --- docs/user_management_endpoints.md | 1495 +++++++++++++++++++++++++---- 1 file changed, 1308 insertions(+), 187 deletions(-) diff --git a/docs/user_management_endpoints.md b/docs/user_management_endpoints.md index a3bc5587b..0ae39a623 100644 --- a/docs/user_management_endpoints.md +++ b/docs/user_management_endpoints.md @@ -61,12 +61,21 @@ Form of a John Deere Credentials resource: "tokenSecretKey": "str", "accessToken": "str", "refreshToken": "str" - } ``` Endpoints: +``` +GET /users/{leafUserId}/john-deere-credentials +GET /users/{leafUserId}/john-deere-credentials/events +POST /users/{leafUserId}/john-deere-credentials +DELETE /users/{leafUserId}/john-deere-credentials +``` +The above endpoints won't return fields *id* and *apiOwnerUsername*. + +Deprecated Endpoints: + ``` GET /john-deere-credentials/{id} GET /john-deere-credentials @@ -93,13 +102,22 @@ Form of a Climate FieldView Credentials resource: Endpoints: +``` +GET /users/{leafUserId}/climate-field-view-credentials +GET /users/{leafUserId}/climate-field-view-credentials/events +POST /users/{leafUserId}/climate-field-view-credentials +DELETE /users/{leafUserId}/climate-field-view-credentials +``` +The above endpoints won't return fields *id* and *apiOwnerUsername*. + +Deprecated 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: @@ -118,6 +136,16 @@ Form of a Trimble Credentials resource: Endpoints: +``` +GET /users/{leafUserId}/trimble-credentials +GET /users/{leafUserId}/trimble-credentials/events +POST /users/{leafUserId}/trimble-credentials +DELETE /users/{leafUserId}/trimble-credentials +``` +The above endpoints won't return fields *id* and *apiOwnerUsername*. + +Deprecated Endpoints: + ``` GET /trimble-credentials/{id} GET /trimble-credentials @@ -142,6 +170,17 @@ Form of a CNHI Credentials resource: Endpoints: +``` +GET /users/{leafUserId}/cnhi-credentials +GET /users/{leafUserId}/cnhi-credentials/events +POST /users/{leafUserId}/cnhi-credentials +DELETE /users/{leafUserId}/cnhi-credentials +``` + +The above endpoints won't return fields *id* and *apiOwnerUsername*. + +Deprecated Endpoints: + ``` GET /cnhi-credentials/{id} GET /cnhi-credentials @@ -537,10 +576,9 @@ Deletes an existing Leaf User by 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. If during a background processing for Fields or Operations file we detect that this credential is no longer valid, the value of valid will be changed to false. +Get the John Deere credentials of the user based own its id and returns a JSON with the credentials. If during a background processing for Fields or Operations file we detect that this credentials is no longer valid, the value of the status will be changed. #### Response @@ -552,7 +590,7 @@ Get the John Deere credentials of the user based own his id and returns a JSON w "clientSecret": "str", "tokenId": "str", "tokenSecretKey": "str", - "valid": "true/false" + "status": "str" } ``` @@ -684,7 +722,7 @@ Gets all John Deere Credentials. ### `POST /john-deere-credentials` -Create a John Deere credential for the Leaf User. +Create a John Deere credentials for the Leaf User. #### Request body @@ -777,7 +815,7 @@ A John Deere Credentials object with the id assigned to it. -### `DELETE john-deere-credentials/{id}` +### `DELETE /john-deere-credentials/{id}` Delete a John Deere credentials by id. @@ -831,20 +869,22 @@ Delete a John Deere credentials by id. -### `GET climate-field-credentials/{id}` +### `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 a background processing for Fields or Operations file we detect that this credentials is no longer valid, the value of the status will be changed. -Get a Climate Field View Credentials object by its id. If during a background processing for Fields or Operations file we detect that this credential is no longer valid, the value of valid will be changed to false. #### Response ```json { - "id": "UUID", - "clientId": "", - "clientSecret": "", - "apiKey": "", - "refreshToken": "", - "valid": "true/false" + "clientKey": "str", + "clientSecret": "str", + "tokenId": "str", + "tokenSecretKey": "str", + "accessToken": "str", + "refreshToken": "str", + "status": "str" } ``` @@ -862,10 +902,10 @@ Get a Climate Field View Credentials object by its id. If during a background pr const axios = require('axios') const TOKEN = 'YOUR_TOKEN' - const endpoint = 'https://api.withleaf.io/services/usermanagement/api/climate-field-view-credentials/{id}' + const endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/john-deere-credentials' const headers = { 'Authorization': `Bearer ${TOKEN}` } - axios.get(endpoint, { headers, data }) + axios.get(endpoint, { headers }) .then(res => console.log(res.data)) .catch(console.error) ``` @@ -878,7 +918,7 @@ Get a Climate Field View Credentials object by its id. If during a background pr TOKEN = 'YOUR_TOKEN' - endpoint = 'https://api.withleaf.io/services/usermanagement/api/climate-field-view-credentials/{id}' + endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/john-deere-credentials' headers = {'Authorization': f'Bearer {TOKEN}'} response = requests.get(endpoint, headers=headers) @@ -891,31 +931,20 @@ Get a Climate Field View Credentials object by its id. If during a background pr ```shell curl -X GET \ -H 'Authorization: Bearer YOUR_TOKEN' \ - 'https://api.withleaf.io/services/usermanagement/api/climate-field-view-credentials/{id}' + 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/john-deere-credentials' ``` -### `GET /climate-field-credentials` -Gets all the Climate Field View credentials. +### `GET /users/{leafUserId}/john-deere-credentials/events` -#### Response +Get all events of the Leaf User's John Deere credentials. -```json -[ - { - "id": "UUID", - "clientId": "", - "clientSecret": "", - "apiKey": "", - "refreshToken": "", - "valid": "true/false" - } -] -``` +#### Response +Json array of credentials events. console.log(res.data)) .catch(console.error) ``` @@ -947,9 +976,16 @@ Gets all the Climate Field View credentials. TOKEN = 'YOUR_TOKEN' - endpoint = 'https://api.withleaf.io/services/usermanagement/api/climate-field-view-credentials' + endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/john-deere-credentials/events' headers = {'Authorization': f'Bearer {TOKEN}'} + data = { + 'name': 'str", + 'email': 'help@withleaf.io', + 'phone': 'str', + 'address': 'str', + } + response = requests.get(endpoint, headers=headers) print(response.json()) ``` @@ -960,94 +996,41 @@ Gets all the Climate Field View credentials. ```shell curl -X GET \ -H 'Authorization: Bearer YOUR_TOKEN' \ - 'https://api.withleaf.io/services/usermanagement/api/climate-field-view-credentials' + 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/john-deere-credentials/events' ``` -### `DELETE /climate-field-view-credentials/{id}` -Deletes a "Climate Field View Credentials" by id. - - - - - - ```js - const axios = require('axios') - const TOKEN = 'YOUR_TOKEN' - - const endpoint = 'https://api.withleaf.io/services/usermanagement/api/climate-field-view-credentials' - const headers = { 'Authorization': `Bearer ${TOKEN}` } - - axios.delete(endpoint, { headers }) - .then(res => console.log(res.data)) - .catch(console.error) - ``` - - - - - ```py - import requests - - TOKEN = 'YOUR_TOKEN' - - endpoint = 'https://api.withleaf.io/services/usermanagement/api/climate-field-view-credentials/{id}' - headers = {'Authorization': f'Bearer {TOKEN}'} - - response = requests.post(endpoint, headers=headers) - print(response.json()) - ``` - - - - - ```shell - curl -X DELETE \ - -H 'Authorization: Bearer YOUR_TOKEN' \ - 'https://api.withleaf.io/services/usermanagement/api/climate-field-view-credentials/{id}' - ``` - - - +### `POST /users/{leafUserId}/john-deere-credentials` - -### `POST /climate-field-credentials` -Create a Climate Field View credential for the Leaf User. +Create a John Deere credentials for the Leaf User. #### Request body ```json { - "id": "UUID", - "clientId": "str", + "clientKey": "str", "clientSecret": "str", - "apiKey": "str", + "accessToken": "str", "refreshToken": "str" } ``` #### Response - -A Leaf User with the id assigned to it. +A John Deere credentials object. ```json { - "id": "UUID", - "clientKey": "str", - "clientSecret": "str", - "tokenId": "str", - "tokenSecretKey": "str" - } + "clientKey": "str", + "clientSecret": "str", + "tokenId": "str", + "tokenSecretKey": "str", + "accessToken": "str", + "refreshToken": "str", + "status": "str", +} ``` @@ -1065,7 +1048,7 @@ A Leaf User with the id assigned to it. const axios = require('axios') const TOKEN = 'YOUR_TOKEN' - const endpoint = 'https://{{url}}/services/usermanagement/api/climate-field-view-credentials' + const endpoint = 'https://{{url}}/services/usermanagement/api/users/{leafUserId}/john-deere-credentials' const headers = { 'Authorization': `Bearer ${TOKEN}` } const data = { @@ -1089,7 +1072,7 @@ A Leaf User with the id assigned to it. TOKEN = 'YOUR_TOKEN' - endpoint = 'https://{{url}}/services/usermanagement/api/climate-field-view-credentials' + endpoint = 'https://{{url}}/services/usermanagement/api/users/{leafUserId}/john-deere-credentials' headers = {'Authorization': f'Bearer {TOKEN}'} data = { @@ -1110,27 +1093,23 @@ A Leaf User 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/climate-field-view-credentials' + 'https://{{url}}/services/usermanagement/api/users/{leafUserId}/john-deere-credentials' ``` -### `GET /trimble-credentials/{id}` - -Get a "Trimble Credentials" resource by its id. - -#### Response -A "Trimble Credentials" resource as a JSON. +### `DELETE /users/{leafUserId}/john-deere-credentials` +Delete Leaf User's John Deere credentials. @@ -1139,10 +1118,10 @@ A "Trimble Credentials" resource as a JSON. const axios = require('axios') const TOKEN = 'YOUR_TOKEN' - const endpoint = 'https://api.withleaf.io/services/usermanagement/api/trimble-credentials/{id}' + const endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/john-deere-credentials' const headers = { 'Authorization': `Bearer ${TOKEN}` } - axios.get(endpoint, { headers }) + axios.delete(endpoint, { headers }) .then(res => console.log(res.data)) .catch(console.error) ``` @@ -1155,10 +1134,10 @@ A "Trimble Credentials" resource as a JSON. TOKEN = 'YOUR_TOKEN' - endpoint = 'https://api.withleaf.io/services/usermanagement/api/trimble-credentials/{id}' + endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/john-deere-credentials' headers = {'Authorization': f'Bearer {TOKEN}'} - response = requests.get(endpoint, headers=headers) + response = requests.delete(endpoint, headers=headers) print(response.json()) ``` @@ -1166,29 +1145,38 @@ A "Trimble Credentials" resource as a JSON. ```shell - curl -X GET \ + curl -X DELETE \ -H 'Authorization: Bearer YOUR_TOKEN' \ - 'https://api.withleaf.io/services/usermanagement/api/trimble-credentials/{id}' + 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/john-deere-credentials' ``` -### `GET /trimble-credentials` +### `GET /climate-field-view-credentials/{id}` -Gets all Trimble Credentials. +Get a Climate Field View credentials object by its id. If during a background processing for Fields or Operations file we detect that this credentials is no longer valid, the value of valid will be changed to false. #### Response -A JSON array with Trimble Credentials. +```json +{ + "id": "UUID", + "clientId": "", + "clientSecret": "", + "apiKey": "", + "refreshToken": "", + "valid": "true/false" +} +``` @@ -1197,10 +1185,10 @@ A JSON array with Trimble Credentials. const axios = require('axios') const TOKEN = 'YOUR_TOKEN' - const endpoint = 'https://api.withleaf.io/services/usermanagement/api/trimble-credentials' + const endpoint = 'https://api.withleaf.io/services/usermanagement/api/climate-field-view-credentials/{id}' const headers = { 'Authorization': `Bearer ${TOKEN}` } - axios.get(endpoint, { headers }) + axios.get(endpoint, { headers, data }) .then(res => console.log(res.data)) .catch(console.error) ``` @@ -1213,16 +1201,9 @@ A JSON array with Trimble Credentials. TOKEN = 'YOUR_TOKEN' - endpoint = 'https://api.withleaf.io/services/usermanagement/api/trimble-credentials' + endpoint = 'https://api.withleaf.io/services/usermanagement/api/climate-field-view-credentials/{id}' headers = {'Authorization': f'Bearer {TOKEN}'} - data = { - 'name': 'str", - 'email': 'help@withleaf.io', - 'phone': 'str', - 'address': 'str', - } - response = requests.get(endpoint, headers=headers) print(response.json()) ``` @@ -1233,37 +1214,38 @@ A JSON array with Trimble Credentials. ```shell curl -X GET \ -H 'Authorization: Bearer YOUR_TOKEN' \ - 'https://api.withleaf.io/services/usermanagement/api/trimble-credentials' + 'https://api.withleaf.io/services/usermanagement/api/climate-field-view-credentials/{id}' ``` +### `GET /climate-field-view-credentials` -### `POST /trimble-credentials` -Create a "Trimble Credentials" for the Leaf User. +Gets all the Climate Field View credentials. -#### Request body -A "Trimble Credentials" without id. +#### Response ```json -{ - "userName": "str", - "password": "str", - "applicationName": "str", - "serviceIdentityId": "str" -} +[ + { + "id": "UUID", + "clientId": "", + "clientSecret": "", + "apiKey": "", + "refreshToken": "", + "valid": "true/false" + } +] ``` -#### Response -A "Trimble Credentials" with the id assigned to it. @@ -1272,18 +1254,10 @@ A "Trimble Credentials" with the id assigned to it. const axios = require('axios') const TOKEN = 'YOUR_TOKEN' - const endpoint = 'https://{{url}}/services/usermanagement/api/trimble-credentials' + const endpoint = 'https://api.withleaf.io/services/usermanagement/api/climate-field-view-credentials' const headers = { 'Authorization': `Bearer ${TOKEN}` } - const data = { - id: "UUID", - name: "str", - email: "help@withleaf.io", - phone: "str", - address: "str" - } - - axios.post(endpoint, { headers, data }) + axios.get(endpoint, { headers, data }) .then(res => console.log(res.data)) .catch(console.error) ``` @@ -1296,17 +1270,10 @@ A "Trimble Credentials" with the id assigned to it. TOKEN = 'YOUR_TOKEN' - endpoint = 'https://{{url}}/services/usermanagement/api/trimble-credentials' + endpoint = 'https://api.withleaf.io/services/usermanagement/api/climate-field-view-credentials' headers = {'Authorization': f'Bearer {TOKEN}'} - data = { - 'name': 'str", - 'email': 'help@withleaf.io', - 'phone': 'str', - 'address': 'str', - } - - response = requests.post(endpoint, headers=headers, json=data) + response = requests.get(endpoint, headers=headers) print(response.json()) ``` @@ -1314,34 +1281,931 @@ A "Trimble Credentials" with the id assigned to it. ```shell - curl -X POST \ + curl -X GET \ -H 'Authorization: Bearer YOUR_TOKEN' \ - -d '{ "name": "str", "email": "help@withleaf.io", "phone": "str", "address": "str"}' - 'https://{{url}}/services/usermanagement/api/trimble-credentials' + 'https://api.withleaf.io/services/usermanagement/api/climate-field-view-credentials' ``` -### `DELETE trimble-credentials/{id}` -Delete a Trimble Credentials resource by id. +### `POST /climate-field-view-credentials` +Create a Climate Field View credentials for the Leaf User. - +#### Request body + +```json +{ + "id": "UUID", + "clientId": "str", + "clientSecret": "str", + "apiKey": "str", + "refreshToken": "str" +} +``` + +#### Response + +A Climate Field View credentials. + +```json +{ + "id": "UUID", + "clientKey": "str", + "clientSecret": "str", + "tokenId": "str", + "tokenSecretKey": "str" + } +``` + + + + + + ```js + const axios = require('axios') + const TOKEN = 'YOUR_TOKEN' + + const endpoint = 'https://{{url}}/services/usermanagement/api/climate-field-view-credentials' + const headers = { 'Authorization': `Bearer ${TOKEN}` } + + const data = { + id: "UUID", + name: "str", + email: "help@withleaf.io", + phone: "str", + address: "str" + } + + axios.post(endpoint, { headers, data }) + .then(res => console.log(res.data)) + .catch(console.error) + ``` + + + + + ```py + import requests + + TOKEN = 'YOUR_TOKEN' + + endpoint = 'https://{{url}}/services/usermanagement/api/climate-field-view-credentials' + headers = {'Authorization': f'Bearer {TOKEN}'} + + data = { + 'name': 'str", + 'email': 'help@withleaf.io', + 'phone': 'str', + 'address': 'str', + } + + response = requests.post(endpoint, headers=headers, json=data) + print(response.json()) + ``` + + + + + ```shell + 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' + ``` + + + + +### `DELETE /climate-field-view-credentials/{id}` +Deletes a "Climate Field View Credentials" by id. + + + + + + ```js + const axios = require('axios') + const TOKEN = 'YOUR_TOKEN' + + const endpoint = 'https://api.withleaf.io/services/usermanagement/api/climate-field-view-credentials' + const headers = { 'Authorization': `Bearer ${TOKEN}` } + + axios.delete(endpoint, { headers }) + .then(res => console.log(res.data)) + .catch(console.error) + ``` + + + + + ```py + import requests + + TOKEN = 'YOUR_TOKEN' + + endpoint = 'https://api.withleaf.io/services/usermanagement/api/climate-field-view-credentials/{id}' + headers = {'Authorization': f'Bearer {TOKEN}'} + + response = requests.post(endpoint, headers=headers) + print(response.json()) + ``` + + + + + ```shell + curl -X DELETE \ + -H 'Authorization: Bearer YOUR_TOKEN' \ + 'https://api.withleaf.io/services/usermanagement/api/climate-field-view-credentials/{id}' + ``` + + + + + +### `GET /users/{leafUserId}/climate-field-view-credentials` + +Get the Climate Field View credentials of the Leaf User based on its id and returns a JSON with the credentials. If during a background processing for Fields or Operations file we detect that this credentials is no longer valid, the value of status will be changed. + +#### Response + +```json +{ + "clientId": "str", + "clientSecret": "str", + "apiKey": "str", + "refreshToken": "str", + "status": "str" +} +``` + + + + + ```js + const axios = require('axios') + const TOKEN = 'YOUR_TOKEN' + + const endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/climate-field-view-credentials' + const headers = { 'Authorization': `Bearer ${TOKEN}` } + + axios.get(endpoint, { headers, data }) + .then(res => console.log(res.data)) + .catch(console.error) + ``` + + + + + ```py + import requests + + TOKEN = 'YOUR_TOKEN' + + endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/climate-field-view-credentials' + headers = {'Authorization': f'Bearer {TOKEN}'} + + response = requests.get(endpoint, headers=headers) + print(response.json()) + ``` + + + + + ```shell + curl -X GET \ + -H 'Authorization: Bearer YOUR_TOKEN' \ + 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/climate-field-view-credentials' + ``` + + + + +### `GET /users/{leafUserId}/climate-field-view-credentials/events` + +Get all events of the Leaf User's Climate Field View credentials. + +#### Response + +```json +[ + { + "id": "UUID", + "clientId": "", + "clientSecret": "", + "apiKey": "", + "refreshToken": "", + "valid": "true/false" + } +] +``` + + + + + + ```js + const axios = require('axios') + const TOKEN = 'YOUR_TOKEN' + + const endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/climate-field-view-credentials/events' + const headers = { 'Authorization': `Bearer ${TOKEN}` } + + axios.get(endpoint, { headers, data }) + .then(res => console.log(res.data)) + .catch(console.error) + ``` + + + + + ```py + import requests + + TOKEN = 'YOUR_TOKEN' + + endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/climate-field-view-credentials/events' + headers = {'Authorization': f'Bearer {TOKEN}'} + + response = requests.get(endpoint, headers=headers) + print(response.json()) + ``` + + + + + ```shell + curl -X GET \ + -H 'Authorization: Bearer YOUR_TOKEN' \ + 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/climate-field-view-credentials/events' + ``` + + + + + +### `POST /users/{leafUserId}/climate-field-view-credentials` +Create a Climate Field View credentials for the Leaf User. + +#### Request body + +```json +{ + "id": "UUID", + "clientId": "str", + "clientSecret": "str", + "apiKey": "str", + "refreshToken": "str" +} +``` + +#### Response + +A Leaf User with the id assigned to it. + +```json +{ + "id": "UUID", + "clientKey": "str", + "clientSecret": "str", + "tokenId": "str", + "tokenSecretKey": "str" + } +``` + + + + + + ```js + const axios = require('axios') + const TOKEN = 'YOUR_TOKEN' + + const endpoint = 'https://{{url}}/services/usermanagement/api/users/{leafUserId}/climate-field-view-credentials' + const headers = { 'Authorization': `Bearer ${TOKEN}` } + + const data = { + id: "UUID", + name: "str", + email: "help@withleaf.io", + phone: "str", + address: "str" + } + + axios.post(endpoint, { headers, data }) + .then(res => console.log(res.data)) + .catch(console.error) + ``` + + + + + ```py + import requests + + TOKEN = 'YOUR_TOKEN' + + endpoint = 'https://{{url}}/services/usermanagement/api/users/{leafUserId}/climate-field-view-credentials' + headers = {'Authorization': f'Bearer {TOKEN}'} + + data = { + 'name': 'str", + 'email': 'help@withleaf.io', + 'phone': 'str', + 'address': 'str', + } + + response = requests.post(endpoint, headers=headers, json=data) + print(response.json()) + ``` + + + + + ```shell + curl -X POST \ + -H 'Authorization: Bearer YOUR_TOKEN' \ + -d '{ "name": "str", "email": "help@withleaf.io", "phone": "str", "address": "str"}' + 'https://{{url}}/services/usermanagement/api/users/{leafUserId}/climate-field-view-credentials' + ``` + + + + +### `DELETE /users/{leafUserId}/climate-field-view-credentials` + +Delete Leaf User's Climate Field View credentials. + + + + + ```js + const axios = require('axios') + const TOKEN = 'YOUR_TOKEN' + + const endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/climate-field-view-credentials' + const headers = { 'Authorization': `Bearer ${TOKEN}` } + + axios.delete(endpoint, { headers }) + .then(res => console.log(res.data)) + .catch(console.error) + ``` + + + + + ```py + import requests + + TOKEN = 'YOUR_TOKEN' + + endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/climate-field-view-credentials' + headers = {'Authorization': f'Bearer {TOKEN}'} + + response = requests.post(endpoint, headers=headers) + print(response.json()) + ``` + + + + + ```shell + curl -X DELETE \ + -H 'Authorization: Bearer YOUR_TOKEN' \ + 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/climate-field-view-credentials' + ``` + + + + + +### `GET /trimble-credentials/{id}` + +Get a "Trimble Credentials" resource by its id. + +#### Response +A "Trimble Credentials" resource as a JSON. + + + + + + ```js + const axios = require('axios') + const TOKEN = 'YOUR_TOKEN' + + const endpoint = 'https://api.withleaf.io/services/usermanagement/api/trimble-credentials/{id}' + const headers = { 'Authorization': `Bearer ${TOKEN}` } + + axios.get(endpoint, { headers }) + .then(res => console.log(res.data)) + .catch(console.error) + ``` + + + + + ```py + import requests + + TOKEN = 'YOUR_TOKEN' + + endpoint = 'https://api.withleaf.io/services/usermanagement/api/trimble-credentials/{id}' + headers = {'Authorization': f'Bearer {TOKEN}'} + + response = requests.get(endpoint, headers=headers) + print(response.json()) + ``` + + + + + ```shell + 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. + + + + + + ```js + const axios = require('axios') + const TOKEN = 'YOUR_TOKEN' + + const endpoint = 'https://api.withleaf.io/services/usermanagement/api/trimble-credentials' + const headers = { 'Authorization': `Bearer ${TOKEN}` } + + axios.get(endpoint, { headers }) + .then(res => console.log(res.data)) + .catch(console.error) + ``` + + + + + ```py + import requests + + TOKEN = 'YOUR_TOKEN' + + endpoint = 'https://api.withleaf.io/services/usermanagement/api/trimble-credentials' + headers = {'Authorization': f'Bearer {TOKEN}'} + + data = { + 'name': 'str", + 'email': 'help@withleaf.io', + 'phone': 'str', + 'address': 'str', + } + + response = requests.get(endpoint, headers=headers) + print(response.json()) + ``` + + + + + ```shell + 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. + +```json +{ + "userName": "str", + "password": "str", + "applicationName": "str", + "serviceIdentityId": "str" +} +``` + +#### Response +A "Trimble Credentials" with the id assigned to it. + + + + + ```js + const axios = require('axios') + const TOKEN = 'YOUR_TOKEN' + + const endpoint = 'https://{{url}}/services/usermanagement/api/trimble-credentials' + const headers = { 'Authorization': `Bearer ${TOKEN}` } + + const data = { + id: "UUID", + name: "str", + email: "help@withleaf.io", + phone: "str", + address: "str" + } + + axios.post(endpoint, { headers, data }) + .then(res => console.log(res.data)) + .catch(console.error) + ``` + + + + + ```py + import requests + + TOKEN = 'YOUR_TOKEN' + + endpoint = 'https://{{url}}/services/usermanagement/api/trimble-credentials' + headers = {'Authorization': f'Bearer {TOKEN}'} + + data = { + 'name': 'str", + 'email': 'help@withleaf.io', + 'phone': 'str', + 'address': 'str', + } + + response = requests.post(endpoint, headers=headers, json=data) + print(response.json()) + ``` + + + + + ```shell + 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. + + + + + ```js + const axios = require('axios') + const TOKEN = 'YOUR_TOKEN' + + const endpoint = 'https://api.withleaf.io/services/usermanagement/api/trimble-credentials/{id}' + const headers = { 'Authorization': `Bearer ${TOKEN}` } + + axios.delete(endpoint, { headers }) + .then(res => console.log(res.data)) + .catch(console.error) + ``` + + + + + ```py + import requests + + TOKEN = 'YOUR_TOKEN' + + endpoint = 'https://api.withleaf.io/services/usermanagement/api/trimble-credentials/{id}' + headers = {'Authorization': f'Bearer {TOKEN}'} + + response = requests.delete(endpoint, headers=headers) + print(response.json()) + ``` + + + + + ```shell + curl -X DELETE \ + -H 'Authorization: Bearer YOUR_TOKEN' \ + 'https://api.withleaf.io/services/usermanagement/api/trimble-credentials/{id}' + ``` + + + + +### `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. + + + + + + ```js + const axios = require('axios') + const TOKEN = 'YOUR_TOKEN' + + const endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/trimble-credentials' + const headers = { 'Authorization': `Bearer ${TOKEN}` } + + axios.get(endpoint, { headers }) + .then(res => console.log(res.data)) + .catch(console.error) + ``` + + + + + ```py + import requests + + TOKEN = 'YOUR_TOKEN' + + endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/trimble-credentials' + headers = {'Authorization': f'Bearer {TOKEN}'} + + response = requests.get(endpoint, headers=headers) + print(response.json()) + ``` + + + + + ```shell + curl -X GET \ + -H 'Authorization: Bearer YOUR_TOKEN' \ + 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/trimble-credentials' + ``` + + + + + +### `GET /users/{leafUserId}/trimble-credentials/events` + +Gets all events of the Leaf User's Trimble credentials. + +#### Response +A JSON array with Trimble credentials' events. + + + + + ```js + const axios = require('axios') + const TOKEN = 'YOUR_TOKEN' + + const endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/trimble-credentials/events' + const headers = { 'Authorization': `Bearer ${TOKEN}` } + + axios.get(endpoint, { headers }) + .then(res => console.log(res.data)) + .catch(console.error) + ``` + + + + + ```py + import requests + + TOKEN = 'YOUR_TOKEN' + + endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/trimble-credentials/events' + headers = {'Authorization': f'Bearer {TOKEN}'} + + data = { + 'name': 'str", + 'email': 'help@withleaf.io', + 'phone': 'str', + 'address': 'str', + } + + response = requests.get(endpoint, headers=headers) + print(response.json()) + ``` + + + + + ```shell + curl -X GET \ + -H 'Authorization: Bearer YOUR_TOKEN' \ + 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/trimble-credentials/events' + ``` + + + + + +### `POST /users/{leafUserId}/trimble-credentials` +Create a Trimble credentials for the Leaf User. + +#### Request body +A Trimble credentials. + +```json +{ + "userName": "str", + "password": "str", + "applicationName": "str", + "serviceIdentityId": "str" +} +``` + +#### Response +A Trimble credentials. + + + + + ```js + const axios = require('axios') + const TOKEN = 'YOUR_TOKEN' + + const endpoint = 'https://{{url}}/services/usermanagement/api/users/{leafUserId}/trimble-credentials' + const headers = { 'Authorization': `Bearer ${TOKEN}` } + + const data = { + id: "UUID", + name: "str", + email: "help@withleaf.io", + phone: "str", + address: "str" + } + + axios.post(endpoint, { headers, data }) + .then(res => console.log(res.data)) + .catch(console.error) + ``` + + + + + ```py + import requests + + TOKEN = 'YOUR_TOKEN' + + endpoint = 'https://{{url}}/services/usermanagement/api/users/{leafUserId}/trimble-credentials' + headers = {'Authorization': f'Bearer {TOKEN}'} + + data = { + 'name': 'str", + 'email': 'help@withleaf.io', + 'phone': 'str', + 'address': 'str', + } + + response = requests.post(endpoint, headers=headers, json=data) + print(response.json()) + ``` + + + + + ```shell + curl -X POST \ + -H 'Authorization: Bearer YOUR_TOKEN' \ + -d '{ "name": "str", "email": "help@withleaf.io", "phone": "str", "address": "str"}' + 'https://{{url}}/services/usermanagement/api/users/{leafUserId}/trimble-credentials' + ``` + + + + + +### `DELETE /users/{leafUserId}/trimble-credentials` +Delete a Leaf User's Trimble credentials. + + ```js const axios = require('axios') const TOKEN = 'YOUR_TOKEN' - const endpoint = 'https://api.withleaf.io/services/usermanagement/api/trimble-credentials/{id}' + const endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/trimble-credentials' const headers = { 'Authorization': `Bearer ${TOKEN}` } axios.delete(endpoint, { headers }) @@ -1357,7 +2221,7 @@ Delete a Trimble Credentials resource by id. TOKEN = 'YOUR_TOKEN' - endpoint = 'https://api.withleaf.io/services/usermanagement/api/trimble-credentials/{id}' + endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/trimble-credentials' headers = {'Authorization': f'Bearer {TOKEN}'} response = requests.delete(endpoint, headers=headers) @@ -1370,7 +2234,7 @@ Delete a Trimble Credentials resource by id. ```shell curl -X DELETE \ -H 'Authorization: Bearer YOUR_TOKEN' \ - 'https://api.withleaf.io/services/usermanagement/api/trimble-credentials/{id}' + 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/trimble-credentials' ``` @@ -1435,6 +2299,7 @@ A "CNHI Credentials" resource as a JSON. + ### `GET /cnhi-credentials` Gets all CNHI Credentials. @@ -1583,7 +2448,7 @@ A "CNHI Credentials" with the id assigned to it. -### `DELETE cnhi-credentials/{id}` +### `DELETE /cnhi-credentials/{id}` Delete a CNHI Credentials resource by id. +### `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. + + + + + ```js + const axios = require('axios') + const TOKEN = 'YOUR_TOKEN' + + const endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/cnhi-credentials' + const headers = { 'Authorization': `Bearer ${TOKEN}` } + + axios.get(endpoint, { headers }) + .then(res => console.log(res.data)) + .catch(console.error) + ``` + + + + + ```py + import requests + + TOKEN = 'YOUR_TOKEN' + + endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/cnhi-credentials' + headers = {'Authorization': f'Bearer {TOKEN}'} + + response = requests.get(endpoint, headers=headers) + print(response.json()) + ``` + + + + + ```shell + curl -X GET \ + -H 'Authorization: Bearer YOUR_TOKEN' \ + 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/cnhi-credentials' + ``` + + + + + +### `GET /users/{leafUserId}/cnhi-credentials/events` + +Get all events of the Leaf User's CNHI credentials. + +#### Response +A JSON array with CNHI credentials. + + + + + ```js + const axios = require('axios') + const TOKEN = 'YOUR_TOKEN' + + const endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/cnhi-credentials/events' + const headers = { 'Authorization': `Bearer ${TOKEN}` } + + axios.get(endpoint, { headers }) + .then(res => console.log(res.data)) + .catch(console.error) + ``` + + + + + ```py + import requests + + TOKEN = 'YOUR_TOKEN' + + endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/cnhi-credentials/events' + headers = {'Authorization': f'Bearer {TOKEN}'} + + data = { + 'name': 'str", + 'email': 'help@withleaf.io', + 'phone': 'str', + 'address': 'str', + } + + response = requests.get(endpoint, headers=headers) + print(response.json()) + ``` + + + + + ```shell + curl -X GET \ + -H 'Authorization: Bearer YOUR_TOKEN' \ + 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/cnhi-credentials/events' + ``` + + + + + +### `POST /users/{leafUserId}/cnhi-credentials` +Create a CNHI credentials for the Leaf User. + +#### Request body +A CNHI credentials. + +```json +{ + "clientId": "", + "clientSecret": "", + "refreshToken": "" +} +``` + +#### Response +A CNHI Credentials with status. + + + + + ```js + const axios = require('axios') + const TOKEN = 'YOUR_TOKEN' + + const endpoint = 'https://{{url}}/services/usermanagement/api/users/{leafUserId}/cnhi-credentials' + const headers = { 'Authorization': `Bearer ${TOKEN}` } + + const data = { + id: "UUID", + name: "str", + email: "help@withleaf.io", + phone: "str", + address: "str" + } + + axios.post(endpoint, { headers, data }) + .then(res => console.log(res.data)) + .catch(console.error) + ``` + + + + + ```py + import requests + + TOKEN = 'YOUR_TOKEN' + + endpoint = 'https://{{url}}/services/usermanagement/api/users/{leafUserId}/cnhi-credentials' + headers = {'Authorization': f'Bearer {TOKEN}'} + + data = { + 'name': 'str", + 'email': 'help@withleaf.io', + 'phone': 'str', + 'address': 'str', + } + + response = requests.post(endpoint, headers=headers, json=data) + print(response.json()) + ``` + + + + + ```shell + curl -X POST \ + -H 'Authorization: Bearer YOUR_TOKEN' \ + -d '{ "name": "str", "email": "help@withleaf.io", "phone": "str", "address": "str"}' + 'https://{{url}}/services/usermanagement/api/users/{leafUserId}/cnhi-credentials' + ``` + + + + + +### `DELETE /users/{leafUserId}/cnhi-credentials` +Delete Leaf User's CNHI credentials. + + + + + ```js + const axios = require('axios') + const TOKEN = 'YOUR_TOKEN' + + const endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/cnhi-credentials' + const headers = { 'Authorization': `Bearer ${TOKEN}` } + + axios.delete(endpoint, { headers }) + .then(res => console.log(res.data)) + .catch(console.error) + ``` + + + + + ```py + import requests + + TOKEN = 'YOUR_TOKEN' + + endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/cnhi-credentials' + headers = {'Authorization': f'Bearer {TOKEN}'} + + response = requests.delete(endpoint, headers=headers) + print(response.json()) + ``` + + + + + ```shell + curl -X DELETE \ + -H 'Authorization: Bearer YOUR_TOKEN' \ + 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/cnhi-credentials' + ``` + + + + :::tip Please don't hesitate to [contact][contact] us to schedule a demo, ask a question, request sample data, or suggest a feature! ::: From 73939d5d93d33fd26bdb38566c5c85a862a10360 Mon Sep 17 00:00:00 2001 From: ricardosantacattarina Date: Mon, 28 Jun 2021 18:36:36 -0300 Subject: [PATCH 2/3] Remove events endpoints --- docs/user_management_endpoints.md | 266 ------------------------------ 1 file changed, 266 deletions(-) diff --git a/docs/user_management_endpoints.md b/docs/user_management_endpoints.md index 0ae39a623..0dc60f65a 100644 --- a/docs/user_management_endpoints.md +++ b/docs/user_management_endpoints.md @@ -68,7 +68,6 @@ Endpoints: ``` GET /users/{leafUserId}/john-deere-credentials -GET /users/{leafUserId}/john-deere-credentials/events POST /users/{leafUserId}/john-deere-credentials DELETE /users/{leafUserId}/john-deere-credentials ``` @@ -104,7 +103,6 @@ Endpoints: ``` GET /users/{leafUserId}/climate-field-view-credentials -GET /users/{leafUserId}/climate-field-view-credentials/events POST /users/{leafUserId}/climate-field-view-credentials DELETE /users/{leafUserId}/climate-field-view-credentials ``` @@ -138,7 +136,6 @@ Endpoints: ``` GET /users/{leafUserId}/trimble-credentials -GET /users/{leafUserId}/trimble-credentials/events POST /users/{leafUserId}/trimble-credentials DELETE /users/{leafUserId}/trimble-credentials ``` @@ -172,7 +169,6 @@ Endpoints: ``` GET /users/{leafUserId}/cnhi-credentials -GET /users/{leafUserId}/cnhi-credentials/events POST /users/{leafUserId}/cnhi-credentials DELETE /users/{leafUserId}/cnhi-credentials ``` @@ -938,71 +934,6 @@ Get the John Deere credentials of the Leaf User based on its id and returns a JS -### `GET /users/{leafUserId}/john-deere-credentials/events` - -Get all events of the Leaf User's John Deere credentials. - -#### Response - -Json array of credentials events. - - - - - ```js - const axios = require('axios') - const TOKEN = 'YOUR_TOKEN' - - const endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/john-deere-credentials/events' - const headers = { 'Authorization': `Bearer ${TOKEN}` } - - axios.get(endpoint, { headers }) - .then(res => console.log(res.data)) - .catch(console.error) - ``` - - - - - ```py - import requests - - TOKEN = 'YOUR_TOKEN' - - endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/john-deere-credentials/events' - headers = {'Authorization': f'Bearer {TOKEN}'} - - data = { - 'name': 'str", - 'email': 'help@withleaf.io', - 'phone': 'str', - 'address': 'str', - } - - response = requests.get(endpoint, headers=headers) - print(response.json()) - ``` - - - - - ```shell - curl -X GET \ - -H 'Authorization: Bearer YOUR_TOKEN' \ - 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/john-deere-credentials/events' - ``` - - - - - ### `POST /users/{leafUserId}/john-deere-credentials` Create a John Deere credentials for the Leaf User. @@ -1504,75 +1435,6 @@ Get the Climate Field View credentials of the Leaf User based on its id and retu -### `GET /users/{leafUserId}/climate-field-view-credentials/events` - -Get all events of the Leaf User's Climate Field View credentials. - -#### Response - -```json -[ - { - "id": "UUID", - "clientId": "", - "clientSecret": "", - "apiKey": "", - "refreshToken": "", - "valid": "true/false" - } -] -``` - - - - - - ```js - const axios = require('axios') - const TOKEN = 'YOUR_TOKEN' - - const endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/climate-field-view-credentials/events' - const headers = { 'Authorization': `Bearer ${TOKEN}` } - - axios.get(endpoint, { headers, data }) - .then(res => console.log(res.data)) - .catch(console.error) - ``` - - - - - ```py - import requests - - TOKEN = 'YOUR_TOKEN' - - endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/climate-field-view-credentials/events' - headers = {'Authorization': f'Bearer {TOKEN}'} - - response = requests.get(endpoint, headers=headers) - print(response.json()) - ``` - - - - - ```shell - curl -X GET \ - -H 'Authorization: Bearer YOUR_TOKEN' \ - 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/climate-field-view-credentials/events' - ``` - - - - ### `POST /users/{leafUserId}/climate-field-view-credentials` Create a Climate Field View credentials for the Leaf User. @@ -2040,70 +1902,6 @@ A Trimble credentials resource as a JSON. -### `GET /users/{leafUserId}/trimble-credentials/events` - -Gets all events of the Leaf User's Trimble credentials. - -#### Response -A JSON array with Trimble credentials' events. - - - - - ```js - const axios = require('axios') - const TOKEN = 'YOUR_TOKEN' - - const endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/trimble-credentials/events' - const headers = { 'Authorization': `Bearer ${TOKEN}` } - - axios.get(endpoint, { headers }) - .then(res => console.log(res.data)) - .catch(console.error) - ``` - - - - - ```py - import requests - - TOKEN = 'YOUR_TOKEN' - - endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/trimble-credentials/events' - headers = {'Authorization': f'Bearer {TOKEN}'} - - data = { - 'name': 'str", - 'email': 'help@withleaf.io', - 'phone': 'str', - 'address': 'str', - } - - response = requests.get(endpoint, headers=headers) - print(response.json()) - ``` - - - - - ```shell - curl -X GET \ - -H 'Authorization: Bearer YOUR_TOKEN' \ - 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/trimble-credentials/events' - ``` - - - - - ### `POST /users/{leafUserId}/trimble-credentials` Create a Trimble credentials for the Leaf User. @@ -2557,70 +2355,6 @@ A CNHI credentials resource as a JSON. -### `GET /users/{leafUserId}/cnhi-credentials/events` - -Get all events of the Leaf User's CNHI credentials. - -#### Response -A JSON array with CNHI credentials. - - - - - ```js - const axios = require('axios') - const TOKEN = 'YOUR_TOKEN' - - const endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/cnhi-credentials/events' - const headers = { 'Authorization': `Bearer ${TOKEN}` } - - axios.get(endpoint, { headers }) - .then(res => console.log(res.data)) - .catch(console.error) - ``` - - - - - ```py - import requests - - TOKEN = 'YOUR_TOKEN' - - endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/cnhi-credentials/events' - headers = {'Authorization': f'Bearer {TOKEN}'} - - data = { - 'name': 'str", - 'email': 'help@withleaf.io', - 'phone': 'str', - 'address': 'str', - } - - response = requests.get(endpoint, headers=headers) - print(response.json()) - ``` - - - - - ```shell - curl -X GET \ - -H 'Authorization: Bearer YOUR_TOKEN' \ - 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/cnhi-credentials/events' - ``` - - - - - ### `POST /users/{leafUserId}/cnhi-credentials` Create a CNHI credentials for the Leaf User. From 9eac8b25fa0de03e858c3aab3eb7bf0c91254435 Mon Sep 17 00:00:00 2001 From: ricardosantacattarina Date: Tue, 29 Jun 2021 18:05:57 -0300 Subject: [PATCH 3/3] Fix request body examples, set urls for api and text description of some endpoints --- docs/user_management_endpoints.md | 289 +++++++++++++----------------- 1 file changed, 123 insertions(+), 166 deletions(-) diff --git a/docs/user_management_endpoints.md b/docs/user_management_endpoints.md index 0dc60f65a..542fd7733 100644 --- a/docs/user_management_endpoints.md +++ b/docs/user_management_endpoints.md @@ -358,14 +358,13 @@ A Leaf User with the id assigned to it and it's credentials. const headers = { 'Authorization': `Bearer ${TOKEN}` } const data = { - id: "UUID", name: "str", email: "help@withleaf.io", phone: "str", address: "str" } - axios.post(endpoint, { headers, data }) + axios.post(endpoint, data, { headers }) .then(res => console.log(res.data)) .catch(console.error) ``` @@ -398,7 +397,7 @@ A Leaf User with the id assigned to it and it's credentials. ```shell curl -X POST \ -H 'Authorization: Bearer YOUR_TOKEN' \ - -d '{ "name": "str", "email": "help@withleaf.io", "phone": "str", "address": "str"}' + -d '{ "name": "str", "email": "help@withleaf.io", "phone": "str", "address": "str"}' \ 'https://api.withleaf.io/services/usermanagement/api/users' ``` @@ -470,7 +469,7 @@ A Leaf User with the id assigned to it and it's credentials. address: "str" } - axios.put(endpoint, { headers, data }) + axios.put(endpoint, data, { headers }) .then(res => console.log(res.data)) .catch(console.error) ``` @@ -487,6 +486,7 @@ A Leaf User with the id assigned to it and it's credentials. headers = {'Authorization': f'Bearer {TOKEN}'} data = { + 'id': "UUID", 'name': 'str", 'email': 'help@withleaf.io', 'phone': 'str', @@ -503,7 +503,7 @@ A Leaf User with the id assigned to it and it's credentials. ```shell curl -X PUT \ -H 'Authorization: Bearer YOUR_TOKEN' \ - -d '{ "name": "str", "email": "help@withleaf.io", "phone": "str", "address": "str"}' + -d '{ "id": "UUID", name": "str", "email": "help@withleaf.io", "phone": "str", "address": "str"}' \ 'https://api.withleaf.io/services/usermanagement/api/users' ``` @@ -548,13 +548,6 @@ Deletes an existing Leaf User by id. endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{id}' headers = {'Authorization': f'Bearer {TOKEN}'} - data = { - 'name': 'str", - 'email': 'help@withleaf.io', - 'phone': 'str', - 'address': 'str', - } - response = requests.delete(endpoint, headers=headers) print(response.json()) ``` @@ -565,7 +558,6 @@ Deletes an existing Leaf User by id. ```shell 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}' ``` @@ -574,7 +566,7 @@ Deletes an existing Leaf User by id. ### `GET /john-deere-credentials/{id}` -Get the John Deere credentials of the user based own its id and returns a JSON with the credentials. If during a background processing for Fields or Operations file we detect that this credentials is no longer valid, the value of the status will be changed. +Get the John Deere credentials of the 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 @@ -692,13 +684,6 @@ Gets all John Deere Credentials. endpoint = 'https://api.withleaf.io/services/usermanagement/api/john-deere-credentials' headers = {'Authorization': f'Bearer {TOKEN}'} - data = { - 'name': 'str", - 'email': 'help@withleaf.io', - 'phone': 'str', - 'address': 'str', - } - response = requests.get(endpoint, headers=headers) print(response.json()) ``` @@ -759,18 +744,17 @@ A John Deere Credentials object with the id assigned to it. const axios = require('axios') const TOKEN = 'YOUR_TOKEN' - const endpoint = 'https://{{url}}/services/usermanagement/api/john-deere-credentials' + const endpoint = 'https://api.withleaf.io/services/usermanagement/api/john-deere-credentials' const headers = { 'Authorization': `Bearer ${TOKEN}` } const data = { - id: "UUID", - name: "str", - email: "help@withleaf.io", - phone: "str", - address: "str" + "clientKey": "str", + "clientSecret": "str", + "tokenId": "str", + "tokenSecretKey": "str" } - axios.post(endpoint, { headers, data }) + axios.post(endpoint, data, { headers }) .then(res => console.log(res.data)) .catch(console.error) ``` @@ -783,14 +767,14 @@ A John Deere Credentials object with the id assigned to it. TOKEN = 'YOUR_TOKEN' - endpoint = 'https://{{url}}/services/usermanagement/api/john-deere-credentials' + endpoint = 'https://api.withleaf.io/services/usermanagement/api/john-deere-credentials' headers = {'Authorization': f'Bearer {TOKEN}'} data = { - 'name': 'str", - 'email': 'help@withleaf.io', - 'phone': 'str', - 'address': 'str', + "clientKey": "str", + "clientSecret": "str", + "tokenId": "str", + "tokenSecretKey": "str" } response = requests.post(endpoint, headers=headers, json=data) @@ -803,8 +787,8 @@ A John Deere Credentials object with the id assigned to it. ```shell 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' + -d '{"clientKey": "str","clientSecret": "str","tokenId": "str","tokenSecretKey": "str"}' \ + 'https://api.withleaf.io/services/usermanagement/api/john-deere-credentials' ``` @@ -867,7 +851,7 @@ Delete a John Deere credentials by id. ### `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 a background processing for Fields or Operations file we detect that this credentials is no longer valid, the value of the status will be changed. +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 @@ -950,7 +934,7 @@ Create a John Deere credentials for the Leaf User. ``` #### Response -A John Deere credentials object. +A John Deere credentials with status. ```json { @@ -979,18 +963,17 @@ A John Deere credentials object. const axios = require('axios') const TOKEN = 'YOUR_TOKEN' - const endpoint = 'https://{{url}}/services/usermanagement/api/users/{leafUserId}/john-deere-credentials' + const endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/john-deere-credentials' const headers = { 'Authorization': `Bearer ${TOKEN}` } const data = { - id: "UUID", - name: "str", - email: "help@withleaf.io", - phone: "str", - address: "str" + "clientKey": "str", + "clientSecret": "str", + "accessToken": "str", + "refreshToken": "str" } - axios.post(endpoint, { headers, data }) + axios.post(endpoint, data, { headers }) .then(res => console.log(res.data)) .catch(console.error) ``` @@ -1003,14 +986,14 @@ A John Deere credentials object. TOKEN = 'YOUR_TOKEN' - endpoint = 'https://{{url}}/services/usermanagement/api/users/{leafUserId}/john-deere-credentials' + endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/john-deere-credentials' headers = {'Authorization': f'Bearer {TOKEN}'} data = { - 'name': 'str", - 'email': 'help@withleaf.io', - 'phone': 'str', - 'address': 'str', + "clientKey": "str", + "clientSecret": "str", + "accessToken": "str", + "refreshToken": "str" } response = requests.post(endpoint, headers=headers, json=data) @@ -1023,8 +1006,8 @@ A John Deere credentials object. ```shell curl -X POST \ -H 'Authorization: Bearer YOUR_TOKEN' \ - -d '{ "name": "str", "email": "help@withleaf.io", "phone": "str", "address": "str"}' - 'https://{{url}}/services/usermanagement/api/users/{leafUserId}/john-deere-credentials' + -d '{"clientKey": "str","clientSecret": "str","accessToken": "str","refreshToken": "str"}' \ + 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/john-deere-credentials' ``` @@ -1087,7 +1070,7 @@ Delete Leaf User's John Deere credentials. ### `GET /climate-field-view-credentials/{id}` -Get a Climate Field View credentials object by its id. If during a background processing for Fields or Operations file we detect that this credentials is no longer valid, the value of valid will be changed to false. +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 valid will be changed. #### Response @@ -1119,7 +1102,7 @@ Get a Climate Field View credentials object by its id. If during a background pr const endpoint = 'https://api.withleaf.io/services/usermanagement/api/climate-field-view-credentials/{id}' const headers = { 'Authorization': `Bearer ${TOKEN}` } - axios.get(endpoint, { headers, data }) + axios.get(endpoint, { headers }) .then(res => console.log(res.data)) .catch(console.error) ``` @@ -1188,7 +1171,7 @@ Gets all the Climate Field View credentials. const endpoint = 'https://api.withleaf.io/services/usermanagement/api/climate-field-view-credentials' const headers = { 'Authorization': `Bearer ${TOKEN}` } - axios.get(endpoint, { headers, data }) + axios.get(endpoint, { headers }) .then(res => console.log(res.data)) .catch(console.error) ``` @@ -1228,7 +1211,6 @@ Create a Climate Field View credentials for the Leaf User. ```json { - "id": "UUID", "clientId": "str", "clientSecret": "str", "apiKey": "str", @@ -1265,18 +1247,17 @@ A Climate Field View credentials. const axios = require('axios') const TOKEN = 'YOUR_TOKEN' - const endpoint = 'https://{{url}}/services/usermanagement/api/climate-field-view-credentials' + const endpoint = 'https://api.withleaf.io/services/usermanagement/api/climate-field-view-credentials' const headers = { 'Authorization': `Bearer ${TOKEN}` } const data = { - id: "UUID", - name: "str", - email: "help@withleaf.io", - phone: "str", - address: "str" + "clientId": "str", + "clientSecret": "str", + "apiKey": "str", + "refreshToken": "str" } - axios.post(endpoint, { headers, data }) + axios.post(endpoint, data, { headers }) .then(res => console.log(res.data)) .catch(console.error) ``` @@ -1289,14 +1270,14 @@ A Climate Field View credentials. TOKEN = 'YOUR_TOKEN' - endpoint = 'https://{{url}}/services/usermanagement/api/climate-field-view-credentials' + endpoint = 'https://api.withleaf.io/services/usermanagement/api/climate-field-view-credentials' headers = {'Authorization': f'Bearer {TOKEN}'} data = { - 'name': 'str", - 'email': 'help@withleaf.io', - 'phone': 'str', - 'address': 'str', + "clientId": "str", + "clientSecret": "str", + "apiKey": "str", + "refreshToken": "str" } response = requests.post(endpoint, headers=headers, json=data) @@ -1309,8 +1290,8 @@ A Climate Field View credentials. ```shell 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' + -d '{"clientId": "str","clientSecret": "str","apiKey": "str","refreshToken": "str"}' \ + 'https://api.withleaf.io/services/usermanagement/api/climate-field-view-credentials' ``` @@ -1372,7 +1353,7 @@ Deletes a "Climate Field View Credentials" by id. ### `GET /users/{leafUserId}/climate-field-view-credentials` -Get the Climate Field View credentials of the Leaf User based on its id and returns a JSON with the credentials. If during a background processing for Fields or Operations file we detect that this credentials is no longer valid, the value of status will be changed. +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 @@ -1403,7 +1384,7 @@ Get the Climate Field View credentials of the Leaf User based on its id and retu const endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/climate-field-view-credentials' const headers = { 'Authorization': `Bearer ${TOKEN}` } - axios.get(endpoint, { headers, data }) + axios.get(endpoint, { headers }) .then(res => console.log(res.data)) .catch(console.error) ``` @@ -1443,7 +1424,6 @@ Create a Climate Field View credentials for the Leaf User. ```json { - "id": "UUID", "clientId": "str", "clientSecret": "str", "apiKey": "str", @@ -1453,15 +1433,15 @@ Create a Climate Field View credentials for the Leaf User. #### Response -A Leaf User with the id assigned to it. +A Climate Field View credential with status. ```json { - "id": "UUID", "clientKey": "str", "clientSecret": "str", "tokenId": "str", - "tokenSecretKey": "str" + "tokenSecretKey": "str", + "status": "str" } ``` @@ -1480,18 +1460,17 @@ A Leaf User with the id assigned to it. const axios = require('axios') const TOKEN = 'YOUR_TOKEN' - const endpoint = 'https://{{url}}/services/usermanagement/api/users/{leafUserId}/climate-field-view-credentials' + const endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/climate-field-view-credentials' const headers = { 'Authorization': `Bearer ${TOKEN}` } const data = { - id: "UUID", - name: "str", - email: "help@withleaf.io", - phone: "str", - address: "str" + "clientId": "str", + "clientSecret": "str", + "apiKey": "str", + "refreshToken": "str" } - axios.post(endpoint, { headers, data }) + axios.post(endpoint, data, { headers }) .then(res => console.log(res.data)) .catch(console.error) ``` @@ -1504,14 +1483,14 @@ A Leaf User with the id assigned to it. TOKEN = 'YOUR_TOKEN' - endpoint = 'https://{{url}}/services/usermanagement/api/users/{leafUserId}/climate-field-view-credentials' + endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/climate-field-view-credentials' headers = {'Authorization': f'Bearer {TOKEN}'} data = { - 'name': 'str", - 'email': 'help@withleaf.io', - 'phone': 'str', - 'address': 'str', + "clientId": "str", + "clientSecret": "str", + "apiKey": "str", + "refreshToken": "str" } response = requests.post(endpoint, headers=headers, json=data) @@ -1524,8 +1503,8 @@ A Leaf User with the id assigned to it. ```shell curl -X POST \ -H 'Authorization: Bearer YOUR_TOKEN' \ - -d '{ "name": "str", "email": "help@withleaf.io", "phone": "str", "address": "str"}' - 'https://{{url}}/services/usermanagement/api/users/{leafUserId}/climate-field-view-credentials' + -d '{"clientId": "str","clientSecret": "str","apiKey": "str","refreshToken": "str"}' \ + 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/climate-field-view-credentials' ``` @@ -1684,13 +1663,6 @@ A JSON array with Trimble Credentials. endpoint = 'https://api.withleaf.io/services/usermanagement/api/trimble-credentials' headers = {'Authorization': f'Bearer {TOKEN}'} - data = { - 'name': 'str", - 'email': 'help@withleaf.io', - 'phone': 'str', - 'address': 'str', - } - response = requests.get(endpoint, headers=headers) print(response.json()) ``` @@ -1740,18 +1712,17 @@ A "Trimble Credentials" with the id assigned to it. const axios = require('axios') const TOKEN = 'YOUR_TOKEN' - const endpoint = 'https://{{url}}/services/usermanagement/api/trimble-credentials' + const endpoint = 'https://api.withleaf.io/services/usermanagement/api/trimble-credentials' const headers = { 'Authorization': `Bearer ${TOKEN}` } const data = { - id: "UUID", - name: "str", - email: "help@withleaf.io", - phone: "str", - address: "str" + "userName": "str", + "password": "str", + "applicationName": "str", + "serviceIdentityId": "str" } - axios.post(endpoint, { headers, data }) + axios.post(endpoint, data, { headers }) .then(res => console.log(res.data)) .catch(console.error) ``` @@ -1764,14 +1735,14 @@ A "Trimble Credentials" with the id assigned to it. TOKEN = 'YOUR_TOKEN' - endpoint = 'https://{{url}}/services/usermanagement/api/trimble-credentials' + endpoint = 'https://api.withleaf.io/services/usermanagement/api/trimble-credentials' headers = {'Authorization': f'Bearer {TOKEN}'} data = { - 'name': 'str", - 'email': 'help@withleaf.io', - 'phone': 'str', - 'address': 'str', + "userName": "str", + "password": "str", + "applicationName": "str", + "serviceIdentityId": "str" } response = requests.post(endpoint, headers=headers, json=data) @@ -1784,8 +1755,8 @@ A "Trimble Credentials" with the id assigned to it. ```shell 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' + -d '{"userName": "str","password": "str","applicationName": "str","serviceIdentityId": "str"}' \ + 'https://api.withleaf.io/services/usermanagement/api/trimble-credentials' ``` @@ -1918,7 +1889,7 @@ A Trimble credentials. ``` #### Response -A Trimble credentials. +A Trimble credentials with status. console.log(res.data)) .catch(console.error) ``` @@ -1958,14 +1928,14 @@ A Trimble credentials. TOKEN = 'YOUR_TOKEN' - endpoint = 'https://{{url}}/services/usermanagement/api/users/{leafUserId}/trimble-credentials' + endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/trimble-credentials' headers = {'Authorization': f'Bearer {TOKEN}'} data = { - 'name': 'str", - 'email': 'help@withleaf.io', - 'phone': 'str', - 'address': 'str', + "userName": "str", + "password": "str", + "applicationName": "str", + "serviceIdentityId": "str" } response = requests.post(endpoint, headers=headers, json=data) @@ -1978,8 +1948,8 @@ A Trimble credentials. ```shell curl -X POST \ -H 'Authorization: Bearer YOUR_TOKEN' \ - -d '{ "name": "str", "email": "help@withleaf.io", "phone": "str", "address": "str"}' - 'https://{{url}}/services/usermanagement/api/users/{leafUserId}/trimble-credentials' + -d '{"userName": "str","password": "str","applicationName": "str","serviceIdentityId": "str"}' + 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/trimble-credentials' ``` @@ -2139,13 +2109,6 @@ A JSON array with CNHI Credentials. endpoint = 'https://api.withleaf.io/services/usermanagement/api/cnhi-credentials' headers = {'Authorization': f'Bearer {TOKEN}'} - data = { - 'name': 'str", - 'email': 'help@withleaf.io', - 'phone': 'str', - 'address': 'str', - } - response = requests.get(endpoint, headers=headers) print(response.json()) ``` @@ -2171,9 +2134,9 @@ A "CNHI Credentials" without id. ```json { - "clientId": "", - "clientSecret": "", - "refreshToken": "" + "clientId": "str", + "clientSecret": "str", + "refreshToken": "str" } ``` @@ -2194,18 +2157,16 @@ A "CNHI Credentials" with the id assigned to it. const axios = require('axios') const TOKEN = 'YOUR_TOKEN' - const endpoint = 'https://{{url}}/services/usermanagement/api/cnhi-credentials' + const endpoint = 'https://api.withleaf.io/services/usermanagement/api/cnhi-credentials' const headers = { 'Authorization': `Bearer ${TOKEN}` } const data = { - id: "UUID", - name: "str", - email: "help@withleaf.io", - phone: "str", - address: "str" + "clientId": "str", + "clientSecret": "str", + "refreshToken": "str" } - axios.post(endpoint, { headers, data }) + axios.post(endpoint, data, { headers }) .then(res => console.log(res.data)) .catch(console.error) ``` @@ -2218,14 +2179,13 @@ A "CNHI Credentials" with the id assigned to it. TOKEN = 'YOUR_TOKEN' - endpoint = 'https://{{url}}/services/usermanagement/api/cnhi-credentials' + endpoint = 'https://api.withleaf.io/services/usermanagement/api/cnhi-credentials' headers = {'Authorization': f'Bearer {TOKEN}'} data = { - 'name': 'str", - 'email': 'help@withleaf.io', - 'phone': 'str', - 'address': 'str', + "clientId": "str", + "clientSecret": "str", + "refreshToken": "str" } response = requests.post(endpoint, headers=headers, json=data) @@ -2238,8 +2198,8 @@ A "CNHI Credentials" with the id assigned to it. ```shell 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' + -d '{"clientId": "str", "clientSecret": "str", "refreshToken": "str"}' \ + 'https://api.withleaf.io/services/usermanagement/api/cnhi-credentials' ``` @@ -2363,9 +2323,9 @@ A CNHI credentials. ```json { - "clientId": "", - "clientSecret": "", - "refreshToken": "" + "clientId": "str", + "clientSecret": "str", + "refreshToken": "str" } ``` @@ -2386,18 +2346,16 @@ A CNHI Credentials with status. const axios = require('axios') const TOKEN = 'YOUR_TOKEN' - const endpoint = 'https://{{url}}/services/usermanagement/api/users/{leafUserId}/cnhi-credentials' + const endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/cnhi-credentials' const headers = { 'Authorization': `Bearer ${TOKEN}` } const data = { - id: "UUID", - name: "str", - email: "help@withleaf.io", - phone: "str", - address: "str" + "clientId": "str", + "clientSecret": "str", + "refreshToken": "str" } - axios.post(endpoint, { headers, data }) + axios.post(endpoint, data, { headers }) .then(res => console.log(res.data)) .catch(console.error) ``` @@ -2410,14 +2368,13 @@ A CNHI Credentials with status. TOKEN = 'YOUR_TOKEN' - endpoint = 'https://{{url}}/services/usermanagement/api/users/{leafUserId}/cnhi-credentials' + endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/cnhi-credentials' headers = {'Authorization': f'Bearer {TOKEN}'} data = { - 'name': 'str", - 'email': 'help@withleaf.io', - 'phone': 'str', - 'address': 'str', + "clientId": "str", + "clientSecret": "str", + "refreshToken": "str" } response = requests.post(endpoint, headers=headers, json=data) @@ -2430,8 +2387,8 @@ A CNHI Credentials with status. ```shell curl -X POST \ -H 'Authorization: Bearer YOUR_TOKEN' \ - -d '{ "name": "str", "email": "help@withleaf.io", "phone": "str", "address": "str"}' - 'https://{{url}}/services/usermanagement/api/users/{leafUserId}/cnhi-credentials' + -d '{"clientId": "str","clientSecret": "str","refreshToken": "str"}' \ + 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/cnhi-credentials' ```