Skip to content

Commit

Permalink
adjust_text_and_urls
Browse files Browse the repository at this point in the history
  • Loading branch information
allanpetersoon committed Nov 11, 2023
1 parent c711696 commit 2cfa788
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 91 deletions.
2 changes: 1 addition & 1 deletion docs/configurations_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ The default value is `false`.
}
```
#### unitMeasurement
This config will set the summary units related with machine files and fields operations. The values can be: `METRIC`, `IMPERIAL` or `DEFAULT`. The `DEFAULT` value does not standardize the units, presenting some variables in the imperial system and others in metric.
This config determines the units for machine files and field operations. Possible values are `METRIC`, `IMPERIAL`, or `DEFAULT`. The `DEFAULT` option does not standardize units, allowing for a mix of imperial and metric variables.

#### generateProviderImages
If set to `true`, Leaf will generate property images for [files][1] fetched from providers. Uploaded files are not affected by this change. The default value is `false`.
Expand Down
2 changes: 1 addition & 1 deletion docs/field_boundary_management_endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ values={[

&nbsp<span class="badge badge--warning">POST</span> `/users/{leaf_user_id}/fields/{field_id}/integration/{provider_name}`

Upload a provider's field boundary to John Deere or Climate Field View. This functionality will soon be made available to other providers.
Upload a provider's or manually created field boundary to John Deere or Climate Field View. This functionality will soon be made available to other providers.

- `provider_name`: choose the name of the provider that will receive the field boundary from another provider. The value can be: `JohnDeere` or `ClimateFieldView`.
- if the `provider_name` is `JohnDeere` it will be necessary to add the `organizationId` as a parameter. This way: `?organizationId={organization_value}`
Expand Down
105 changes: 16 additions & 89 deletions docs/provider_organizations.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import useBaseUrl from '@docusaurus/useBaseUrl';

[1]: #get-john-deere-connected-organizations
[2]: #get-trimble-connected-organizations
[1]: #get-provider-organizations

## About

Expand All @@ -25,23 +24,28 @@ See below the REST resources and their endpoints available in this service.

**Endpoints**

| Description | Endpoints |
|---------------------------------------------|---------------------------------------------------------------------------------------------|
| [Get John Deere Connected Organizations][1] | <span class="badge badge--success">GET</span> `/users/{leafUserId}/organizations/JohnDeere` |
| [Get Trimble Connected Organizations][2] | <span class="badge badge--success">GET</span> `/users/{leafUserId}/organizations/Trimble` |
| Description | Endpoints |
|---------------------------------|---------------------------------------------------------------------------------------------------|
| [Get Provider Organizations][1] | <span class="badge badge--success">GET</span> `/users/{leafUserId}/organizations/{provider}` |

## Organizations List

### Get John Deere Connected Organizations
### Get Provider Organizations

&nbsp<span class="badge badge--success">GET</span> `/users/{leafUserId}/organizations/JohnDeere`
&nbsp<span class="badge badge--success">GET</span> `/users/{leafUserId}/organizations/{provider}`

<p align='justify'>

Get John Deere organizations connected by Leaf User.
Get provider connected and disconnected organizations from Leaf User.

</p>

- `provider`: can be `JohnDeere` or `Trimble`.

:::info
At Trimble it is not possible to differentiate which organizations are connected or not.
:::

#### Request examples

<Tabs
Expand All @@ -58,7 +62,7 @@ Get John Deere organizations connected by Leaf User.
const axios = require('axios')
const TOKEN = 'YOUR_TOKEN'

const endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/organizations/JohnDeere'
const endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/organizations/{provider}'
const headers = { 'Authorization': `Bearer ${TOKEN}` }

axios.get(endpoint, { headers })
Expand All @@ -74,7 +78,7 @@ Get John Deere organizations connected by Leaf User.

TOKEN = 'YOUR_TOKEN'

endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/organizations/JohnDeere'
endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/organizations/{provider}'
headers = {'Authorization': f'Bearer {TOKEN}'}

response = requests.get(endpoint, headers=headers)
Expand All @@ -87,7 +91,7 @@ Get John Deere organizations connected by Leaf User.
```shell
curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/organizations/JohnDeere'
'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/organizations/{provider}'
```

</TabItem>
Expand All @@ -114,80 +118,3 @@ Get John Deere organizations connected by Leaf User.
}
```


### Get Trimble Connected Organizations

&nbsp<span class="badge badge--success">GET</span> `/users/{leafUserId}/organizations/Trimble`

<p align='justify'>

Get Trimble organizations connected by Leaf User.

</p>

#### Request examples

<Tabs
defaultValue="sh"
values={[
{ label: 'cURL', value: 'sh', },
{ label: 'Python', value: 'py', },
{ label: 'JavaScript', value: 'js', },
]
}>
<TabItem value="js">

```js
const axios = require('axios')
const TOKEN = 'YOUR_TOKEN'

const endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/organizations/Trimble'
const headers = { 'Authorization': `Bearer ${TOKEN}` }

axios.get(endpoint, { headers })
.then(res => console.log(res.data))
.catch(console.error)
```

</TabItem>
<TabItem value="py">

```py
import requests

TOKEN = 'YOUR_TOKEN'

endpoint = 'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/organizations/Trimble'
headers = {'Authorization': f'Bearer {TOKEN}'}

response = requests.get(endpoint, headers=headers)
print(response.json())
```

</TabItem>
<TabItem value="sh">

```shell
curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/usermanagement/api/users/{leafUserId}/organizations/Trimble'
```

</TabItem>
</Tabs>

#### Response

```json
{
"managementUri": "https://www.trimbleag.com/ThirdPartyAccess/ThirdPartyAuthorizationRedirect?clientId=client_id",
"connectedOrganizations": [
{
"id": "client_id",
"name": "organization_name"
}
]
}
```


0 comments on commit 2cfa788

Please sign in to comment.