Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

Is there a way from the SOAP/METADATA API to get the all the registered users of an enterprise using an API call with the admin's auth-token? I only require the email address, name and role of the all the enterprise users

share|improve this question
add comment

1 Answer 1

up vote 7 down vote accepted

you could either use the REST API

curl https://<INSTANCE>.salesforce.com/services/data/v20.0/query/?q=SELECT+email+,+name+,+roleid+from+User -H "Authorization: Bearer token"

for details see http://www.salesforce.com/us/developer/docs/api_rest/Content/dome_query.htm

or you can run a SOQL query against the SOAP API using your access token for the session ID

Details in the WebServices API Documentation http://www.salesforce.com/us/developer/docs/api/index_Left.htm#StartTopic=Content/sforce_api_calls_query.htm

share|improve this answer
    
What do you mean when you say 'depending on the number of users'? Is there a limit in case of the REST API? –  auny May 16 '13 at 10:14
    
not necessarily at a limit, except for the general 50k record Governor Limit. But I personally tend to use the SOAP API when working with larger record sets and programmatic requests –  Seb Wagner May 16 '13 at 14:54
3  
there is no 50k governor limit for the rest api, thats for apex. –  superfell May 16 '13 at 16:34
    
@superfell: you are absolutely right, error in reasoning. modified the answer –  Seb Wagner May 16 '13 at 21:45
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.