There is no direct way in Apex to find out if an Org has API enabled. The closest thing you have is the 'PermissionsApiEnabled' field on the Profile object. You can therefore find out if the current user has API enabled for their profile.
Thinking out aloud here, but maybe you can perform a SOQL query to get the 'PermissionsApiEnabled' field on the standard 'System Administrator' profile. If that field is false, you can infer that API is not enabled for the Org? You'll have to try this in a Professional Edition Org to confirm though.
Not perfect, but it looks like that will have to do. Thanks a lot for your help.
Tom
All Answers
There is no direct way in Apex to find out if an Org has API enabled. The closest thing you have is the 'PermissionsApiEnabled' field on the Profile object. You can therefore find out if the current user has API enabled for their profile.
Thinking out aloud here, but maybe you can perform a SOQL query to get the 'PermissionsApiEnabled' field on the standard 'System Administrator' profile. If that field is false, you can infer that API is not enabled for the Org? You'll have to try this in a Professional Edition Org to confirm though.
Hope this helps...
Not perfect, but it looks like that will have to do. Thanks a lot for your help.
Tom