
Singapore Work Permit
Singapore Work Permit is a document or a pass for foreigners that offers and validates their right to work in Singapore.
Before using the Singapore Work Permit OCR service, please review the OCR limitations that may affect text recognition accuracy.
Singapore Work Permit Object
- Name
status
- Type
- string
- Description
Enum code indicating the status of the reading result.
SUCCESS
NO_FILE
FILE_INVALID_FORMAT
FAILED
- Name
reason
- Type
- string
- Description
A human-readable message providing more details about the reading result.
- Name
images
- Type
- object
- Description
Contains the cropped image (in
base64
format) of face in document.- Name
photo
- Type
- string
- Description
Face in
base64
format.
- Name
read
- Type
- object
- Description
Contains the reading for each Singapore Work Permit fields. Each fields has
confidence
(in percentage) andvalue
(the reading).- Name
card_number
- Type
- object
- Description
Card number.
- Name
card_type
- Type
- object
- Description
Card type.
- Name
date_of_apply
- Type
- object
- Description
Date of application.
- Name
date_of_birth
- Type
- object
- Description
Date of birth.
- Name
date_of_expiry
- Type
- object
- Description
Date of expiry.
- Name
date_of_issue
- Type
- object
- Description
Date of issue.
- Name
employer
- Type
- object
- Description
Employer.
- Name
fin
- Type
- object
- Description
Foreign identification number.
- Name
location
- Type
- object
- Description
Location.
- Name
name
- Type
- object
- Description
Name.
- Name
nationality
- Type
- object
- Description
Nationality.
- Name
occupation
- Type
- object
- Description
Occupation.
- Name
sector
- Type
- object
- Description
Sector.
- Name
sex
- Type
- object
- Description
Sex.
- Name
work_permit_no
- Type
- object
- Description
Work permit number.
Read Singapore Work Permit
Detects a valid Singapore Work Permit image and returns the information as text.
Required parameter
- Name
image
- Type
- file (.png, .jpg, .jpeg)
- Description
The image file for the Singapore Work Permit.
Sample Request
1
2
3
4
5
import ApiClient from '@glair/vision';
const vision = new Vision({ apiKey: 'api-key', username: 'username', password: 'password' });
await vision.ocr.singaporeWorkPermit({ image: '/path/to/image/WorkPermit.jpg' });
Sample Response
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{
"images": {
"photo": "iVBOR...."
},
"read": {
"card_number": {
"confidence": 99,
"value": "P8402957"
},
"card_type": {
"confidence": 97,
"value": "WORK PERMIT"
},
"date_of_apply": {
"confidence": 98,
"value": "01-08-2012"
},
"date_of_birth": {
"confidence": 0,
"value": ""
},
"date_of_expiry": {
"confidence": 99,
"value": "15-08-2013"
},
"date_of_issue": {
"confidence": 96,
"value": "15-08-2012"
},
"employer": {
"confidence": 93,
"value": "ABC CONSTRUCTION PTE. LTD."
},
"fin": {
"confidence": 0,
"value": ""
},
"location": {
"confidence": 0,
"value": ""
},
"name": {
"confidence": 99,
"value": "STEVEN THORNTON"
},
"nationality": {
"confidence": 0,
"value": ""
},
"occupation": {
"confidence": 97,
"value": "SENIOR SOFTWARE CONSULTANT"
},
"sector": {
"confidence": 99,
"value": "BANKING"
},
"sex": {
"confidence": 0,
"value": ""
},
"work_permit_no": {
"confidence": 98,
"value": "6 21261581"
}
},
"reason": "File successfully read.",
"status": "SUCCESS"
}
Request ID
An associated request identifier is generated for every request made to this endpoint.
This value can be found in the response headers under Request-Id
Responses
Various responses for this endpoint, in addition to general responses specified in Errors.
200 - OK
Request with readable Singapore Work Permit image
Response
1
2
3
4
5
{
"status": "SUCCESS",
"reason": "File successfully read.",
//...,
}
400 - Bad Request
Request without form-data image
Response
1
2
3
4
5
{
"status": "NO_FILE",
"reason": "No file in request body. Some fields are invalid.",
//...,
}
415 - Unsupported Media Type
Request with non-image file format
Response
1
2
3
4
5
{
"status": "FILE_INVALID_FORMAT",
"reason": "Failed to process invalid file format. Please upload the correct file format. Some fields are invalid.",
//...,
}