Blog Categories

Posted by on Jun 22, 2017 in Featured Blogs, Tutorials | 1 comment

Learn how to test your Rest API’s in Salesforce

Learn how to test your Rest API’s in Salesforce

Being a Developer its a big plus having knowledge implementing Webservices and more complex is the environment to Test those. I very often come across questions about “Testing the REST API’s” so I cannot resist sharing some great amount of knowledge for all new developers with this blog “Learn how to test your Rest API’s in Salesforce”. Everyone is aware about the two very common tools “Workbench” & “Postman”, these offer you some seriously amazing features to test your REST API’s. In this blog I’ll explain some working examples of the Same with building oAuth, Demo class, Basic JSON with examples and explanation. Let’s Start: Here is a Sample Apex Rest webservice that allows a Connected Application to push data into Salesforce. /******************************************************************************************* * Description – Apex REST service with GET and POST methods * Author – Vinay { “name” : “Vinay”, “phone” : “9999345317”, “website” : “www.vinaychaturvedi.com” } ********************************************************************************************/ @RestResource(urlMapping=’/v1/accounts/*’) global with sharing class RESTWebserviceForAccount { @HttpPost global static AccountWrapper doPost(String name, String phone, String website) { RestRequest req =...

Read More