Using javascript i’ve tried the following:
const url = https://api.clockify.me/api/v1/workspaces/${workspaceId}/time-off/requests
;
const response = await $.http.post(url, {
headers: {
‘X-Api-Key’: $.auth.data.apiKey,
‘Content-Type’: ‘application/json’,
},
data: {
start,
end,
statuses: [‘ALL’],
page,
pageSize: 50,
},
});
note that the statuses is ALL (I’ve also tried APPROVED & the same structure as the sample payload from the api documentations relating to checking all time off requests from a workspace.
What’s been happening is that no matter what I do with the statuses syntax wise or removing it as well, the response always only shows statuses that have the type PENDING. I’ve added test cases with rejected and approved but they never show up. I’ve even tried just approved thinking maybe then, the response would be null but that’s not the case, I still only see pending status types. Could someone please point out what’s wrong with what I’ve done?
Side note, I’ve ensured to make the start and end dates align to when I created the rejected/approved requests too so I don’t think the issue lies within the time window. Also, i’ve tried talking marks “” instead of quotes ‘’ surrounding ALL and it still leads to the same issue.