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
Soundhariyaa MSoundhariyaa 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 :
User-added image
User-added image

Can some body please help me,why is this error
or  
with the steps to followed..

Thanks in Advance.
Best Answer chosen by Soundhariyaa M
Danish HodaDanish Hoda
Hi There,
You are using incorrect URL, plz use:

/services/apexrest/casesTest/ --- ContactId ---