Org Content

Like or favourite a resource

PUT/org-content/resource/{resource_id}/activity

Sets whether the acting user likes and favourites the resource, changing only the flags sent, and returns the engagement. It always acts as the token's user: user_id, author or author_id returns 422 missing. An empty body changes nothing. Emits org_content_activity.updated only when a flag really changes; no email or notification. Sending the opposite values undoes it. dry_run shows the result without saving it.

Path parameters

  • resource_idstring (uuid)Required#

    The resource's id.

Query parameters

  • dry_runboolean#

    Validate and run the call without committing it, returning what the real call would return with meta.dry_run set.

Request body

application/json, required · OrgContentActivityUpdate

  • likedboolean#

    Whether the acting user likes the item.

  • favouritedboolean#

    Whether the acting user has favourited the item.

{
  "liked": true
}

Responses

200

The engagement on the resource as set.

OrgContentActivityEnvelope
{
  "data": {
    "likes": 12,
    "comments": 3,
    "liked": true,
    "favourited": false
  }
}
401

Authentication failed. error.code is one of invalid_token, expired, revoked.

Error
403

Authorization failed. error.code is one of org_disabled, ip_blocked, missing_scope, scope_disabled, user_disabled.

Error
404

Resource not found (error.code = not_found).

Error
422

The request can't be processed (HTTP 422): validation_failed with one ErrorDetail per problem, or a code documented on the operation.

Error
429

Rate limit exceeded (error.code = rate_limited).

Error

Examples

curl -X PUT https://your-org-domain/kong/core/api/v2/org-content/resource/{resource_id}/activity\
  -H "Authorization: Bearer $HELM_API_KEY"\
  -H "Content-Type: application/json"\
  -d '{
  "liked": true
}'