I want to get the user related events based on userid I'm trying to retrieve the event details. Here my query is:
List<Event> events = [SELECT Subject,StartDateTime,EndDateTime FROM Event WHERE OwnerId =:userinfo.getUserId()];
I'm trying to expose through REST API. How can I pass the UserId to RestRequest like here
String OwnerId =req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);
but how to link those two? For checking I'm using workbench by passing the user id I'm getting the event details related to that user but it won't display anything.