Activity Forums Salesforce® Discussions How can you expose an Apex class as a REST WebService in Salesforce?

  • Sumit

    Member
    April 21, 2020 at 8:27 am

    you can expose your Apex class and methods so that external applications can access your code and your application through the REST architecture. This is done by defining your Apex class with the @RestResource annotation to expose it as a REST resource. You can then use global classes and a WebService callback method

  • Udit

    Member
    April 21, 2020 at 3:44 pm

    We can expose an Apex class as a REST web service by writing @RestResource on the top of the class and also giving the URL address in the parameters which will be used with the complete URL to hit on the REST class.
    @RestResource(urlMapping='/getAccount/*')

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos