Adds company's Sensors Feature

Adds company's Sensors Feature.

Request

PUT

https://courier.yandex.ru/api/v1/companies/{company_id}/features/sensors

Path parameters

Name

Description

company_id*

Type: integer

The ID of the company.

Body

application/json
{
    "alerts": [
        {
            "type": "range",
            "scope": "while_not_empty",
            "threshold_time": 0,
            "repeat": {
                "period": 0
            }
        }
    ]
}

Name

Description

alerts

Type: SensorAlert[]

Created sensor alerts.

SensorAlert

Name

Description

threshold_time*

Type: integer

Threshold time during which the sensor can exceed the threshold value (in seconds, default is taken from the company settings).

Min value: 0

Max value: 604800

type*

Type: string

Type of the sensor-alert.

Enum: range, no_data

repeat

Type: SensorAlert_repeat

scope

Type: string

Alert's scope.

Default: while_not_empty

Enum: while_not_empty, all_route

SensorAlert_repeat

Name

Description

period*

Type: integer

Alert repetition period in seconds.

Min value: 1800

Max value: 604800

Responses

200 OK

Success.

Body

application/json
{
    "alerts": [
        {
            "type": "range",
            "scope": "while_not_empty",
            "threshold_time": 0,
            "repeat": {
                "period": 0
            }
        }
    ]
}

Name

Description

alerts

Type: SensorAlert[]

Created sensor alerts.

400 Bad Request

Deprecated

Invalid parameters were passed.

401 Unauthorized

Deprecated

Authorization failed. Send the correct OAuth token in the authorization header.

403 Forbidden

Deprecated

Sensors feature is not available for the company.

422 Unprocessable Entity

Deprecated

Incorrect input.

504 Gateway Timeout

Deprecated

Server error during request processing.