Utilities

Job Status

You may want to receive more information about a job. This is built into Web Api if you choose to set return_job_status as true in the options class. However, you also have the option to build the functionality yourself by using the Utilities class. Please note that if you are querying a job immediately after submitting it, you will need to poll it for the duration of the job.
1
from smile_id_core import Utilities,ServerError
2
3
try:
4
connection = Utilities("<partner_id>", "<the decoded-version of-your-api-key>", "<sid_server>")
5
job_status = connection.get_job_status("<partner_params>", "<option_params>", "<sec_key>", "<timestamp>")
6
print(job_status)
7
except ValueError:
8
# some of your params entered for a job are not valid or missing
9
print("handle ValueError")
10
except ServerError:
11
# Server returned an error
12
print("handle ServerError")
Copied!
This returns the job status as json data.
Example Response
1
{
2
"job_success":true,
3
"result":{
4
"ConfidenceValue":"99",
5
"JSONVersion":"1.0.0",
6
"Actions":{
7
"Verify_ID_Number":"Verified",
8
"Return_Personal_Info":"Returned",
9
"Human_Review_Update_Selfie":"Not Applicable",
10
"Human_Review_Compare":"Not Applicable",
11
"Update_Registered_Selfie_On_File":"Not Applicable",
12
"Liveness_Check":"Not Applicable",
13
"Register_Selfie":"Approved",
14
"Human_Review_Liveness_Check":"Not Applicable",
15
"Selfie_To_ID_Authority_Compare":"Completed",
16
"Selfie_To_ID_Card_Compare":"Not Applicable",
17
"Selfie_To_Registered_Selfie_Compare":"Not Applicable"
18
},
19
"ResultText":"Enroll User",
20
"IsFinalResult":"true",
21
"IsMachineResult":"true",
22
"ResultType":"SAIA",
23
"PartnerParams":{
24
"job_type":"1",
25
"optional_info":"we are one",
26
"user_id":"HBBBBBBH57g",
27
"job_id":"HBBBBBBHg"
28
},
29
"Source":"WebAPI",
30
"ResultCode":"0810",
31
"SmileJobID":"0000001111"
32
},
33
"code":"2302",
34
"job_complete":true,
35
"signature":"HKBhxcv+1qaLy\C7PjVtk257dE=|1577b051a4313ed5e3e4d29893a66f966e31af0a2d2f6bec2a7f2e00f2701259",
36
"history":[
37
{
38
"ConfidenceValue":"99",
39
"JSONVersion":"1.0.0",
40
"Actions":{
41
"Verify_ID_Number":"Verified",
42
"Return_Personal_Info":"Returned",
43
"Human_Review_Update_Selfie":"Not Applicable",
44
"Human_Review_Compare":"Not Applicable",
45
"Update_Registered_Selfie_On_File":"Not Applicable",
46
"Liveness_Check":"Not Applicable",
47
"Register_Selfie":"Approved",
48
"Human_Review_Liveness_Check":"Not Applicable",
49
"Selfie_To_ID_Authority_Compare":"Completed",
50
"Selfie_To_ID_Card_Compare":"Not Applicable",
51
"Selfie_To_Registered_Selfie_Compare":"Not Applicable"
52
},
53
"ResultText":"Enroll User",
54
"IsFinalResult":"true",
55
"IsMachineResult":"true",
56
"ResultType":"SAIA",
57
"PartnerParams":{
58
"job_type":"1",
59
"optional_info":"we are one",
60
"user_id":"HBBBBBBH57g",
61
"job_id":"HBBBBBBHg"
62
},
63
"Source":"WebAPI",
64
"ResultCode":"0810",
65
"SmileJobID":"0000001111"
66
}
67
],
68
"image_links":{
69
"selfie_image":"image_link"
70
},
71
"timestamp":"2019-10-10T12:32:04.622Z"
72
}
Copied!

validate_id_params

1
from smile_id_core import Utilities
2
3
try:
4
Utilities.validate_id_params("sid_server<0 for test or 1 for live or a string url>", "id_info_params", "partner_params", "use_validation_api=True")
5
except ValueError:
6
# some of your params entered for a job are not valid or missing
7
print("handle ValueError")
Copied!
This will validate id parameters using the smile services endpoint which checks the provided user id and partner params. If use_validation_api is False it will only do a local validation to check for country, id type and id number but by default this is True and will check against the smile services endpoint and if any key is missing will throw an exception

get_smile_id_services

