2

I'm working on a project where tickets are assigned to users based on their presence in Slack. This presence can be Active or Away, but one can also manually set this presence to Away. A clever user can manually set his or her presence and avoid being assigned work. This is something I would like to avoid.

For the moment I use the users.getPresence method which works fine, but I would like to retrieve the "true" presence of users.

The users.getPresence documentation page has the following info:

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
}

This method provides information regarding the connection count and if a user has manually changed his status to Away. My assumption is that, using this information, I can see if a user is online but he is being sneaky.

However, I have no idea how to retrieve this information. What is this 'authed' user and can you only get this information for this user?

Furthermore, I accidentally retrieved this 'extended' getPresence data when I send a request to my app using an email address as input, instead of a Slack ID. However, the response is always the same:

{
    "ok": true,
    "presence": "away",
    "online": false,
    "auto_away": false,
    "manual_away": false,
    "connection_count": 0
}

It doesn't matter if I'm active or manually away, the response is always the same.

Has anybody here figured out how this 'extended' getPresence works? I would love to know you did it.

If anybody has an idea on how to retrieve the "true" online status in Slack, please let me know :D

Jordi Z
  • 179
  • 13

1 Answers1

0

Authed user is the user that allowed their account data to be accessed, it is a breach of privacy for the API to allow an application to have access to user's "true" online status when they obviously do not want it known and have not consented to it.