Browse Community Interaction

beta · guide · 0.1.0

Set and summarize reactions

The Project Backend authorizes the current Project Membership, resource visibility, and interaction policy before every call. MiniCenter accepts only like, celebrate, insightful, or support; the fixed vocabulary keeps reaction meaning portable across projects. Request reactions:write only for setting state and reactions:read only for summaries.

Shell example
: "${MINICENTER_URL:?set the Sandbox URL}"
: "${MINICENTER_PROJECT_CREDENTIAL:?set a Project Credential}"
: "${MINICENTER_COMMENT_ID:?set a Comment ID}"

curl --fail-with-body -X PUT "${MINICENTER_URL}/api/v1/community/comments/${MINICENTER_COMMENT_ID}/reaction" \
  -H "Authorization: Bearer ${MINICENTER_PROJECT_CREDENTIAL}" \
  -H 'Content-Type: application/json' \
  --data '{"platform_account_id":"30000000-0000-4000-8000-000000000003","resource_type":"article","resource_id":"article-42","reaction_type":"like"}'

PUT stores at most one reaction per Platform Account and Comment. Repeating identical input is idempotent; another allowed type replaces the previous type. Send reaction_type: null to clear it. Setting a reaction requires an active Platform Account. The credential, Comment, and exact resource tuple must share one Project Client or the request fails with 422.

Shell example
curl --get --fail-with-body "${MINICENTER_URL}/api/v1/community/comments/${MINICENTER_COMMENT_ID}/reactions" \
  -H "Authorization: Bearer ${MINICENTER_PROJECT_CREDENTIAL}" \
  --data-urlencode 'resource_type=article' \
  --data-urlencode 'resource_id=article-42'

The summary always returns all four counts, including zeros. It never returns Platform Account IDs or a reaction feed. A removed Comment rejects new reaction state and returns all-zero public counts without deleting retained reaction rows. If MiniCenter is unavailable, keep the resource usable and retry an unchanged PUT later.