You need to sign in to do that
Don't have an account?
Soundhariyaa M
Error when apex rest service is called from workbench rest explorer
I have created apex rest service and I am calling it from workbench rest explorer,but I am getting an error
Class :
@RestResource(urlMapping='/casesTest/*')
global with sharing class CaseManager {
@HttpGet
global static Case getCaseById(){
RestRequest request=RestContext.request;
String caseId= request.requestURI.substring(request.requestURI.lastIndexOf('/')+1);
Case result= [Select CaseNumber,Subject,Status,Priority From Case where Id=:caseId];
return result;
}
}
And then when
I am giving the url as
/services/apexrequest/casesTest/5002w000004RLjF
5002w000004RLjF is the caseId
I'm getting the following error :
Can some body please help me,why is this error
or
with the steps to followed..
Thanks in Advance.
Class :
@RestResource(urlMapping='/casesTest/*')
global with sharing class CaseManager {
@HttpGet
global static Case getCaseById(){
RestRequest request=RestContext.request;
String caseId= request.requestURI.substring(request.requestURI.lastIndexOf('/')+1);
Case result= [Select CaseNumber,Subject,Status,Priority From Case where Id=:caseId];
return result;
}
}
And then when
I am giving the url as
/services/apexrequest/casesTest/5002w000004RLjF
5002w000004RLjF is the caseId
I'm getting the following error :
Can some body please help me,why is this error
or
with the steps to followed..
Thanks in Advance.
You are using incorrect URL, plz use:
/services/apexrest/casesTest/ --- ContactId ---