VCP 1 Documentation›API Reference
Reactions
Optional like/dislike state for the requesting user, plus optional public counts.
Advertise the reactions keyword in your manifest'scapabilities to mount this route. Writes require thereactions.write scope; reads of public counts don't need an identity, but the per-user reaction field only appears when the request carries one.
Set, change, or clear
PUT/videos/{id}/reaction
reaction is "like", "dislike", ornull to clear. It's idempotent last-write-wins — a plain PUTwith no versioning, safe to retry blindly:
# Like
curl -X PUT "https://api.example.com/vcp/v1/videos/vid_88213/reaction" \
-H "VCP-Service-Token: vcps_a81f42..." \
-H "Authorization: Bearer vcpa_71be02..." \
-H "Content-Type: application/json" \
-d '{ "reaction": "like" }'
# Clear the reaction
curl -X PUT "https://api.example.com/vcp/v1/videos/vid_88213/reaction" \
-H "VCP-Service-Token: vcps_a81f42..." \
-H "Authorization: Bearer vcpa_71be02..." \
-H "Content-Type: application/json" \
-d '{ "reaction": null }'import requests
API = "https://api.example.com/vcp/v1"
HEADERS = {
"VCP-Service-Token": "vcps_a81f42...",
"Authorization": "Bearer vcpa_71be02...",
}
# Like (use "dislike" to dislike, or None to clear)
resp = requests.put(f"{API}/videos/vid_88213/reaction",
headers=HEADERS, json={"reaction": "like"})
resp.raise_for_status()
state = resp.json()
print(state["reaction"], state.get("likes"), state.get("dislikes"))require "rest-client"
require "json"
API = "https://api.example.com/vcp/v1"
HEADERS = {
"VCP-Service-Token" => "vcps_a81f42...",
"Authorization" => "Bearer vcpa_71be02...",
content_type: :json
}
# Like (use "dislike" to dislike, or nil to clear)
resp = RestClient.put("#{API}/videos/vid_88213/reaction",
{ reaction: "like" }.to_json, HEADERS)
state = JSON.parse(resp.body)
puts [state["reaction"], state["likes"], state["dislikes"]].inspectconst API = 'https://api.example.com/vcp/v1'
const HEADERS = {
'VCP-Service-Token': 'vcps_a81f42...',
'Authorization': 'Bearer vcpa_71be02...',
'Content-Type': 'application/json',
}
// Like (use 'dislike' to dislike, or null to clear)
const resp = await fetch(API + '/videos/vid_88213/reaction', {
method: 'PUT',
headers: HEADERS,
body: JSON.stringify({ reaction: 'like' }),
})
if (!resp.ok) throw new Error('reaction write failed: ' + resp.status)
const state = await resp.json()
console.log(state.reaction, state.likes, state.dislikes)200 OK
{ "reaction": "like", "likes": 1042, "dislikes": 13 }likes and dislikes are optional — if you don't expose public counts, return only reaction.
Read state
When the capability is present, GET /videos/{id}includes the same fields for the requesting credential:
"reaction": "like",
"likes": 1042,
"dislikes": 13Note the subject is videos only: the reactions keyword never implies reactions on playlists or collections. A future feature on a different subject would be a different capability with its own convention — seecapability conventions.