Send heartbeat signal

This method sends a heartbeat signal to the user. We call it on the user's side of the site to track user status.

This method should be called every minute.

URL

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

Dashly ID (our ID) should be used as {id}.

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)
presence Required. Status: online or idle.
session Required. Session ID.

The user can be online from different devices or browsers. Each such device or browser is a separate session. You need to generate a random identifier [a-z0-9]{32} (32 characters, small Latin letters and numbers) so that the Dashly can distinguish between sessions.

For example, in case of a web browser, we store the session id in the cookie with the lifetime up to the browser closure. Example session: dksjovtd9e1nz6hpbk2adkj1fwwfwzfd

The user is considered(idle), if he does not show any activity for two minutes (does not press keys, scroll, move the mouse, etc.).

Answer

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

Answer will be empty.

Example

curl -X POST \
  --data-urlencode 'presence=online' \
  --data-urlencode 'session=dksjovtd9e1nz6hpbk2adkj1fwwfwzfd' \
  --data-urlencode 'auth_token=XXX' \
  "https://api.dashly.app/v1/users/2137216/setpresence"