# 2. FOCR SDK Features

**init SDK**

```swift
 FtechOCRManager.instance().initSDK(appID: "103211", key: "dbfabc2ebf87889ec1e580e5de07b85e") {
           //Handle success
        } onFailure: { error in
            // Handle Failure
        }
```

| Param | Type   | Description    |
| ----- | ------ | -------------- |
| appId | String | Application id |
| key   | String | Secret key     |

Contact us for get `app_id` & `secret_key`

**Get config**

* Get list config mode used to ocr param
* When sucess, result is ConfigData, it will be called on onSuccess() in callback
* When fail, it will called on onFailure() in callback

```swift
 FtechOCRManager.instance().getConfig { listConfig in
            //Handle success
        } onFailure: { error in
            //Handle Failure
        }
```

**Start OCR**

```swift
  FtechOCRManager.instance().startOCR(with: URL, config) { data in
          
        } onFailure: { error in
            //Handle Failure
        }
```

| Param  | Type       | Description                                                                                          |
| ------ | ---------- | ---------------------------------------------------------------------------------------------------- |
| file   | URL        | The URL should point to a resource that the OCR manager can access and read                          |
| config | ConfigMode | The exact type and values that this parameter can take would depend on the implementation of the OCR |

**Export file**

```swift
  FtechOCRManager.instance().export(with: requestID, fileType: String) { data in
            // Handle success
        } onFailure: { error in
            //Handle Failure
        }
```

| Param     | Type   | Description                         |
| --------- | ------ | ----------------------------------- |
| requestID | String | Taken from CORData                  |
| fileType  | String | Supports two formats `csv`, `excel` |

**UI Preview OCR data**

* Implement `FOCRViewController` with input `OCRData`
