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 IDsosmedId(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 mentiondisplay_name: Name of the account that posted the mentionusername: Account username/handlecontent: Text content of the mentionsocialmediaid: Social media platform (twitter, instagram, etc.)url: URL to the original contentcreatedat: Time the content was postedsentimen: Sentiment analysis result for the contentkeyword_id: Related project IDgroup: Related project namekeyword: Keyword that triggered the mention
Pagination object
total: Total number of itemslimit: Number of items per pagepage: current pagetotalPages: total of page