function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
om sai 10om sai 10 

Rest based web services

@RestResource(urlMapping='/Merchandise/*')
global with sharing class MerchandiseManager {

@HttpPost
global static String createMerchandise(String  firstname)
{
Merchandise__c m = new Merchandise__c( Name=firstname); 
insert m;
return m.Id;
}
)
I wants to know how this api be called by somebody from outside salesforce,i have tried workbench but that does not give me much idea.so if the json body is something like 
{
"firstname":'james"
}

How will this information be passed by calling the above method from outside salesforce.How will i call above given method.please help
 
 
Amit Chaudhary 8Amit Chaudhary 8
Please check below post. I hope that will help you
1) http://amitsalesforce.blogspot.com/2017/06/test-salesforce-api-by-postman-rest.html

NOTE:- In above post we are calling REST API from POSTMAN(outside of salesforce).

How to setup Postman you can check below recording
1) https://www.youtube.com/watch?v=WdAhD6p1nKM

Let us know if this will help you