Skip to Content
MinexonMinexon

content.news-like

Set or remove the viewer’s like on a news article.

POST/api/v1/{locale}/news/{slug}/like

API scope content.news-like

Request

Send Authorization: Bearer <key> with each request.

Path parameters

FieldTypeRequirementDescription
localetr or enRequiredRequest locale.
slugstringRequiredURL slug of the resource.

Request body

FieldTypeRequirementDescription
likedbooleanRequiredtrue adds the like; false removes it.

Run samples from your application server. See Quickstart for variables and sessions.

curl --fail-with-body --request POST \
  -H "Authorization: Bearer $MINEXON_API_KEY" \
  -H 'Content-Type: application/json' \
  --data '{
  "liked": true
}' \
  "${MINEXON_BASE_URL}/api/v1/en/news/example/like"

Response

HTTP 200 · application/json

FieldTypeRequirementDescription
nextstringRequiredNext location returned by the CMS or provider.
noticesstring[]ConditionalSuccess and state codes.
errorstringConditionalError code.
errorsstring[]ConditionalField or operation error codes.
{
  "next": "/en/news/example"
}

When the form is shown again, the response can contain data instead of next. Check the HTTP status and the error fields together.

Form response fields
FieldTypeRequirementDescription
localestringRequiredResponse locale.
errorstring or nullConditionalAction error. Can be empty on success.
errorsarray or objectConditionalField or form validation errors.
noticestring or nullConditionalAction notice.
postobjectConditionalSelected news article.
engagementobjectConditionalLike and comment state.
newsCommentRestrictedbooleanConditionalNews comment restriction for the account.
newsLikeRestrictedbooleanConditionalNews like restriction for the account.
engagementActionstring or nullConditionalLast engagement action.
engagementErrorstring or nullConditionalLast engagement error.
engagementNoticestring or nullConditionalLast engagement notice.
relatedarray or objectConditionalRelated published records.
post.bodyHtmlstring or nullConditionalFormatted article body.
post.bodystring[]ConditionalPlain-text paragraphs.
post.commentModeclosed, moderated or immediateConditionalPublication rule for comments on this article.
engagement.viewsintegerConditionalView count.
engagement.likesintegerConditionalLike count.
engagement.likedbooleanConditionalLike state for the current account or guest session.
engagement.commentsarrayConditionalPublished comments.
engagement.pendingCommentsarrayConditionalPending comments for this account or session.
engagement.commentNoncestring or nullConditionalSend as _nonce in the comment request within the same session.

Flow and error cases

Read the article again after submitting to verify the like state.

Shared error and authentication contract