NicOla
Intrepid explorer

approveRequest API

Jump to solution

I’m interested in using the approveRequest API.

If I have a Catalog item which has an approval workflow with two or more levels of approvers, can I use this API to approve just one level?

If I approve a request with this API – does it approve for all approvers?

Thanks

0 Kudos
1 Solution
CharlesW
Flexera
Flexera

The ApproveRequest API in api.asmx "forces" the approval process, in that it approves the entire request when invoked, regardless of the number of approval levels.  If You wanted to approve individual levels, then I believe that the REST endpoint allows you to approve individual levels within the approval process. The REST API is documented at the following URL:

https://docs.flexera.com/appportal/2021r1/ag/Content/helplibrary/ABAPI_Approvals_Reject.htm#appbroke...

View solution in original post

5 Replies
CharlesW
Flexera
Flexera

The ApproveRequest API in api.asmx "forces" the approval process, in that it approves the entire request when invoked, regardless of the number of approval levels.  If You wanted to approve individual levels, then I believe that the REST endpoint allows you to approve individual levels within the approval process. The REST API is documented at the following URL:

https://docs.flexera.com/appportal/2021r1/ag/Content/helplibrary/ABAPI_Approvals_Reject.htm#appbroke...

View solution in original post

I can confirm that to be the case.  It's been a few years since Charles helped me with this, so I don't remember all the details, but something to note about the REST API for approvals... 

The approval has to come from the "current approver" for the request unless you specify the overrideApprover flag in the request body.  What I don't recall is if the account context under which the API is being called has to be the current approver account or if it's sufficient to specify the correct approver credentials in the query parameters (dn=MyDomain&un=CurrentApprover).  I think it's the latter.  If you do specify the overrideApprover flag in the request body, it will behave the same as the SOAP API and approve the entire request (not just the current approval level).

Anything expressed here is my own view and not necessarily that of my employer, Flexera. If my reply answers a question you have raised, please click "ACCEPT AS SOLUTION".
0 Kudos

No, the account context does not matter. You just need to ensure that the un and dn parameters are those of the current approver.

Thanks for confirming. I  thought that was the case and totally makes sense (since you wouldn't want to give API access to all approvers).

Anything expressed here is my own view and not necessarily that of my employer, Flexera. If my reply answers a question you have raised, please click "ACCEPT AS SOLUTION".
NicOla
Intrepid explorer

Thanks Charles for clarifying.

0 Kudos