Skip to content

Commit

Permalink
return_input_database_updated
Browse files Browse the repository at this point in the history
  • Loading branch information
allanpetersoon committed Dec 15, 2023
1 parent c215dee commit bbbd5df
Showing 1 changed file with 28 additions and 10 deletions.
38 changes: 28 additions & 10 deletions docs/beta_input_endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -495,14 +495,23 @@ values={[

Updated Leaf predictions or approves them.

To approve Leaf prediction, pass the follow query parameter:
#### Request body

- `status`: `VALIDATED`
To approve Leaf prediction:

Or, to change prediction:
```json
{
"status": "VALIDATED"
}
```

- `productId`: `expectedProductID`
Or, to change prediction:

```json
{
"productId": "expectedProductID"
}
```

#### Request examples

Expand All @@ -520,10 +529,14 @@ values={[
const axios = require('axios')
const TOKEN = 'YOUR_TOKEN'

const endpoint = 'https://api.withleaf.io/services/beta/api/products/matching/operations/{operationId}/matches/{matchId}?status=VALIDATED'
const endpoint = 'https://api.withleaf.io/services/beta/api/products/matching/operations/{operationId}/matches/{matchId}'
const headers = { 'Authorization': `Bearer ${TOKEN}` }

axios.get(endpoint, { headers })

const data = {
status: "VALIDATED"
}

axios.get(endpoint, { headers, data })
.then(res => console.log(res.data))
.catch(console.error)
```
Expand All @@ -536,10 +549,14 @@ values={[

TOKEN = 'YOUR_TOKEN'

endpoint = 'https://api.withleaf.io/services/beta/api/products/matching/operations/{operationId}/matches/{matchId}?status=VALIDATED'
endpoint = 'https://api.withleaf.io/services/beta/api/products/matching/operations/{operationId}/matches/{matchId}'
headers = {'Authorization': f'Bearer {TOKEN}'}

response = requests.get(endpoint, headers=headers)
data = {
status: "VALIDATED"
}

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

Expand All @@ -549,7 +566,8 @@ values={[
```shell
curl -X GET \
-H 'Authorization: Bearer YOUR_TOKEN' \
'https://api.withleaf.io/services/beta/api/products/matching/operations/{operationId}/matches/{matchId}?status=VALIDATED'
-d '{ "status": "VALIDATED" }' \
'https://api.withleaf.io/services/beta/api/products/matching/operations/{operationId}/matches/{matchId}'
```

</TabItem>
Expand Down

0 comments on commit bbbd5df

Please sign in to comment.