Skip to content

Latest commit

 

History

History
147 lines (115 loc) · 8.33 KB

users.info.md

File metadata and controls

147 lines (115 loc) · 8.33 KB

Gets information about a user.

Facts

| Method URL: | https://slack.com/api/users.info | | Preferred HTTP method: | GET | | Accepted content types: | application/x-www-form-urlencoded | | Rate limiting: | Tier 4 | | Works with: |

Token type Required scope(s)
bot users:read 
user users:read 
classic bot bot

|


This method returns information about a member of a workspace.

Arguments

Argument Example Required Description
token xxxx-xxxxxxxxx-xxxx Required Authentication token bearing required scopes.
user W1234567890 Required User to get info on
include_locale true Optional Set this to true to receive the locale for this user. Defaults to false

Present arguments as parameters in application/x-www-form-urlencoded querystring or POST body. This method does not currently accept application/json.

Response

Returns a user object.

Typical success response

{
    "ok": true,
    "user": {
        "id": "W012A3CDE",
        "team_id": "T012AB3C4",
        "name": "spengler",
        "deleted": false,
        "color": "9f69e7",
        "real_name": "Egon Spengler",
        "tz": "America/Los_Angeles",
        "tz_label": "Pacific Daylight Time",
        "tz_offset": -25200,
        "profile": {
            "avatar_hash": "ge3b51ca72de",
            "status_text": "Print is dead",
            "status_emoji": ":books:",
            "real_name": "Egon Spengler",
            "display_name": "spengler",
            "real_name_normalized": "Egon Spengler",
            "display_name_normalized": "spengler",
            "email": "spengler@ghostbusters.example.com",
            "image_original": "https://.../avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
            "image_24": "https://.../avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
            "image_32": "https://.../avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
            "image_48": "https://.../avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
            "image_72": "https://.../avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
            "image_192": "https://.../avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
            "image_512": "https://.../avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
            "team": "T012AB3C4"
        },
        "is_admin": true,
        "is_owner": false,
        "is_primary_owner": false,
        "is_restricted": false,
        "is_ultra_restricted": false,
        "is_bot": false,
        "updated": 1502138686,
        "is_app_user": false,
        "has_2fa": false
    }
}

Typical error response

{
    "ok": false,
    "error": "user_not_found"
}

Profile

The profile hash contains as much information as the user has supplied in the default profile fields: first_name, last_name, real_name, display_name, skype, and the image_* fields. Only the image_* fields are guaranteed to be included. Data that has not been supplied may not be present at all, may be null or may contain the empty string ("").

A user's custom profile fields may be discovered using users.profile.get.

Email addresses

Accessing email addresses
The users:read.email OAuth scope is now required to access the email field in user objects returned by the users.list and users.info web API methods. users:read is no longer a sufficient scope for this data field. Learn more.

Apps created after January 4th, 2017 must request both the users:read and users:read.email OAuth permission scopes simultaneously when using the OAuth app installation flow to enable access to the email field of user objects returned by this method.

Presence

A user's presence is found using users.getPresence.

Shared channels

When looking up a user belonging to a foreign workspace party to a shared channel, you'll find an is_stranger boolean attribute.

Errors

This table lists the expected errors that this method could return. However, other errors can be returned in the case where the service is down or other unexpected factors affect processing. Callers should always check the value of the ok params in the response.

Error Description
user_not_found Value passed for user was invalid.
user_not_visible The requested user is not visible to the calling user
not_authed No authentication token provided.
invalid_auth Some aspect of authentication cannot be validated. Either the provided token is invalid or the request originates from an IP address disallowed from making the request.
account_inactive Authentication token is for a deleted user or workspace.
token_revoked Authentication token is for a deleted user or workspace or the app has been removed.
no_permission The workspace token used in this request does not have the permissions necessary to complete the request. Make sure your app is a member of the conversation it's attempting to post a message to.
org_login_required The workspace is undergoing an enterprise migration and will not be available until migration is complete.
ekm_access_denied Administrators have suspended the ability to post a message.
missing_scope The token used is not granted the specific scope permissions required to complete this request.
invalid_arguments The method was called with invalid arguments.
invalid_arg_name The method was passed an argument whose name falls outside the bounds of accepted or expected values. This includes very long names and names with non-alphanumeric characters other than _. If you get this error, it is typically an indication that you have made a very malformed API call.
invalid_charset The method was called via a POST request, but the charset specified in the Content-Type header was invalid. Valid charset names are: utf-8 iso-8859-1.
invalid_form_data The method was called via a POST request with Content-Type application/x-www-form-urlencoded or multipart/form-data, but the form data was either missing or syntactically invalid.
invalid_post_type The method was called via a POST request, but the specified Content-Type was invalid. Valid types are: application/json application/x-www-form-urlencoded multipart/form-data text/plain.
missing_post_type The method was called via a POST request and included a data payload, but the request did not include a Content-Type header.
team_added_to_org The workspace associated with your request is currently undergoing migration to an Enterprise Organization. Web API and other platform operations will be intermittently unavailable until the transition is complete.
request_timeout The method was called via a POST request, but the POST data was either missing or truncated.
fatal_error The server could not complete your operation(s) without encountering a catastrophic error. It's possible some aspect of the operation succeeded before the error was raised.

Warnings

This table lists the expected warnings that this method will return. However, other warnings can be returned in the case where the service is experiencing unexpected trouble.

Warning Description
missing_charset The method was called via a POST request, and recommended practice for the specified Content-Type is to include a charset parameter. However, no charset was present. Specifically, non-form-data content types (e.g. text/plain) are the ones for which charset is recommended.
superfluous_charset The method was called via a POST request, and the specified Content-Type is not defined to understand the charset parameter. However, charset was in fact present. Specifically, form-data content types (e.g. multipart/form-data) are the ones for which charset is superfluous.