Skip to main content

Mentions API

Base URL

/api

All endpoints require authentication using Authorization: Bearer <token>.

Endpoints

GET /mentions

Retrieve a list of all mentions/targeted account contents.

Headers:

  • Authorization: Bearer <token>

Query Parameters:

  • project_id (optional): Filter by project ID or keyword ID
  • sosmedId (optional): social media source (twitter, tiktok, facebook, youtube, or instagram)
  • sentimen (optional): 1, 0 or -1 (representation of positive(1), neutral(0), and negative(-1) )
  • limit (optional): Items per page (default: 10)
  • offset (optional): Pagination offset (default: 0)

Response:

{
"data": [
{
"id": "string",
"targeted_account_id": "string",
"content": "string",
"keywordid": "string",
"sentimen": number,
"socialmediaid": "string",
"createdat": "datetime",
"updated_at": "datetime",
"targeted_account": {
"username": "string",
"display_name": "string"
},
"SnaKeyword": {
"group": "string",
"keyword": "string"
}
},
],
"total": number,
"page": number,
"limit": number,
"totalPages": number
}

cURL

curl -X 'GET' \
'https://smbrand-be-test.ganapatih.com/api/mentions?keywordId={keyword_id}&page=1&limit=10&sentimen=1&sosmedId={socialmedia}' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <token>'

Error Responses

401 Unauthorized

{
"error": "Invalid or missing token"
}

403 Forbidden

{
"error": "Access denied"
}

500 Internal Server Error

{
"error": "Internal server error"
}

Response Fields Explanation

Mention object

  • id: Unique identifier for the mention
  • display_name: Name of the account that posted the mention
  • username: Account username/handle
  • content: Text content of the mention
  • socialmediaid: Social media platform (twitter, instagram, etc.)
  • url: URL to the original content
  • createdat: Time the content was posted
  • sentimen: Sentiment analysis result for the content
  • keyword_id: Related project ID
  • group: Related project name
  • keyword: Keyword that triggered the mention

Pagination object

  • total: Total number of items
  • limit: Number of items per page
  • page: current page
  • totalPages: total of page