Track an event

Tracking user actions.

URL

POST https://api.dashly.app/v1/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)

Arguments

This method follows the general rules. Arguments are transmitted as GET or POST parameters.

Argument Description
auth_token Required. Authorization token (requires scope: user-write)
event Required. Event name (up to 255 symbols)
params Optional. Additional event parameters. Default: {}
created Optional. UTC timestamp. Time, when event happened. Default: time of request.
by_user_id Optional. Set true in case User ID is used for access. Default: false.

Answer

{
  "meta": {
    "status": 200
  },
  "data": {
    "id": 6187513
  }
}

Contains id of created event.

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" \
  --data-urlencode "auth_token=XXX" \
  https://api.dashly.app/v1/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" \
  --data-urlencode "auth_token=XXX" \
  "https://api.dashly.app/v1/users/user-7216/events"