---
metadata:
  - name: generator
    content: Diplodoc Platform v5.19.6
alternate:
  - https://yandex.ru/dev/sdg-robot/en/testing-api-access.md
  - https://yandex.ru/dev/sdg-robot/ru/testing-api-access.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.ru/dev/sdg-robot/en/llms.txt

# Access to the testing API

Host: https://delivery-office.sandbox.sdg.yandex.ru
OAuth: [Link to get token](https://oauth.yandex.com/authorize?response_type=token&client_id=b8ba741397bd48839eccfe37b1cad492)

Before testing, you need to obtain a token. You also need to clarify that the partner has been added to the test environment. The authorization token is valid for one year and is updated when obtaining a new token. For adding a partner and getting a token, please contact your manager.

## Successful Scenario

`create_claims_body.json` - file with request body for creating an order

1. Create a claim (order status new)
``` bash
curl -X POST "https://delivery-office.sandbox.sdg.yandex.ru/claims/create?idempotency_key=12345" -H "Authorization: OAuth $EXT_TOKEN" -H "Content-Type: application/json" -d "$(cat create_claims_body.json)"
```
2. Wait until the robot receives the order and drives to the point (order status accepted -> pickUp)
``` bash
curl -X POST "https://delivery-office.sandbox.sdg.yandex.ru/claims/info?claim_id=$CLAIM_ID" -H "Authorization: OAuth $EXT_TOKEN"
```
3. Open/Close the hatch to "place the order"
``` bash
curl -X POST "https://delivery-office.sandbox.sdg.yandex.ru/claims/open_hatch?claim_id=$CLAIM_ID" -H "Authorization: OAuth $EXT_TOKEN"

curl -X POST "https://delivery-office.sandbox.sdg.yandex.ru/claims/close_hatch?claim_id=$CLAIM_ID" -H "Authorization: OAuth $EXT_TOKEN"
```
4. Confirm loading of the order (order status taken -> dropOff)
``` bash
curl -X POST "https://delivery-office.sandbox.sdg.yandex.ru/claims/confirm_exchange?claim_id=$CLAIM_ID" -H "Authorization: OAuth $EXT_TOKEN"
```
5. Wait until the robot "drives to the point" and transitions to dropOff status
6. Open/Close the hatch to "retrieve the order"
``` bash
curl -X POST "https://delivery-office.sandbox.sdg.yandex.ru/claims/open_hatch?claim_id=$CLAIM_ID" -H "Authorization: OAuth $EXT_TOKEN"

curl -X POST "https://delivery-office.sandbox.sdg.yandex.ru/claims/close_hatch?claim_id=$CLAIM_ID" -H "Authorization: OAuth $EXT_TOKEN"
```
7. Confirm receipt of the order (order status taken -> delivered)
``` bash
curl -X POST "https://delivery-office.sandbox.sdg.yandex.ru/claims/confirm_exchange?claim_id=$CLAIM_ID" -H "Authorization: OAuth $EXT_TOKEN"
