In this lesson, you’ll use REST Explorer in Workbench to send a REST client request to create a new merchandise record. This request invokes one of the Apex REST methods you’ve just implemented.
Workbench’s REST Explorer simulates a REST client. It uses the session of the logged-in user as an authentication mechanism for callingApex REST methods.
You might be able to skip the first few steps in this procedure if you already set up sample data with Workbench in a previous tutorial.
- Navigate to: workbench.developerforce.com.
- If prompted for your credentials, enter your login information and click Login.
- For Environment, select Production.
- Accept the terms of service and click Login with Salesforce.
- Click Allow to allow Workbench to access your information.
- After logging in, click .
- Click POST.
- The URL path that REST explorer accepts is relative to the instance URL of your org, so you only have to provide the path that is appended to the instance URL. In the relative URL box, replace the default URL with /services/apexrest/Merchandise/
- For the request body, insert the following JSON string representation of the object to insert:
{ "name" : "Eraser", "description" : "White eraser", "price" : 0.75, "inventory" : 1000 }
Note that the field names for the object to create must match and must have the same case as the names of the parameters of the method that will be called. - Click Execute. This causes the createMerchandise method to be called. The response contains the ID of the new merchandise record.
- To obtain the ID value from the response, click Show Raw Response, and then copy the ID value, without the quotation marks, that is displayed at the bottom of the response. For example, "a04R00000007xX1IAI", but your value will be different. You’ll use this ID in the next lesson to retrieve the record you’ve just inserted.
Salesforce Admin Online Training Call Us-91-900-044-4287 21st Century Software Solutions Online Training 21st Century providing Online training and support on All Technologies. If you are seeking training and support you can reach me on 91-9000444287. Online training by real time Experts. Call us 001-309-200-3848 for online training http://www.21cssindia.com/courses/salesforce-admin-online-training-143.html
ReplyDeleteSalesforce CRM Online Training Call Us-001-201-210-8616 21st Century Software Solutions Online Training 21st Century providing Online training and support on All Technologies. If you are seeking training and support you can reach me on 91-9000444287. Online training by real time Experts. Call us 001-309-200-3848 for online training http://www.21cssindia.com/courses/salesforce-crm-online-training-212.html
Salesforce Developer Online Training Call Us-001-309-200-3848 21st Century Software Solutions Online Training 21st Century providing Online training and support on All Technologies. If you are seeking training and support you can reach me on 91-9000444287. Online training by real time Experts. Call us 001-309-200-3848 for online training http://www.21cssindia.com/courses/salesforce-developer-online-training-144.html
• Nice and good article. It is very useful for me to learn and understand easily. Thanks for sharing your valuable information and time. Please keep updatingAzure Online Training
ReplyDeleteI really liked your blog post.Much thanks again. Awesome.
ReplyDeletesalesforce online training in hyderabad
salesforce online training hyderabad