CentraSite 10.3 | CentraSite Developer's Guide | Web Service Interfaces | Approval Service | Retrieving the List of Approval Requests that a User Has Submitted
 
Retrieving the List of Approval Requests that a User Has Submitted
You can use the getApprovalRequests operation to retrieve the list of approval requests that the authenticated user has submitted to CentraSite. By default, this operation returns all the approval requests that a user has submitted. However, you can optionally set the objectType, submittedAfter, submittedBefore, and status parameters to filter the list by the following criteria:
*The type of object on which the request was submitted
*The time period during which the request was submitted
*The status of the request (for example, retrieve only those requests that have not yet been approved)
You would use this operation, for example, to show users a list of their requests that are pending approval.
Tip:
This operation provides functionality like that of the Approval Requests list in CentraSite Control.
ApprovalRequestList Message
The getApprovalRequests operation (and other operations provided by the Approval service) returns an ApprovalRequestList message. This message contains an array of ApprovalRequest elements. Each ApprovalRequest element in the array represents a single approval request and contains the following information:
*The key of the approval request object (this key is required to perform operations that act directly on a specific approval request)
*The key of the user who submitted the approval request
*The date on which the approval request was submitted
*The key of registry object for which the approval request was submitted
*The type of object for which the approval request was submitted
*The status of the request
*Remarks, if any, that were submitted with the approval request
The approval requests in the array are not sorted.
The ApprovalRequestList message also returns an attribute called count that indicates the total number of approval requests in the result set. If the operation does not find any approval requests that satisfied the operation's criteria, then no element is returned in ApprovalRequest[] and the count value is zero.
If you want to receive the result, set a few entries at a time instead of all at once, you can use the scroll parameter in the request message to specify which block of entries you want the operation to return. For more information about using the scroll parameter, see Scrolling Through the List of Returned Approval Requests.
Getting Details about the Actions of the Approvers Associated with a Request
Once you have an ApprovalRequestList, you can use the getApprovalActions operation to obtain detailed information about the approvers associated with any request in the list.
The getApprovalsActions operation takes an approval request key as input (which you can get from the ApprovalRequestList) and returns the set of approvers associated with the specified request. (You can specify multiple keys if you want to get the details for multiple approval requests.)
The getApprovalsActions operation returns an ApprovalActionResult message. The ApprovalAction[] array in this message identifies the set of approvers associated with a particular approval request. Each ApprovalAction element in this array contains the following information:
*The key for the approver (that is, the key to the User object that represents the approver)
*The status of the approver's action on this request is as follows:
*If the request has not yet been processed to completion (that is, it has not yet been approved or rejected) and the approver has not taken any action on the request, then the status is Pending.
*If the approver has approved the request, then the status is Approved.
*If the approver has rejected the request, then the status is Rejected.
*If the request has been processed to completion (that is, it has been approved or rejected), approvers who did not make the approval decision have the status as No Action. (If the approval request was auto-approved, all of the approvers have the status as No Action.)
Tip:
This operation provides functionality like that of the Approval Requests list when you use CentraSite Control to display the details for an approval request.