How to get user ID in the new API with only user auth token?

Continuing the discussion from Getting user IDs?:

Continuing off this old thread, what’s the proper way to lookup a user in the NEW api, if I just have their user auth token?

As per the new API docs

Optional Query String Parameters

Name Type Description
id string User ID. Multiple user IDs can be specified. Limit: 100.
login string User login name. Multiple login names can be specified. Limit: 100.

You can specify a login or id as a query string argument to perform a search/lookup

Okay, but neither of those options works in this case, as he has specified “With only user auth token”. At the moment, there is no way to get the UserID using the New API, you have to use the root of the v5 API.

If you don’t specify any id or login to lookup, it will return the user who the token in your authorization header belongs to. Keep in mind it does not work with app access tokens as they do not belong to any user.

@Anaerin ah yes… I misread…


as per

Make a request with no optional query string arguments but with a user bearer in the header and it will return that user that the bearer belongs to

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.