In this module when you see “yourInstance” in links or code be sure to change it out with your Salesforce Org instance. It's annotated with and is invoked for a GET request. The getRecord method is a custom REST API call. For example, this sample Apex REST class uses one method. Add annotations to the class and methods. Define your class as global, and define methods as global static. Making your Apex class available as a REST web service is straightforward. The application calls an Apex web service class to manage Salesforce case records. By using one interface, representatives can view and update case records and access internal resources. Customer support representatives are expected to use the same application to perform their daily work, including managing case records in Salesforce. By making your methods callable through the web, your external applications can integrate with Salesforce to perform all sorts of nifty operations.įor example, say your company's call center is using an internal application to manage on-premises resources. You can expose your Apex class methods as a REST or SOAP web service operation. (This clip starts at the 1:07:03 minute mark, in case you want to rewind and watch the beginning of the step again.) Expose Your Apex Class as a Web Service Want to follow along with an expert as you work through this step? Take a look at this video, part of the Trail Together series on Trailhead Live. Write a test method for an Apex REST method by calling the method with parameter values.Write a test method for an Apex REST method and set properties in a test REST request.Pass data to a custom Apex REST method by sending a request body in JSON format.Invoke a custom Apex REST method with an endpoint.Create an Apex REST class that contains methods for each HTTP method.
0 Comments
Leave a Reply. |