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


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

| 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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