FormXAPIClient

public class FormXAPIClient

FormXAPIClient is a network client to communicate with the FormX API

  • Initialize a new FormXAPIClient

    Declaration

    Swift

    public init(accessToken: String, apiHost: String? = nil)

    Parameters

    accessToken

    The access token

    apiHost

    The API host. Defaults to https://worker.formextractorai.com

  • Invoke the FormX document detection API at the FormX Worker Server

    Declaration

    Swift

    public func findDocuments(data: Data,
                              completion: @escaping (_ response: FormXAPIDetectDocumentsResult?, _ error: Error?) -> Void)

    Parameters

    data

    The image data

    completion

    The completion handler

  • Invoke the FormX document extraction API at the FormX Worker Server

    Declaration

    Swift

    public func extract(extractorId: String,
                        data: Data,
                        completion: @escaping (_ response: FormXAPIExtractResult?, _ error: Error?) -> Void)

    Parameters

    formId

    The form id

    data

    The data to be extracted

    completion

    The completion handler