LiveTipsDeliveryRequest live.tips-delivery-request@1
Generated at from
openvibe-contracts v0.53.0 and
openvibe-sdk v0.11.0.
- Version
- 1.0.0
- Owner
- live
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/live/tips-delivery-request.v1.json
live.tips-delivery-request@1: the body of POST /internal/tips/deliveries on OpenVibe.Live (live.tips_delivery.write; OpenVibe.Tips' live-chat delivery adapter, loopback only). The money already moved in OpenVibe.Billing; this only shows it on the creator's channel. Needs an Idempotency-Key header (<interaction id>:<effect>, 8-200 of A-Z a-z 0-9 _ : . -); a repeat answers the first result. effect chat_line or paid_message: a donation event in the channel room and global chat, saved as a donation chat message, with the alert sound; tts: tts.text spoken on the live stream (or the offline channel room); media_request: media.url into the channel's media queue at cost 0. The creator must have a Live channel (404 otherwise); an unknown effect or a failure is 422.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
delivery_id | string | |||
effect | enum | yes |
| |
test | boolean | |||
creator | object | yes | ||
creator.type | const |
| ||
creator.id | string | yes |
| |
supporter | object | |||
supporter.name | string | Shown (80 characters); Someone when absent. | ||
supporter.subject | string | null | |||
interaction | object | |||
interaction.id | string | |||
interaction.kind | string | |||
interaction.amount | number | string | |||
interaction.currency | string | |||
interaction.message | string | null | Cut to 500 characters. | ||
text | string | The chat line to save (1000 characters); a default names the supporter and amount. | ||
tts | object | |||
tts.text | string |
| ||
tts.voice | string | null | |||
media | object | |||
media.url | string | yes | ||
highlight_seconds | number | string | |||
target | object | A live stream of the creator ({ service: live, type: stream, id }); otherwise the creator's current live stream. | ||
target.service | string | |||
target.type | string | |||
target.id | string | integer |
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: paid-message
{
"delivery_id": "dlv_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"effect": "paid_message",
"test": false,
"creator": {
"type": "user",
"id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
},
"supporter": {
"name": "bob",
"subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
},
"interaction": {
"id": "int_01JAB2C3D4E5F6G7H8J9K0MNPS",
"kind": "paid_message",
"amount": 500,
"currency": "vibes-bits",
"message": "love the stream"
},
"text": "bob tipped 500 Vibes: love the stream",
"highlight_seconds": 30
}Valid: tts
{
"effect": "tts",
"creator": {
"type": "user",
"id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
},
"supporter": {
"name": "bob"
},
"interaction": {
"id": "int_01JAB2C3D4E5F6G7H8J9K0MNPS"
},
"tts": {
"text": "hello from bob",
"voice": null
}
}Rejected: unknown-effect
{
"effect": "fireworks",
"creator": {
"type": "user",
"id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
}
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('live.tips-delivery-request@1', value); // { valid, errors: [{ path, message }] }