1

I have one .Net web service which is used by my Salesforce application. I have used different Salesforce APIs to interact with Salesforce. Now, I have created one REST Service in my Salesforce application and before using it in .Net web service, I want to check whether this REST service exists or not. How can I do that? Do we have any metadata method to check existence of Apex Class/Rest Service?

4

You can querry the ApexClass using the RestEndpoint and provide your class name in where clause. If it returns record you can say that class exists. You can also query the class code in the body parameter.

Endpoint:

/services/data/v43.0/query?q=SELECT+ID,Name,BODY+FROM+ApexClass+WHERE+NAME+=+'MyClass' 
| 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.