Salesforce: Any API for getting user information?

I am trying to find a way to get the information about the salesforce enterprise user from his auth_token. I want to find the username, email address and role(admin/user) from the auth-token.

Something on the lines of

curl -XGET '' -H "Authorization: Bearter token"

which would give me the required information

I have been looking at the REST API and MetaData API but did not find anything. Preferably I would want this information from a REST API and not some programmatic API. Any help?


Assuming you’ve done OAuth, the OAuth response includes an id field with an Identity Service URL – e.g.:


GET this URL, passing the access token, and you’ll receive the user info. Note the use of -L to follow redirects:

$ curl -L -H 'X-PrettyPrint: 1' -H 'Authorization: Bearer 00D...'
    "display_name":"Sample User",
        "body":"Working on OAuth 2.0 article"

More info on the Identity Service.

Source : Link , Question Author : auny , Answer Author : metadaddy

Leave a Comment