BotPairRequest bot.pair-request@1
Generated at from
openvibe-contracts v0.97.0 and
openvibe-sdk v0.26.0.
- Version
- 1.0.0
- Owner
- bot
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Decision
- ADR-043
- Schema
https://openvibe.network/contracts/bot/pair-request.v1.json
bot.pair-request@1: the body of POST /api/v1/pair on OpenVibe.Bot (and the fields of the pair frame on /device): a one-time pairing code (8 Crockford base32 characters, XXXX-XXXX) is its own credential and idempotency. robot narrows the code to one robot (wrong tries are then counted and lock the code); the rest is what the agent declares. With BOT_PAIRING_AUTHORITY=network the codes are Network's and this route answers 410 bot.pairing_moved.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
code | string | yes |
| |
robot | one of | |||
agent_version | string | null |
| ||
device_kind | enum |
| ||
drivers | array of string | |||
capabilities | object | |||
name | string | null |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: agent
{
"code": "K7QM-3XRT",
"robot": "rob_01J8Z4M2Q0R7T9YV3K6N8P1W2X",
"agent_version": "0.1.2",
"device_kind": "onboard",
"drivers": [
"pca9685",
"ads7830"
],
"capabilities": {
"pca9685": {
"channels": 16
}
},
"name": "garage pi"
}Valid: code-only
{
"code": "K7QM3XRT"
}Rejected: bad-kind
{
"code": "K7QM-3XRT",
"device_kind": "cloud"
}Rejected: no-code
{
"robot": "rob_01J8Z4M2Q0R7T9YV3K6N8P1W2X"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('bot.pair-request@1', value); // { valid, errors: [{ path, message }] }