System Events
Get internal Lytics system events. These events
are generally related to internal changes to state of
an account. Common changes are CRUD Operations (Create,
Update, Delete) of *Account*, *Admin User*, etc.
System Events Query
https://api.lytics.io/api/eventGet list of system events.
``
# get the dashboard news items
curl -s -H "Authorization: $LIOKEY" \
-XGET "https://api.lytics.io/api/event?query=dashboard_news" | jq '.'
# get list of all segments created in last 2 weeks
curl -s -H "Authorization: $LIOKEY" \
-XGET "https://api.lytics.io/api/event?type=segment&start=now-2w&limit=100&verb=created" | jq '.'
# get list of all events performed by user X
# 1) first find a user id
curl -s -H "Authorization: $LIOKEY" \
-XGET "https://api.lytics.io/api/user/[email protected]" | jq '.'
# 2) get the id for that user
curl -s -H "Authorization: $LIOKEY" \
-XGET "https://api.lytics.io/api/event?type=user&id=USER_ID_FROM_PREVIOUS" | jq '.'
``
{
"data": [
{
"id": "13564999017e8b0e9994ff16411fd19b",
"ts": "1465584982676",
"priority": 2,
"subject_type": "topic-document",
"subject_id": "-1894399319812759219",
"verb": "created",
"account_id": "1234abcdefgh"
},
{
"id": "c57172d7d22e1c7ac4c80ce713e6e7cb",
"ts": "1465844458666",
"priority": 2,
"subject_type": "entity",
"subject_id": "user/email/[email protected]",
"verb": "clustered",
"related": [
{
"type": "segment",
"id": "791734b084019d99c82a475264464304"
}
],
"account_id": "1234abcdefgh",
"context": {
"in": "2016-06-13T18:58:29Z"
}
}
],
"message": "success",
"status": 200
}System Event Fetch
https://api.lytics.io/api/event/:idGet Single System Event
{
"data": {
"id": "c57172d7d22e1c7ac4c80ce713e6e7cb",
"ts": "1465844458666",
"priority": 2,
"subject_type": "entity",
"subject_id": "user/email/[email protected]",
"verb": "clustered",
"related": [
{
"type": "segment",
"id": "791734b084019d99c82a475264464304"
}
],
"account_id": "1234abcdefgh",
"context": {
"in": "2016-06-13T18:58:29Z"
}
},
"message": "success",
"status": 200
}