0

I want to know if professional org buy REST API & SOAP Web Services usage, but I need to know it from code. It will be great if there are something like "Something.IsApiEnabled()" or "Something.IsFeatureEnable(Something.REST_API)" methods.

0

There's no API that tells you if the API is active for a given org. You need to make an API call, such as to /services/data/; if you get a 4xx error, you don't have API access, otherwise you do. Note that you'll need to read the error message to determine why you don't have API access; it may be that your profile does not have API access, or your org does not. The relevant errors are API_CURRENTLY_DISABLED and API_DISABLED_FOR_ORG for user and org restrictions, respectively.

| improve this answer | |

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.