ZCApprovalAPIService
This service lets you fetch Approval tasks in your Zoho Creator applications and execute approval actions.
Fetch approval List
Methods
func fetchApprovalList(for approvalAPIInfo:ApprovalAPIInfo, withFormLinkname formLinkname: String, andFromIndex fromIndex: Int, completionHandler: @escaping (Result) -> VoidFetches the Approval list for the given form and for the given Approval type.
func fetchApprovalList(for approvalAPIInfo:ApprovalAPIInfo, withFormLinkname formLinkname: String, andFromIndex fromIndex: Int, completionHandler: @escaping (Result) -> Void
Parameters
| ApprovalAPIInfo | A Struct that has Creator app info and approval type. |
|---|---|
| formLinkname | String, Form for which the approval has to be fetched. |
| andFromIndex | Int, List starting index. |
| completionHandler | Approval data will be returned in completion Handler. |
Example
let approvalAPIInfo = ApprovalAPIInfo.init(appOwner: "<appOwner>", appLinkName: "<appLinkName>", listType: ApprovalAPIInfo.ApprovalListType.pending)
ZCApprovalAPIService.fetchApprovalList(for: approvalAPIInfo , withFormLinkname formLinkname: "<formLinkname>", andFromIndex fromIndex: 0) { (result) in
switch result
{
case .success(let approval):
print(approval.tasks)
case .failure(let error):
print(error)
}
}