Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return_input_database_updated #505

Merged
merged 1 commit into from
Dec 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading