5

We have an app which will use Salesforce API call's to do some functions using salesforce data. User will login into salesforce using OAuth and we have corresponding connected apps created in salesforce.

To execute our app functionality, the user who logged should have certain API enabled. For example, he should have Partner API enabled. If that API is not enabled for the user, then our app will be of no use to him.

How can we check whether the logged-in user has specific API enabled? Is there any API present in salesforce which will give the list of API's enabled for the logged in user ? Or is there any API to check whether a particular API has been enabled for user or not?

6
  • 2
    Hopefully you will get a better answer, but wrapping a call to the API in try/catch to detect if it works is one way.
    – Keith C
    Commented Jul 17, 2015 at 7:45
  • I am not sure, 'API Enabled' is the only permission in profile which can be used to check if API is enabled for this User Commented Jul 17, 2015 at 8:36
  • @KeithC We are currently doing that. But that's not the right to do it right? Commented Jul 17, 2015 at 10:38
  • @AmitBangad Does the profile has API access? login.salesforce.com/id/<org_id>/<user_id> will get the user info. It just contains the list of urls. But it does not contains the API enabled for the user Commented Jul 17, 2015 at 10:41
  • If this is the only approach available then by default it is the right approach... (You could put the detection in a separate class so if you find a better way you just have to change that one class.)
    – Keith C
    Commented Jul 17, 2015 at 11:15

1 Answer 1

0

It seems the only approach is by calling the API and wrap it with try/catch to know whether an user access to a SF API or not.

If anyone knows the correct API or later added, please answer this question

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .