> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.staple.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.staple.ai/_mcp/server.

# Scan National Registration Identity Card

POST https://api.staple.io/v1/documents/scan/nric
Content-Type: multipart/form-data

Scan a document using the NRIC model in Staple to receive the structured data extracted. The documents would be left in the queue specified for any further manipulation.

Reference: https://docs.staple.ai/api-reference/v1/documents/scan-national-registration-identity-card

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: v1
  version: 1.0.0
paths:
  /v1/documents/scan/nric:
    post:
      operationId: scanNationalRegistrationIdentityCard
      summary: Scan National Registration Identity Card
      description: >-
        Scan a document using the NRIC model in Staple to receive the structured
        data extracted. The documents would be left in the queue specified for
        any further manipulation.
      tags:
        - documents
      parameters:
        - name: x-api-key
          in: header
          description: API key issued by Staple.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Documents_scanNationalRegistrationIdentityCard_Response_200
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: string
                  format: binary
                  description: File to upload
                qid:
                  type: string
                handwritten:
                  type: string
              required:
                - files
                - qid
                - handwritten
servers:
  - url: https://api.staple.io
    description: https://api.staple.io
components:
  schemas:
    Documents_scanNationalRegistrationIdentityCard_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: Documents_scanNationalRegistrationIdentityCard_Response_200
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key issued by Staple.
    bearerAuth:
      type: http
      scheme: bearer
      description: JWT obtained from the login endpoint.

```

## Examples

### Scan NRIC



**Request**

```json
{}
```

**Response**

```json
{
  "scanDocuments": {
    "data": {
      "DOB": {
        "UICategory": "Basic Information",
        "UIName": "DOB",
        "UIType": "Date",
        "matches": [
          {
            "keyword": null,
            "match": null,
            "page": null,
            "value": null
          }
        ]
      },
      "DocSize": [
        [
          1200,
          1600
        ]
      ],
      "ExpiryDate": {
        "UICategory": "Basic Information",
        "UIName": "Expiry Date",
        "UIType": "Date",
        "matches": [
          {
            "keyword": [
              807,
              731,
              1055,
              767,
              931,
              749,
              "Date of Application",
              "Date of Application"
            ],
            "match": "09-12-2015",
            "matchmulti": null,
            "page": 0,
            "value": [
              810,
              777,
              988,
              807,
              899,
              792,
              "09-12-2015",
              "09-12-2015"
            ]
          }
        ]
      },
      "Gender": {
        "UICategory": "Basic Information",
        "UIName": "Gender",
        "UIType": "Text",
        "matches": [
          {
            "keyword": null,
            "match": null,
            "page": null,
            "value": null
          }
        ]
      },
      "IssueDate": {
        "UICategory": "Basic Information",
        "UIName": "Issue Date",
        "UIType": "Date",
        "matches": [
          {
            "keyword": [
              806,
              825,
              976,
              849,
              891,
              837,
              "Date of Issue",
              "Date of Issue"
            ],
            "match": "15-12-2015",
            "matchmulti": null,
            "page": 0,
            "value": [
              809,
              864,
              979,
              895,
              894,
              879.5,
              "15-12-2015",
              "15-12-2015"
            ]
          }
        ]
      },
      "Name": {
        "UICategory": "Basic Information",
        "UIName": "Name",
        "UIType": "Text",
        "matches": [
          {
            "keyword": [
              497,
              546,
              569,
              569,
              533,
              557.5,
              "Name",
              "Name"
            ],
            "match": "PAUL DU LONG",
            "matchmulti": null,
            "page": 0,
            "value": [
              500,
              585,
              722,
              615,
              611,
              600,
              "PAUL DU LONG",
              "PAUL DU LONG"
            ]
          }
        ]
      },
      "Nationality": {
        "UICategory": "Basic Information",
        "UIName": "Nationality",
        "UIType": "Text",
        "matches": [
          {
            "keyword": null,
            "match": null,
            "page": null,
            "value": null
          }
        ]
      },
      "NricNumber": {
        "UICategory": "Basic Information",
        "UIName": "Nric Number",
        "UIType": "Text",
        "matches": [
          {
            "keyword": [
              500,
              732,
              540,
              754,
              520,
              743,
              "FIN",
              "FIN"
            ],
            "match": "G3236437W",
            "matchmulti": null,
            "page": 0,
            "value": [
              501,
              763,
              684,
              791,
              592.5,
              777,
              "G3236437W",
              "G3236437W"
            ]
          }
        ]
      },
      "SmallBoxes": [
        {
          "box": [
            592,
            294,
            985,
            335,
            788.5,
            314.5,
            "EMPLOYMENT PASS",
            "EMPLOYMENT PASS"
          ],
          "page": 0
        },
        {
          "box": [
            392,
            333,
            1198,
            383,
            795,
            358,
            "Employment of Foreign Manpower Act ( Chapter 91A )",
            "Employment of Foreign Manpower Act ( Chapter 91A )"
          ],
          "page": 0
        },
        {
          "box": [
            628,
            371,
            963,
            411,
            795.5,
            391,
            "Republic of Singapore",
            "Republic of Singapore"
          ],
          "page": 0
        },
        {
          "box": [
            179,
            423,
            301,
            452,
            240,
            437.5,
            "Employer",
            "Employer"
          ],
          "page": 0
        },
        {
          "box": [
            179,
            451,
            589,
            485,
            384,
            468,
            "OTONOMOS BCC PTE.LTD.",
            "OTONOMOS BCC PTE.LTD."
          ],
          "page": 0
        },
        {
          "box": [
            196,
            367,
            275,
            379,
            235.5,
            373,
            "MINISTRY OF",
            "MINISTRY OF"
          ],
          "page": 0
        },
        {
          "box": [
            197,
            378,
            275,
            393,
            236,
            385.5,
            "MANPOWER",
            "MANPOWER"
          ],
          "page": 0
        },
        {
          "box": [
            497,
            546,
            569,
            569,
            533,
            557.5,
            "Name",
            "Name"
          ],
          "page": 0
        },
        {
          "box": [
            500,
            585,
            722,
            615,
            611,
            600,
            "PAUL DU LONG",
            "PAUL DU LONG"
          ],
          "page": 0
        },
        {
          "box": [
            497,
            619,
            646,
            652,
            571.5,
            635.5,
            "Occupation",
            "Occupation"
          ],
          "page": 0
        },
        {
          "box": [
            501,
            655,
            895,
            693,
            698,
            674,
            "APPLICATION DEVELOPER",
            "APPLICATION DEVELOPER"
          ],
          "page": 0
        },
        {
          "box": [
            500,
            732,
            540,
            754,
            520,
            743,
            "FIN",
            "FIN"
          ],
          "page": 0
        },
        {
          "box": [
            501,
            763,
            684,
            791,
            592.5,
            777,
            "G3236437W",
            "G3236437W"
          ],
          "page": 0
        },
        {
          "box": [
            807,
            731,
            1055,
            767,
            931,
            749,
            "Date of Application",
            "Date of Application"
          ],
          "page": 0
        },
        {
          "box": [
            810,
            777,
            988,
            807,
            899,
            792,
            "09-12-2015",
            "09-12-2015"
          ],
          "page": 0
        },
        {
          "box": [
            806,
            825,
            976,
            849,
            891,
            837,
            "Date of Issue",
            "Date of Issue"
          ],
          "page": 0
        },
        {
          "box": [
            1062,
            856,
            1291,
            891,
            1176.5,
            873.5,
            "03336437W",
            "03336437W"
          ],
          "page": 0
        },
        {
          "box": [
            809,
            864,
            979,
            895,
            894,
            879.5,
            "15-12-2015",
            "15-12-2015"
          ],
          "page": 0
        },
        {
          "box": [
            805,
            896,
            987,
            932,
            896,
            914,
            "Date of Expiry",
            "Date of Expiry"
          ],
          "page": 0
        },
        {
          "box": [
            808,
            943,
            976,
            972,
            892,
            957.5,
            "15-12-2017",
            "15-12-2017"
          ],
          "page": 0
        },
        {
          "box": [
            1184,
            996,
            1383,
            1028,
            1283.5,
            1012,
            "L6323953",
            "L6323953"
          ],
          "page": 0
        }
      ],
      "num_pages": 1
    },
    "docId": 8738,
    "status": "COMPLETED"
  }
}
```

**SDK Code**

```python Scan NRIC
import requests

url = "https://api.staple.io/v1/documents/scan/nric"

payload = "-----011000010111000001101001--\r\n"
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "multipart/form-data; boundary=---011000010111000001101001"
}

response = requests.post(url, data=payload, headers=headers)

print(response.json())
```

```javascript Scan NRIC
const url = 'https://api.staple.io/v1/documents/scan/nric';
const form = new FormData();

const options = {method: 'POST', headers: {'x-api-key': '<apiKey>'}};

options.body = form;

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Scan NRIC
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.staple.io/v1/documents/scan/nric"

	payload := strings.NewReader("-----011000010111000001101001--\r\n")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Scan NRIC
require 'uri'
require 'net/http'

url = URI("https://api.staple.io/v1/documents/scan/nric")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request.body = "-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body
```

```java Scan NRIC
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.staple.io/v1/documents/scan/nric")
  .header("x-api-key", "<apiKey>")
  .body("-----011000010111000001101001--\r\n")
  .asString();
```

```php Scan NRIC
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.staple.io/v1/documents/scan/nric', [
  'headers' => [
    'Content-Type' => 'multipart/form-data; boundary=---011000010111000001101001',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Scan NRIC
using RestSharp;

var client = new RestClient("https://api.staple.io/v1/documents/scan/nric");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "multipart/form-data; boundary=---011000010111000001101001");
request.AddParameter("undefined", "-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Scan NRIC
import Foundation

let headers = ["x-api-key": "<apiKey>"]
let parameters = []

let boundary = "---011000010111000001101001"

var body = ""
var error: NSError? = nil
for param in parameters {
  let paramName = param["name"]!
  body += "--\(boundary)\r\n"
  body += "Content-Disposition:form-data; name=\"\(paramName)\""
  if let filename = param["fileName"] {
    let contentType = param["content-type"]!
    let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)
    if (error != nil) {
      print(error as Any)
    }
    body += "; filename=\"\(filename)\"\r\n"
    body += "Content-Type: \(contentType)\r\n\r\n"
    body += fileContent
  } else if let paramValue = param["value"] {
    body += "\r\n\r\n\(paramValue)"
  }
}

