Slack. Web. Users
(SlackKit v1.0.0-alpha.0)
View Source
Summary
Functions
List conversations the calling user is a member of.
Delete the user profile photo
Gets user presence information.
Get a user's identity.
Gets information about a user.
Lists all users in a Slack team.
Find a user with an email address.
Marked a user as active. Deprecated and non-functional.
Set the user profile photo
Manually sets user presence.
Functions
List conversations the calling user is a member of.
API reference
Rate limit: Tier 3: 50+ per minute
Scopes:
- Bot token:
channels:read,groups:read,im:read,mpim:read - User token:
channels:read,groups:read,im:read,mpim:read
Optional Params
cursor- Paginate through collections of data by setting thecursorparameter to anext_cursorattribute returned by a previous request'sresponse_metadata. Default value fetches the first "page" of the collection. See pagination for more detail. ex:dXNlcjpVMDYxTkZUVDI=exclude_archived- Set totrueto exclude archived channels from the list ex:truelimit- The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached. Must be an integer with a max value of 999. ex:20team_id- encoded team id to list conversations in, required if org token is usedtypes- Mix and match channel types by providing a comma-separated list of any combination ofpublic_channel,private_channel,mpim,imex:im,mpimuser- Browse conversations by a specific user ID's membership. Non-public channels are restricted to those where the calling user shares membership. ex:W0B2345D
Errors the API can return:
invalid_cursor- Value passed forcursorwas not valid or is no longer valid.invalid_limit- Value passed forlimitis not understood.invalid_types- Value passed fortypecould not be used based on the method's capabilities or the permission scopes granted to the used token.method_not_supported_for_channel_type- This type of conversation cannot be used with this method.missing_argument- A required argument is missing.
See the Common Errors guide for errors returned by every Web API method.
Delete the user profile photo
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- User token:
users.profile:write
See the Common Errors guide for errors returned by every Web API method.
Gets user presence information.
API reference
Rate limit: Tier 3: 50+ per minute
Scopes:
- Bot token:
users:read - User token:
users:read
Optional Params
user- User to get presence info on. Defaults to the authed user.
See the Common Errors guide for errors returned by every Web API method.
Get a user's identity.
API reference
Rate limit: Tier 3: 50+ per minute
Scopes:
- User token:
identity:read
Errors the API can return:
email_not_verified- user email has not been verifiedinvalid_user_id- Invalid user id provided
See the Common Errors guide for errors returned by every Web API method.
Gets information about a user.
API reference
Rate limit: Tier 4: 100+ per minute
Scopes:
- Bot token:
users:read - User token:
users:read
Required Params
user- User to get info on
Optional Params
include_locale- Set this totrueto receive the locale for this user. Defaults tofalse
Errors the API can return:
too_many_users- Too many users.user_not_found- Value passed foruserwas invalid.user_not_visible- The requested user is not visible to the calling user
See the Common Errors guide for errors returned by every Web API method.
Lists all users in a Slack team.
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- Bot token:
users:read - User token:
users:read
Optional Params
cursor- Paginate through collections of data by setting thecursorparameter to anext_cursorattribute returned by a previous request'sresponse_metadata. Default value fetches the first "page" of the collection. See pagination for more detail. ex:dXNlcjpVMDYxTkZUVDI=include_locale- Set this totrueto receive the locale for users. Defaults tofalselimit- The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn't been reached. Providing nolimitvalue will result in Slack attempting to deliver you the entire result set. If the collection is too large you may experiencelimit_requiredor HTTP 500 errors. 0 ex:20team_id- encoded team id to list users in, required if org token is used
Errors the API can return:
invalid_cursor- Value passed forcursorwas not valid or is no longer valid.limit_required- For large teams a limit is required.missing_argument- A required argument is missing.
See the Common Errors guide for errors returned by every Web API method.
Find a user with an email address.
API reference
Rate limit: Tier 3: 50+ per minute
Scopes:
- Bot token:
users:read.email - User token:
users:read.email
Required Params
email- An email address belonging to a user in the workspace ex:spengler@ghostbusters.example.com
Errors the API can return:
users_not_found- Value passed foruserwas invalid.
See the Common Errors guide for errors returned by every Web API method.
Marked a user as active. Deprecated and non-functional.
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- Bot token:
users:write - User token:
users:write
See the Common Errors guide for errors returned by every Web API method.
Set the user profile photo
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- User token:
users.profile:write
Optional Params
crop_w- Width/height of crop box (always square). Providing a "crop box" withcrop_x,crop_y, andcrop_wis optional. ex:100crop_x- X coordinate of top-left corner of crop box. Providing a "crop box" withcrop_x,crop_y, andcrop_wis optional. ex:10crop_y- Y coordinate of top-left corner of crop box. Providing a "crop box" withcrop_x,crop_y, andcrop_wis optional. ex:15image- File contents viamultipart/form-data. ex:...
Errors the API can return:
bad_image- The uploaded image could not be processed - try passing a JPEG, GIF or PNGtoo_large- The uploaded image had excessive dimensionstoo_many_frames- An animated GIF with too many frames was uploaded
See the Common Errors guide for errors returned by every Web API method.
Manually sets user presence.
API reference
Rate limit: Tier 2: 20+ per minute
Scopes:
- Bot token:
users:write - User token:
users:write
Required Params
presence- EitherautoorawayAcceptable values:autoawayex:away
Errors the API can return:
invalid_presence- Value passed forpresencewas invalid.
See the Common Errors guide for errors returned by every Web API method.