Fetch all alerts
GET /accounts/{account_id}/alerts
This method will allow you to fetch a list of all alerts for a given account.
Parameters
account_id
(string) - ID of the account
Query string parameters
limit
(integer) - Number of alerts to return. Default: return all alerts.cursor
(string) - Cursor is used for paginating. This is an abstract value, and is provided by the API.ids
(array of integers) - IDs of alerts that must be fetched. Must not contain more than 50 ids. Default: return all alerts.
Page content
Minimal curl example
curl -ig 'https://api.mention.net/api/accounts/{account_id}/alerts' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Accept-Version: 1.19'
Request example
- Headers
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept-Version: 1.19
- Body
None
Response example
- Body
{
"alerts": [
{ ... alert ... },
{ ... alert ... },
...
],
"_links": {
"more": {
"href": "/api/accounts/.../alerts?limit=20&cursor=abc",
"params": {
"limit": 20,
"cursor": "abc"
}
}
}
The _links.more
attribute provides informations for fetching more alerts. The attribute is defined only if more alerts exist.
Alert
{...alert...}
Each alert object contained has the form it would if you did a get request on that specific alert:
{
"alert": {
"id": "112233",
"name": "NASA and competitors",
"query": {
"type": "basic",
"included_keywords": ["NASA", "Arianespace", "SpaceX", "Pockocmoc"],
"required_keywords": ["mars"],
"excluded_keywords": ["nose", "fil d'ariane"],
"monitored_website": [
"domain": "www.nasa.gov",
"block_self": true
]
},
"languages": ["en", "fr", "ru"],
"countries": [],
"sources": ["twitter", "news", "web", "blogs", "videos", "forums", "images"],
"blocked_sites": ["www.spaceoflovemagazine.com/"],
"role": "admin",
"stats": {
"mention_sources": {
"total": "0"
},
"mention_folders": {
"inbox": {
"total": "0"
},
"archive": {
"total": "0"
},
"spam": {
"total": "0"
},
"trash": {
"total": "0"
}
},
"unread_mentions": {
"total": "0"
},
"unseen_mentions": {
"total": "0"
},
"favorite_mentions": {
"total": "0"
},
"important_mentions": {
"total": "0"
},
"tasks": {
"total": "0"
},
"todo_tasks": {
"total": "0"
},
"done_tasks": {
"total": "0"
},
"logs": {
"total": "0"
}
},
"shares": [{
"id": "THE_ACCOUNT_ID",
"account": {
"id": "THE_ACCOUNT_ID",
"name": "Doe",
"email": "john.doe@nasa.com",
"language_code": "en",
"created_at": "2014-09-30T10:03:54.0+00:00",
"updated_at": "2016-01-14T14:55:57.0+00:00",
"avatar_url": "https:\/\/d39qsljf883l.cloudfront.net\/f6415b89ef2ljkca5c0c7d464f1b82-088f3dsqlj12lj4.jpg",
"timezone": "Europe\/Berlin",
"grouped_email_notification": true,
"default_email_notification_frequency": "daily",
"default_desktop_notification_frequency": "hourly",
"default_push_notification_frequency": "hourly"
},
"role": "admin",
"permissions": {
"edit": true,
"delete": true
},
"created_at": "2016-01-14T15:31:42.0+00:00",
"weight": 88674800
}],
"noise_detection": true,
"created_at": "2016-01-14T15:31:42.0+00:00",
"updated_at": "2016-01-14T15:31:44.0+00:00",
"quota_used": 0,
"index_version": 2,
"permissions": {
"edit": true,
"share": true,
"list_tasks": true,
"list_logs": true
},
"description": "Monitor NASA press release.",
"color": "#05e363",
"connection_type": "related",
"connection_id": "12121212"
}
}
Stats
Contains statistics about the alert:
- mention number by source
- mention number by folder
- tasks
- ...
Shares
Array listing who has access to the alert. When you create an alert, your account is the only item in shares; however, once the alert gets shared, all accounts it is shared with are listed in this array.
Index version
Indicates the 'search' version of the Alert. 'Search' version is a version of the search feature. For a given alert, a specific 'search' version will indicate if a specific attribute is available in the search for that Alert. In order to know which attributes are available for search for the version of your alert, check this.
Connection
connection_type
is the way this alert is related (or not) to one other.
Possible values are:
main
: This is the first alert of the user created at onboardingrelated
: This is a competitor alert created at the same time than the main alertindependent
: This is an alert created after and not related to main nor related
connection_id
is defined only for related
alerts and represent the id of the main alert it is related to.