let request = NSMutableURLRequest(url: NSURL(string: "https://api.staple.io/v1/documents/scan/nric")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Documents_scanNationalRegistrationIdentityCard_example



**Request**

```json
{
  "files": "<file: string>",
  "handwritten": "[true]",
  "qid": "1"
}
```

**Response**

```json
{
  "scanDocuments": {
    "data": {
      "DOB": {
        "UICategory": "Basic Information",
        "UIName": "DOB",
        "UIType": "Date",
        "matches": [
          {
            "keyword": null,
            "match": null,
            "page": null,
            "value": null
          }
        ]
      },
      "DocSize": [
        [
          1200,
          1600
        ]
      ],
      "ExpiryDate": {
        "UICategory": "Basic Information",
        "UIName": "Expiry Date",
        "UIType": "Date",
        "matches": [
          {
            "keyword": [
              807,
              731,
              1055,
              767,
              931,
              749,
              "Date of Application",
              "Date of Application"
            ],
            "match": "09-12-2015",
            "matchmulti": null,
            "page": 0,
            "value": [
              810,
              777,
              988,
              807,
              899,
              792,
              "09-12-2015",
              "09-12-2015"
            ]
          }
        ]
      },
      "Gender": {
        "UICategory": "Basic Information",
        "UIName": "Gender",
        "UIType": "Text",
        "matches": [
          {
            "keyword": null,
            "match": null,
            "page": null,
            "value": null
          }
        ]
      },
      "IssueDate": {
        "UICategory": "Basic Information",
        "UIName": "Issue Date",
        "UIType": "Date",
        "matches": [
          {
            "keyword": [
              806,
              825,
              976,
              849,
              891,
              837,
              "Date of Issue",
              "Date of Issue"
            ],
            "match": "15-12-2015",
            "matchmulti": null,
            "page": 0,
            "value": [
              809,
              864,
              979,
              895,
              894,
              879.5,
              "15-12-2015",
              "15-12-2015"
            ]
          }
        ]
      },
      "Name": {
        "UICategory": "Basic Information",
        "UIName": "Name",
        "UIType": "Text",
        "matches": [
          {
            "keyword": [
              497,
              546,
              569,
              569,
              533,
              557.5,
              "Name",
              "Name"
            ],
            "match": "PAUL DU LONG",
            "matchmulti": null,
            "page": 0,
            "value": [
              500,
              585,
              722,
              615,
              611,
              600,
              "PAUL DU LONG",
              "PAUL DU LONG"
            ]
          }
        ]
      },
      "Nationality": {
        "UICategory": "Basic Information",
        "UIName": "Nationality",
        "UIType": "Text",
        "matches": [
          {
            "keyword": null,
            "match": null,
            "page": null,
            "value": null
          }
        ]
      },
      "NricNumber": {
        "UICategory": "Basic Information",
        "UIName": "Nric Number",
        "UIType": "Text",
        "matches": [
          {
            "keyword": [
              500,
              732,
              540,
              754,
              520,
              743,
              "FIN",
              "FIN"
            ],
            "match": "G3236437W",
            "matchmulti": null,
            "page": 0,
            "value": [
              501,
              763,
              684,
              791,
              592.5,
              777,
              "G3236437W",
              "G3236437W"
            ]
          }
        ]
      },
      "SmallBoxes": [
        {
          "box": [
            592,
            294,
            985,
            335,
            788.5,
            314.5,
            "EMPLOYMENT PASS",
            "EMPLOYMENT PASS"
          ],
          "page": 0
        },
        {
          "box": [
            392,
            333,
            1198,
            383,
            795,
            358,
            "Employment of Foreign Manpower Act ( Chapter 91A )",
            "Employment of Foreign Manpower Act ( Chapter 91A )"
          ],
          "page": 0
        },
        {
          "box": [
            628,
            371,
            963,
            411,
            795.5,
            391,
            "Republic of Singapore",
            "Republic of Singapore"
          ],
          "page": 0
        },
        {
          "box": [
            179,
            423,
            301,
            452,
            240,
            437.5,
            "Employer",
            "Employer"
          ],
          "page": 0
        },
        {
          "box": [
            179,
            451,
            589,
            485,
            384,
            468,
            "OTONOMOS BCC PTE.LTD.",
            "OTONOMOS BCC PTE.LTD."
          ],
          "page": 0
        },
        {
          "box": [
            196,
            367,
            275,
            379,
            235.5,
            373,
            "MINISTRY OF",
            "MINISTRY OF"
          ],
          "page": 0
        },
        {
          "box": [
            197,
            378,
            275,
            393,
            236,
            385.5,
            "MANPOWER",
            "MANPOWER"
          ],
          "page": 0
        },
        {
          "box": [
            497,
            546,
            569,
            569,
            533,
            557.5,
            "Name",
            "Name"
          ],
          "page": 0
        },
        {
          "box": [
            500,
            585,
            722,
            615,
            611,
            600,
            "PAUL DU LONG",
            "PAUL DU LONG"
          ],
          "page": 0
        },
        {
          "box": [
            497,
            619,
            646,
            652,
            571.5,
            635.5,
            "Occupation",
            "Occupation"
          ],
          "page": 0
        },
        {
          "box": [
            501,
            655,
            895,
            693,
            698,
            674,
            "APPLICATION DEVELOPER",
            "APPLICATION DEVELOPER"
          ],
          "page": 0
        },
        {
          "box": [
            500,
            732,
            540,
            754,
            520,
            743,
            "FIN",
            "FIN"
          ],
          "page": 0
        },
        {
          "box": [
            501,
            763,
            684,
            791,
            592.5,
            777,
            "G3236437W",
            "G3236437W"
          ],
          "page": 0
        },
        {
          "box": [
            807,
            731,
            1055,
            767,
            931,
            749,
            "Date of Application",
            "Date of Application"
          ],
          "page": 0
        },
        {
          "box": [
            810,
            777,
            988,
            807,
            899,
            792,
            "09-12-2015",
            "09-12-2015"
          ],
          "page": 0
        },
        {
          "box": [
            806,
            825,
            976,
            849,
            891,
            837,
            "Date of Issue",
            "Date of Issue"
          ],
          "page": 0
        },
        {
          "box": [
            1062,
            856,
            1291,
            891,
            1176.5,
            873.5,
            "03336437W",
            "03336437W"
          ],
          "page": 0
        },
        {
          "box": [
            809,
            864,
            979,
            895,
            894,
            879.5,
            "15-12-2015",
            "15-12-2015"
          ],
          "page": 0
        },
        {
          "box": [
            805,
            896,
            987,
            932,
            896,
            914,
            "Date of Expiry",
            "Date of Expiry"
          ],
          "page": 0
        },
        {
          "box": [
            808,
            943,
            976,
            972,
            892,
            957.5,
            "15-12-2017",
            "15-12-2017"
          ],
          "page": 0
        },
        {
          "box": [
            1184,
            996,
            1383,
            1028,
            1283.5,
            1012,
            "L6323953",
            "L6323953"
          ],
          "page": 0
        }
      ],
      "num_pages": 1
    },
    "docId": 8738,
    "status": "COMPLETED"
  }
}
```

**SDK Code**

```python Documents_scanNationalRegistrationIdentityCard_example
import requests

url = "https://api.staple.io/v1/documents/scan/nric"

files = { "files": "open('string', 'rb')" }
payload = {
    "handwritten": "[true]",
    "qid": "1"
}
headers = {"x-api-key": "<apiKey>"}

response = requests.post(url, data=payload, files=files, headers=headers)

print(response.json())
```

```javascript Documents_scanNationalRegistrationIdentityCard_example
const url = 'https://api.staple.io/v1/documents/scan/nric';
const form = new FormData();
form.append('files', 'string');
form.append('handwritten', '[true]');
form.append('qid', '1');

const options = {method: 'POST', headers: {'x-api-key': '<apiKey>'}};

options.body = form;

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Documents_scanNationalRegistrationIdentityCard_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.staple.io/v1/documents/scan/nric"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"handwritten\"\r\n\r\n[true]\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"qid\"\r\n\r\n1\r\n-----011000010111000001101001--\r\n")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Documents_scanNationalRegistrationIdentityCard_example
require 'uri'
require 'net/http'

url = URI("https://api.staple.io/v1/documents/scan/nric")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"handwritten\"\r\n\r\n[true]\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"qid\"\r\n\r\n1\r\n-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body
```

```java Documents_scanNationalRegistrationIdentityCard_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.staple.io/v1/documents/scan/nric")
  .header("x-api-key", "<apiKey>")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"handwritten\"\r\n\r\n[true]\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"qid\"\r\n\r\n1\r\n-----011000010111000001101001--\r\n")
  .asString();
```

```php Documents_scanNationalRegistrationIdentityCard_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.staple.io/v1/documents/scan/nric', [
  'multipart' => [
    [
        'name' => 'files',
        'filename' => 'string',
        'contents' => null
    ],
    [
        'name' => 'handwritten',
        'contents' => '[true]'
    ],
    [
        'name' => 'qid',
        'contents' => '1'
    ]
  ]
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Documents_scanNationalRegistrationIdentityCard_example
using RestSharp;

var client = new RestClient("https://api.staple.io/v1/documents/scan/nric");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"handwritten\"\r\n\r\n[true]\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"qid\"\r\n\r\n1\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Documents_scanNationalRegistrationIdentityCard_example
import Foundation

let headers = ["x-api-key": "<apiKey>"]
let parameters = [
  [
    "name": "files",
    "fileName": "string"
  ],
  [
    "name": "handwritten",
    "value": "[true]"
  ],
  [
    "name": "qid",
    "value": "1"
  ]
]

let boundary = "---011000010111000001101001"

var body = ""
var error: NSError? = nil
for param in parameters {
  let paramName = param["name"]!
  body += "--\(boundary)\r\n"
  body += "Content-Disposition:form-data; name=\"\(paramName)\""
  if let filename = param["fileName"] {
    let contentType = param["content-type"]!
    let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)
    if (error != nil) {
      print(error as Any)
    }
    body += "; filename=\"\(filename)\"\r\n"
    body += "Content-Type: \(contentType)\r\n\r\n"
    body += fileContent
  } else if let paramValue = param["value"] {
    body += "\r\n\r\n\(paramValue)"
  }
}

let request = NSMutableURLRequest(url: NSURL(string: "https://api.staple.io/v1/documents/scan/nric")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```