1
from smile_id_core import Utilities,ServerError
2
3
try:
4
Utilities.get_smile_id_services("sid_server<0 for test or 1 for live or a string url>")
5
except ValueError:
6
# some of your params entered for a job are not valid or missing
7
print("handle ValueError")
8
except ServerError:
9
# Server returned an error
10
print("handle ServerError")
Copied!
This will return the smile services endpoint as a json object and can then be used for validation as per requirement

Example response

1
{
2
"id_types": {
3
"GH": {
4
"SSNIT": [
5
"country",
6
"id_type",
7
"id_number",
8
"user_id",
9
"job_id"
10
],
11
"VOTER_ID": [
12
"country",
13
"id_type",
14
"id_number",
15
"user_id",
16
"job_id"
17
],
18
"DRIVERS_LICENSE": [
19
"country",
20
"id_type",
21
"id_number",
22
"user_id",
23
"job_id"
24
],
25
"PASSPORT": [
26
"country",
27
"id_type",
28
"id_number",
29
"user_id",
30
"job_id"
31
]
32
},
33
"NG": {
34
"NIN": [
35
"country",
36
"id_type",
37
"id_number",
38
"user_id",
39
"job_id"
40
],
41
"CAC": [
42
"country",
43
"id_type",
44
"id_number",
45
"user_id",
46
"company",
47
"job_id"
48
],
49
"TIN": [
50
"country",
51
"id_type",
52
"id_number",
53
"user_id",
54
"job_id"
55
],
56
"VOTER_ID": [
57
"country",
58
"id_type",
59
"id_number",
60
"user_id",
61
"job_id"
62
],
63
"BVN": [
64
"country",
65
"id_type",
66
"id_number",
67
"user_id",
68
"job_id"
69
],
70
"PHONE_NUMBER": [
71
"country",
72
"id_type",
73
"id_number",
74
"user_id",
75
"job_id",
76
"first_name",
77
"last_name"
78
],
79
"DRIVERS_LICENSE": [
80
"country",
81
"id_type",
82
"id_number",
83
"user_id",
84
"job_id",
85
"first_name",
86
"last_name",
87
"dob"
88
],
89
},
90
"KE": {
91
"NATIONAL_ID": [
92
"country",
93
"id_type",
94
"id_number",
95
"user_id",
96
"job_id"
97
],
98
"ALIEN_CARD": [
99
"country",
100
"id_type",
101
"id_number",
102
"user_id",
103
"job_id"
104
],
105
"PASSPORT": [
106
"country",
107
"id_type",
108
"id_number",
109
"user_id",
110
"job_id"
111
]
112
},
113
"ZA": {
114
"NATIONAL_ID": [
115
"country",
116
"id_type",
117
"id_number",
118
"user_id",
119
"job_id"
120
],
121
"NATIONAL_ID_NO_PHOTO": [
122
"country",
123
"id_type",
124
"id_number",
125
"user_id",
126
"job_id"
127
]
128
}
129
},
130
"bank_codes": [
131
{
132
"name": "Access Bank",
133
"code": "044"
134
},
135
{
136
"name": "Access Bank (Diamond Bank)",
137
"code": "063"
138
},
139
{
140
"name": "Ecobank",
141
"code": "050"
142
},
143
{
144
"name": "Enterprise Bank",
145
"code": "084"
146
},
147
{
148
"name": "Fidelity Bank",
149
"code": "070"
150
},
151
{
152
"name": "First Bank",
153
"code": "011"
154
},
155
{
156
"name": "First City Monument Bank",
157
"code": "214"
158
},
159
{
160
"name": "Guaranty Trust Bank",
161
"code": "058"
162
},
163
{
164
"name": "Heritage Bank",
165
"code": "030"
166
},
167
{
168
"name": "Jaiz Bank",
169
"code": "301"
170
},
171
{
172
"name": "Keystone Bank",
173
"code": "082"
174
},
175
{
176
"name": "Mainstreet Bank",
177
"code": "014"
178
},
179
{
180
"name": "Polaris Bank",
181
"code": "076"
182
},
183
{
184
"name": "Stanbic IBTC",
185
"code": "039"
186
},
187
{
188
"name": "Skye Bank",
189
"code": "076"
190
},
191
{
192
"name": "Sterling Bank",
193
"code": "232"
194
},
195
{
196
"name": "Union Bank",
197
"code": "032"
198
},
199
{
200
"name": "UBA",
201
"code": "033"
202
},
203
{
204
"name": "Unity Bank",
205
"code": "215"
206
},
207
{
208
"name": "Wema Bank",
209
"code": "035"
210
},
211
{
212
"name": "Zenith Bank",
213
"code": "057"
214
}
215
]
216
}
Copied!
Last modified 4mo ago