here is my APEX REST class code
@RestResource(urlMapping='/CallREST1')
global with sharing class CallREST
{
@HttpPost
global static String createNewCase(String companyName)
{
System.debug('COMPANY: '+companyName);
return 'done';
}
}
my HTTP request code is
HttpRequest req = new HttpRequest();
req.setHeader('Authorization', 'OAuth ' + accessToken);
req.setHeader('Content-Type','application/json');
req.setHeader('accept','application/json');
req.setEndpoint(instance_url+'/services/apexrest/CallREST1');
req.setBody('{"companyName":"GenePoint"}');
req.setMethod('POST');
HttpResponse res =new Http().send(req);
please point me out where i am wrong..
i don't have any namespace, package name.
i have tried with appending Organization name or Organization ID , as i found from somewhere to try all this things..
any help is appreciated.
Bearer ACCESSTOKEN