beta · api · 0.1.0
Set or clear one Platform Account reaction
PUT /api/v1/community/comments/{commentId}/reaction
Capability Domain: Community Interaction
Authentication
projectCredential (reactions:write)
Scope: reactions:write
Parameters and request body
-
X-Correlation-ID— header, optionalX-Correlation-ID schema { "type": "string", "format": "uuid" } -
commentId— path, requiredcommentId schema { "type": "string", "format": "uuid" }
Request schema
application/json
{
"type": "object",
"additionalProperties": false,
"required": [
"platform_account_id",
"resource_type",
"resource_id",
"reaction_type"
],
"properties": {
"platform_account_id": {
"type": "string",
"format": "uuid"
},
"resource_type": {
"type": "string",
"maxLength": 120,
"pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]*$"
},
"resource_id": {
"type": "string",
"maxLength": 255
},
"reaction_type": {
"type": [
"string",
"null"
],
"enum": [
"like",
"celebrate",
"insightful",
"support",
null
]
}
}
}
application/json request example
{
"platform_account_id": "30000000-0000-4000-8000-000000000003",
"resource_type": "article",
"resource_id": "article-42",
"reaction_type": "like"
}
Responses and errors
| Status | Description |
|---|---|
200 | Reaction state and anonymous aggregate counts |
401 | Invalid or revoked Project Credential |
403 | Project Credential lacks the required scope |
422 | Request violates the public contract |
200 schema
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"type": "object",
"additionalProperties": false,
"required": [
"comment_id",
"reaction_type",
"counts"
],
"properties": {
"comment_id": {
"type": "string",
"format": "uuid"
},
"reaction_type": {
"type": [
"string",
"null"
],
"enum": [
"like",
"celebrate",
"insightful",
"support",
null
]
},
"counts": {
"type": "object",
"additionalProperties": false,
"required": [
"like",
"celebrate",
"insightful",
"support"
],
"properties": {
"like": {
"type": "integer",
"minimum": 0
},
"celebrate": {
"type": "integer",
"minimum": 0
},
"insightful": {
"type": "integer",
"minimum": 0
},
"support": {
"type": "integer",
"minimum": 0
}
}
}
}
}
}
}
401 schema
{
"type": "object",
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"required": [
"code",
"message",
"retryable",
"correlation_id",
"details"
],
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"retryable": {
"type": "boolean"
},
"correlation_id": {
"type": "string",
"format": "uuid"
},
"details": {
"type": "object"
}
}
}
}
}
403 schema
{
"type": "object",
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"required": [
"code",
"message",
"retryable",
"correlation_id",
"details"
],
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"retryable": {
"type": "boolean"
},
"correlation_id": {
"type": "string",
"format": "uuid"
},
"details": {
"type": "object"
}
}
}
}
}
422 schema
{
"type": "object",
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"required": [
"code",
"message",
"retryable",
"correlation_id",
"details"
],
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"retryable": {
"type": "boolean"
},
"correlation_id": {
"type": "string",
"format": "uuid"
},
"details": {
"type": "object"
}
}
}
}
}
200 example
{
"data": {
"comment_id": "51000000-0000-4000-8000-000000000001",
"reaction_type": "like",
"counts": {
"like": 3,
"celebrate": 1,
"insightful": 0,
"support": 2
}
}
}
Idempotency
PUT stores the requested account reaction state; identical retries do not create another reaction.