Background supergraphic

Singapore Work Permit

Singapore Work Permit is a document or a pass for foreigners that offers and validates their right to work in Singapore.

Singapore Work Permit Object

  • Name
    status
    Type
    string
    Description

    Enum code indicating the status of the reading result.

    1. SUCCESS
    2. NO_FILE
    3. FILE_INVALID_FORMAT
    4. FAILED
  • Name
    reason
    Type
    string
    Description

    A human-readable message providing more details about the reading result.

  • Name
    read
    Type
    object
    Description

    Contains the reading for each Singapore Work Permit fields. Each field contains:

    • confidence_text (number): Text recognition confidence in percentage (except photo field)
    • confidence (number): Overall confidence score in percentage
    • polygon (array): Array of coordinate pairs [x, y] representing the bounding box of the field
    • value_original (string): The original text as read from the document (except photo field)
    • value (string): The processed/extracted value
    • page_index (number): Page number where the field was found (0-indexed)
    • Name
      photo
      Type
      object
      Description

      Face in base64 format.

    • 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.


POST/ocr/v1/singapore-work-permit

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

POST
/ocr/v1/singapore-work-permit
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
{ "status": "SUCCESS", "reason": "File Successfully Read", "read": { "card_type": { "value": "S PASS", "value_original": "S PASS", "confidence": 91.02, "confidence_text": 99.98, "polygon": [ [309,16], [402,16], [402,46], [309,46] ], "page_index": 0 }, "employer": { "value": "BUSINESS ALLIANZE SERVICES PTE. LTD.", "value_original": "BUSINESS ALLIANZE SERVICES PTE. LTD.", "confidence": 87.36, "confidence_text": 99.64, "polygon": [ [21,108], [373,108], [373,135], [21,135] ], "page_index": 0 }, "sector": { "value": "SERVICE", "value_original": "SERVICE", "confidence": 84.77, "confidence_text": 99.99, "polygon": [ [84,142], [164,142], [164,166], [84,166] ], "page_index": 0 }, "photo": { "value": "iVB..", "confidence": 95.71, "polygon": [ [12,168], [181,168], [181,403], [12,403] ], "page_index": 0 }, "name": { "value": "GANDHI AMIT NAVINCHANDRA", "value_original": "GANDHI AMIT NAVINCHANDRA", "confidence": 97.96, "confidence_text": 99.39, "polygon": [ [193,180], [450,180], [450,205], [193,205] ], "page_index": 0 }, "occupation": { "value": "LOGISTICS EXECUTIVE", "value_original": "LOGISTICS EXECUTIVE", "confidence": 89.34, "confidence_text": 97.04, "polygon": [ [191,222], [396,222], [396,247], [191,247] ], "page_index": 0 }, "work_permit_no": { "value": "0 35858865", "value_original": "0 35858865", "confidence": 81.08, "confidence_text": 99.76, "polygon": [ [192,281], [311,281], [311,305], [192,305] ], "page_index": 0 }, "date_of_apply": { "value": "29-11-2012", "value_original": "29-11-2012", "confidence": 87.43, "confidence_text": 99.93, "polygon": [ [367,287], [472,287], [472,313], [367,313] ], "page_index": 0 }, "date_of_issue": { "value": "05-12-2012", "value_original": "05-12-2012", "confidence": 86.83, "confidence_text": 99.99, "polygon": [ [366,340], [474,340], [474,363], [366,363] ], "page_index": 0 }, "date_of_expiry": { "value": "19-05-2013", "value_original": "19-05-2013", "confidence": 89.49, "confidence_text": 99.98, "polygon": [ [363,385], [474,385], [474,408], [363,408] ], "page_index": 0 }, "card_number": { "value": "L2827000", "value_original": "L2827000", "confidence": 87.16, "confidence_text": 98.46, "polygon": [ [576,415], [702,415], [702,447], [576,447] ], "page_index": 0 }, "location": { "value": "", "value_original": "", "confidence": 0.0, "confidence_text": 0.0, "polygon": [], "page_index": 0 }, "fin": { "value": "", "value_original": "", "confidence": 0.0, "confidence_text": 0.0, "polygon": [], "page_index": 0 }, "date_of_birth": { "value": "", "value_original": "", "confidence": 0.0, "confidence_text": 0.0, "polygon": [], "page_index": 0 }, "nationality": { "value": "", "value_original": "", "confidence": 0.0, "confidence_text": 0.0, "polygon": [], "page_index": 0 }, "sex": { "value": "", "value_original": "", "confidence": 0.0, "confidence_text": 0.0, "polygon": [], "page_index": 0 } } }

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.", //..., }