content.news-like
Set or remove the viewer’s like on a news article.
POST
/api/v1/{locale}/news/{slug}/likeAPI scope content.news-like
Request
Send Authorization: Bearer <key> with each request.
Path parameters
| Field | Type | Requirement | Description |
|---|---|---|---|
locale | tr or en | Required | Request locale. |
slug | string | Required | URL slug of the resource. |
Request body
| Field | Type | Requirement | Description |
|---|---|---|---|
liked | boolean | Required | true 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
| Field | Type | Requirement | Description |
|---|---|---|---|
next | string | Required | Next location returned by the CMS or provider. |
notices | string[] | Conditional | Success and state codes. |
error | string | Conditional | Error code. |
errors | string[] | Conditional | Field 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
| Field | Type | Requirement | Description |
|---|---|---|---|
locale | string | Required | Response locale. |
error | string or null | Conditional | Action error. Can be empty on success. |
errors | array or object | Conditional | Field or form validation errors. |
notice | string or null | Conditional | Action notice. |
post | object | Conditional | Selected news article. |
engagement | object | Conditional | Like and comment state. |
newsCommentRestricted | boolean | Conditional | News comment restriction for the account. |
newsLikeRestricted | boolean | Conditional | News like restriction for the account. |
engagementAction | string or null | Conditional | Last engagement action. |
engagementError | string or null | Conditional | Last engagement error. |
engagementNotice | string or null | Conditional | Last engagement notice. |
related | array or object | Conditional | Related published records. |
post.bodyHtml | string or null | Conditional | Formatted article body. |
post.body | string[] | Conditional | Plain-text paragraphs. |
post.commentMode | closed, moderated or immediate | Conditional | Publication rule for comments on this article. |
engagement.views | integer | Conditional | View count. |
engagement.likes | integer | Conditional | Like count. |
engagement.liked | boolean | Conditional | Like state for the current account or guest session. |
engagement.comments | array | Conditional | Published comments. |
engagement.pendingComments | array | Conditional | Pending comments for this account or session. |
engagement.commentNonce | string or null | Conditional | Send 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.