Notes
HTTP Get Method (@HTTPGet
)
@RestResource(urlMapping='/FieldCase/*')
global class RestCaseController {
@HTTPGet
global static List<Case> getRelatedCases(){
String AccountName = RestContext.request.params.get('AcName');
Account ac = [SELECT Id, Name,Rating FROM Account WHERE Name =:AccountName];
List<Case> relatedCases =[SELECT Id, Subject, Status FROM case
WHERE AccountId=:ac.Id];
return relatedCases;
}
}
Use the following script to get parameters from workbench:
RestContext.request.params.get('AcName');