# API Reference

### setActivation

{% code overflow="wrap" %}

```swift
+(int)setActivation:(NSString*)license;
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="137"></th><th></th></tr></thead><tbody><tr><td><strong>Name</strong></td><td>setActivation</td></tr><tr><td><strong>Description</strong></td><td>Activate SDK</td></tr><tr><td><strong>Input</strong></td><td><ul><li><strong>license</strong> (NSString*): The license string</li></ul></td></tr><tr><td><strong>Output</strong></td><td><p>The SDK activation status code.</p><ul><li>0: Success</li><li>Non-zero: Activation failed</li></ul></td></tr></tbody></table>

### initSDK

{% code overflow="wrap" %}

```swift
+(int)initSDK;
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="137"></th><th></th></tr></thead><tbody><tr><td><strong>Name</strong></td><td>initSDK</td></tr><tr><td><strong>Description</strong></td><td>Initiate SDK</td></tr><tr><td><strong>Input</strong></td><td>None</td></tr><tr><td><strong>Output</strong></td><td><p>The SDK initialization status code.</p><ul><li>0: Success</li><li>-1: License Key Error</li><li>-2: License AppID Error</li><li>-3: License Expired</li><li>-4: Activate Error</li><li>-5: Initialize SDK Error</li></ul></td></tr></tbody></table>

### idcardRecognition

{% code overflow="wrap" %}

```swift
+(NSMutableDictionary*)idcardRecognition:(UIImage*)image;
```

{% endcode %}

<table data-header-hidden><thead><tr><th width="137"></th><th></th></tr></thead><tbody><tr><td><strong>Name</strong></td><td>idcardRecognition</td></tr><tr><td><strong>Description</strong></td><td>Extract data from ID Document</td></tr><tr><td><strong>Input</strong></td><td><ul><li><strong>image</strong> (UIImage*): The input image</li></ul></td></tr><tr><td><strong>Output</strong></td><td>A dictionary representing the extracted data.</td></tr></tbody></table>

#### Output Example for idcardRecognition

<figure><img src="/files/z8BIXTSsf5vmq2cYHlCI" alt=""><figcaption></figcaption></figure>

{% code overflow="wrap" %}

```json
{
	"Document Number":"963545627",
	"Nationality":"USA",
	"Date of Issue":"2017-04-14",
	"Document Class Code":"P",
	"Issuing State Code":"USA",
	"Full Name":"JOHN DOE",
	"Date of Birth":"1996-03-15",
	"Sex":"M",
	"Date of Expiry":"2027-04-14",
	"Surname":"JOHN",
	"Given Names":"DOE",
	"Issuing State Name":"United States",
	"Authority":"United States,Department of State",
	"Place of Birth":"CALIFORNIA, U.S.A",
	"Document Name":"Passport",
	"Quality":99,
	"Position": {
		"x1":24,"y1":4294967295,"x2":577,"y2":381
	},
	"MRZ": {
		"Document Number":"963545637",
		"MRZ":"P<USAJOHN<<DOE<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<,9635456374USA9603150M2704140202113962<804330",
		"Document Class Code":"P",
		"Issuing State Code":"USA",
		"Full Name":"JOHN DOE",
		"Nationality Code":"USA",
		"Date of Birth":"1996-03-15",
		"Sex":"M",
		"Date of Expiry":"2027-04-14",
		"Surname":"JOHN",
		"Given Names":"DOE",
		"Issuing State Name":"United States",
		"MRZ Type":"ID-3",
		"Validation":1
	},
	"Images":{
		"Portrait":"/9j/4AAQSkZJRgABAQEAxwDH....KUr2P//Z",
		"Document":"/9j/4AAQSkZJRgABAQEAxwDH....o/Dd8yZC"
	}
}
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.recognito.vision/id-document-recognition-sdk/integration-guide/ios/api-reference.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
