Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Commit

Permalink
Publish users.getPresence
Browse files Browse the repository at this point in the history
  • Loading branch information
paulhammond committed Dec 22, 2014
1 parent 37819b4 commit 5d9d680
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
14 changes: 14 additions & 0 deletions methods/users.getPresence.json
@@ -0,0 +1,14 @@
{
"desc": "Gets user presence information.",

"args": {
"user": {
"required" : true,
"type" : "user",
"desc" : "User to get presence info on. Defaults to the authed user."
}
},

"errors": {
}
}
41 changes: 41 additions & 0 deletions methods/users.getPresence.md
@@ -0,0 +1,41 @@
This method lets you find out information about a user's presence.
[Consult the presence documentation](/docs/presence) for more details.

## Arguments

{ARGS}

## Response

When requesting information for a different user, this method just returns the
current presence (either `active` or `away`):

{
"ok": true,
"presence": "active",
}

If you are requesting presence information for the authed user, this method returns
the current presence, along with details on how it was calculated:

{
"ok": true,
"presence": "active",
"online": true,
"auto_away": false,
"manual_away": false,
"connection_count": 1,
"last_activity": 1419027078
}

`presence` indicates the user's overall presence, it will either be `active` or `away`.

`online` will be true if they have a client currently connected to Slack. `auto_away` will be true if our servers haven't detected any activity from the user in the last 30 minutes. `manual_away` will be true if the user has manually set their presence to `away`.

`connection_count` gives a count of total connections.

`last_activity` indicates the last activity seen by our servers. If a user has no connected clients then this property will be absent.

## Errors

{ERRORS}

0 comments on commit 5d9d680

Please sign in to comment.