People 5.0 widget and API questions

People 5.0 widget and API questions

While creating Widget for People 5 I found couple issues that I can’t find answer on my own: 
 
1) How to get leave requests according to this API https://www.zoho.com/people/api/get-records-v2.html.  
I tried: 
requestData = { 
"url": "https://people.zoho.eu/api/v2/leavetracker/leaves/records",
"
connectiondetails": "zoho_people",
"method": "GET",
"
apiParams": { "from": "2025-02-03", "to": "2025-04-28", "approvalStatus": [ "APPROVED", "PENDING", "REJECTED" ], "dateFormat": "yyyy-MM-dd", "startIndex": 0, "limit": 200 }
 }
 

ZOHO.People.API.invokeUrl(requestData); 

In response I’m getting: {
"
statusLine":"HTTP/1.1 400 ",
"content":"{\"CODE\":
3028,\"code\":3028,\"errorMessage\":\"EXTRA_PARAM_FOUND\",\"status\":\"Failure\"}",
"statusCode":400
}
 

I tested the same in the custom deluge script and it works fine. 

 

2) How to search records according to this API https://www.zoho.com/people/api/forms-api/search-record.html 
I tried: 
requestData ={

"url": "https://people.zoho.eu/people/api/forms/designation/getRecords?searchParams={searchField:'Designation_Category1',searchOperator:'Is',searchText:'Tester'}",
"connectiondetails": "zoho_people",
"method": "GET"
}

ZOHO.People.API.invokeUrl(requestData); 

In response I’m getting: { "code": "PATTERN_NOT_MATCHED", "paramName": "url", "error": "Enter valid input", "message": "PATTERN_NOT_MATCHED" } 

I tested the same in the custom deluge script and it works fine. 

 

3) How can I Approve or Reject the Leave request using API? Can you please provide the code sample which I can use in the widget? 

Thanks!