Fetch approval List | Zoho Creator Help

Fetch approval list

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) -> Void

Parameters

ApprovalAPIInfoA Struct that has Creator app info and approval type.
formLinknameString, Form for which the approval has to be fetched.
andFromIndexInt, List starting index.
completionHandlerApproval 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)
}
}

  1. Fetch recent approval
  2. Fetch approval summary
  3. Execute approval action