Track an event

Tracking user actions.

URL

POST https://api.dashly.app/users/{id}/events

For {id} you can use:

  • Dashly ID
  • Your User ID (in case user with such ID does not exist, new user with such ID is created) (send with by_user_id=true)

Parameters

Authentification parameters. id_as_string parameter.

Parameter Type Description
by_user_id Optional[boolean] Should be true in case you're using User ID instead of Dashly ID. Default: false
event string[1;255] Event name (up to 255 characters)
params Optional[Dict] Event properties. Default: {}
created Optional[timestamp] UTC timestamp. Time, when event happened. Default: time of request. Event does not trigger automessages, bots and triggered integrations if this parameter is added
app Optional[ID] D of requesting application. Default: calculated based on access token

Note

event field should contain system event name starting with $ symbol if you are posting a standart system event (not custom). You can look up those standart names here.

Response

data field will contain careated Event object.

{
  "meta": {
    "status": 200
  },
  "data": {
    "id": 6187513,
    "created": 123123123,
    "type": {
      "id": 123123123,
      "name": "testEvent",
      "score": 0,
      "visible": true,
      "active": false
    },
    "user": 123123123,
    "props": {}
  }
}

Exceptions

Standart Web API exceptions

Example

Track Order Created event with event property item=chicken by user with dashlyId=8173131 (our ID):

curl -X POST \
  --data-urlencode "event=Order Created" \
  -H "Authorization: Token XXX" \
  https://api.dashly.app/users/8173131/events

Track Order Created event with event property item=chicken by user with UserId=user-7216 (your ID):

curl -X POST \
  --data-urlencode "event=Order Created" \
  --data-urlencode 'params={"item": "chicken"}' \
  --data-urlencode "by_user_id=true" \
  -H "Authorization: Token XXX" \
  "https://api.dashly.app/users/user-7216/events"