How to get the last task approval via API

I'm working on a custom workflow/automation where each task might have multiple associated approvals.

I need to get information about just the latest approval, via API call. Ideally, I won't have to get all the task approvals and loop through them to compare dates in order to accomplish this.

From the documentation at https://developers.wrike.com/documentation/api/methods/get-approvals, I thought I might be able to use the "limit" parameter (hoping that the return order would be by descending date so limiting to 1 would get just the latest approval), but in testing via Postman I'm getting an error.

API GET call (where {TASK-ID} is an actual task ID):

https://www.wrike.com/api/v4/tasks/{TASK-ID}/approvals?limit=1

Error:

Does anyone know why "limit" doesn't work as described in the documentation?

Is there a better/different way to get information about just the last approval on a given task?

0
👍 Spot On 💡 Innovative Approach 💪 Stellar Advice ✅ Solved 🪄 Remove Kudos
3 comentarios

Hi Laura Boylan! I think someone from our Advanced Support could help with that, so I'm raising a ticket for you now 🙂

Lisa Community Team at Wrike Wrike Product Manager Become a Wrike expert with Wrike Discover

Lisa Wrike Team member Become a Wrike expert with Wrike Discover

0
👍 Spot On 💡 Innovative Approach 💪 Stellar Advice ✅ Solved 🪄 Remove Kudos

Hi,

What was the solution on this? I assumed that the responce for the get approvals call are sorted with newest created date first. Is that not the case?

0
👍 Spot On 💡 Innovative Approach 💪 Stellar Advice ✅ Solved 🪄 Remove Kudos
Avatar
Juan

Hi Akshin Jalilov, thank you for sharing your question with us. I have opened a ticket with our Support Team on your behalf so our experts can provide you with an accurate reply. You will be contacted very soon 👍 Thank you!

0
👍 Spot On 💡 Innovative Approach 💪 Stellar Advice ✅ Solved 🪄 Remove Kudos

Folllowing List for Post: How to get the last task approval via API
[this list is visible for admins and agents only]

Arriba
Didn’t find what you were looking for? Write new post