We have a soql query which we run against the api that works on User object

Select Id,Name from User;

we are trying to enhance the query to retrieve the profile.name and role.name using the same query

Select profile.name,role.name,Id,Name from User;

we are getting invalid_grant: authentication failure when we run the query was wondering do we need special access to access these objects ? if someone could please point us in the right direction it would be of great help


There is a mistake in your SOQL to fetch role name from user object. Use the following query:

  SELECT Profile.Name, UserRole.Name, Id, Name FROM User;

You are getting invalid_grant: authentication failure so you probably need to include your API security token with the password.

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.