curl --location --request POST 'https://api.userorbit.com/v1/public/topic-votes.create' \
--header 'Authorization: Bearer SUBSCRIBER_JWT_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"id": "topic-uuid-123"
}'
const response = await fetch('https://api.userorbit.com/v1/public/topic-votes.create', {
method: 'POST',
headers: {
'Authorization': `Bearer ${subscriberToken}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({ id: topicId })
});
const { data } = await response.json();
{
"data": {
"id": "vote-uuid",
"topicId": "topic-uuid-123",
"creatorId": "sub-uuid-789",
"createdAt": "2024-01-17T16:00:00Z"
}
}
Votes
Vote on Topic
Cast an upvote on a topic (feature request). Requires subscriber authentication.
POST
/
v1
/
public
/
topic-votes.create
curl --location --request POST 'https://api.userorbit.com/v1/public/topic-votes.create' \
--header 'Authorization: Bearer SUBSCRIBER_JWT_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"id": "topic-uuid-123"
}'
const response = await fetch('https://api.userorbit.com/v1/public/topic-votes.create', {
method: 'POST',
headers: {
'Authorization': `Bearer ${subscriberToken}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({ id: topicId })
});
const { data } = await response.json();
{
"data": {
"id": "vote-uuid",
"topicId": "topic-uuid-123",
"creatorId": "sub-uuid-789",
"createdAt": "2024-01-17T16:00:00Z"
}
}
Authentication
Authorization: Bearer SUBSCRIBER_JWT_TOKEN
Request Body
string
required
Topic ID (UUID) to vote on
Response
object
curl --location --request POST 'https://api.userorbit.com/v1/public/topic-votes.create' \
--header 'Authorization: Bearer SUBSCRIBER_JWT_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"id": "topic-uuid-123"
}'
const response = await fetch('https://api.userorbit.com/v1/public/topic-votes.create', {
method: 'POST',
headers: {
'Authorization': `Bearer ${subscriberToken}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({ id: topicId })
});
const { data } = await response.json();
{
"data": {
"id": "vote-uuid",
"topicId": "topic-uuid-123",
"creatorId": "sub-uuid-789",
"createdAt": "2024-01-17T16:00:00Z"
}
}
Error Responses
Not Authenticated
{
"error": "Bad request"
}
Already Voted
{
"error": "Duplicate vote"
}
Behavior
- One Vote Per Subscriber: Each subscriber can only vote once
- Database Constraint: Prevents duplicate votes
Notes
- Requires subscriber authentication
- Returns error if already voted
- Vote immediately visible in count
Was this page helpful?

