ChatSoundAssetRequest chat.sound-asset-request@1
Generated at from
openvibe-contracts v0.97.0 and
openvibe-sdk v0.26.0.
- Version
- 1.0.0
- Owner
- chat
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/chat/sound-asset-request.v1.json
chat.sound-asset-request@1: the body of POST /internal/chat/sounds/asset on OpenVibe.Chat (capability chat.sounds.write): after OpenVibe.Live's asset sync uploaded a channel sound to OpenVibe.Media, the asset is written back onto Chat's channel_sounds row id. Writing the same asset again is a no-op; an unknown id is 404. Answers chat.ingress-ack@1.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
id | integer | yes | channel_sounds.id |
|
media_url | string | yes | The asset's OpenVibe.Media URL. |
|
media_asset_id | integer | yes | The OpenVibe.Media asset id. |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: asset
{
"id": 904,
"media_url": "https://openvibe.media/a/31882/airhorn.mp3",
"media_asset_id": 31882
}Rejected: extra-field
{
"id": 904,
"media_url": "https://openvibe.media/a/31882/airhorn.mp3",
"media_asset_id": 31882,
"channel_owner_id": 77
}Rejected: missing-asset-id
{
"id": 904,
"media_url": "https://openvibe.media/a/31882/airhorn.mp3"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('chat.sound-asset-request@1', value); // { valid, errors: [{ path, message }] }