VoiceIt2 3.1.0 → 3.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VoiceIt2.rb +215 -134
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 487e1b81faba95b374b437a23aa1d186a617d6e3b2abe6b5e98638d6be988907
|
4
|
+
data.tar.gz: d5bd2751d68c50a536ef5819867cc65c6ed23151b45556809cb5641ad6031088
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80c096ed18d8ad77c8e1175fd3669463edd628fc327c22ef18531a74ddf3d6e55ac45f3d16df1db1ae291ca540f629217cdb52b050f2d248e9b2d0f3eede19ea
|
7
|
+
data.tar.gz: 76cc28e5273fe79085e1559d04a8804a1eab3f72366b9e323e0adbb095c08825013f70d7a55fdc9501b75fb751fdb3fef4be922f5569bc828e6bc551c226a79e
|
data/VoiceIt2.rb
CHANGED
@@ -1,22 +1,36 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'rest-client'
|
3
|
+
require 'cgi'
|
4
|
+
|
3
5
|
|
4
6
|
class VoiceIt2
|
5
7
|
|
8
|
+
BASE_URL = 'https://api.voiceit.io/'
|
9
|
+
VERSION = '3.6.0'
|
10
|
+
|
6
11
|
def initialize(key, tok)
|
7
|
-
@
|
12
|
+
@notification_url = ""
|
8
13
|
@api_key = key
|
9
14
|
@api_token = tok
|
10
15
|
end
|
11
16
|
|
17
|
+
def addNotificationUrl(notificationURL)
|
18
|
+
@notification_url = "?notificationURL=" + CGI.escape(notificationURL)
|
19
|
+
end
|
20
|
+
|
21
|
+
def removeNotificationUrl()
|
22
|
+
@notification_url = ""
|
23
|
+
end
|
24
|
+
|
12
25
|
def getAllUsers
|
13
26
|
return RestClient::Request.new(
|
14
27
|
:method => :get,
|
15
|
-
:url =>
|
28
|
+
:url => BASE_URL + 'users' + @notification_url,
|
16
29
|
:user => @api_key,
|
17
30
|
:password => @api_token,
|
18
31
|
:headers => {
|
19
|
-
platformId: '35'
|
32
|
+
platformId: '35',
|
33
|
+
platformVersion: VERSION
|
20
34
|
}).execute
|
21
35
|
rescue => e
|
22
36
|
e.response
|
@@ -25,11 +39,12 @@ class VoiceIt2
|
|
25
39
|
def createUser
|
26
40
|
return RestClient::Request.new(
|
27
41
|
:method => :post,
|
28
|
-
:url =>
|
42
|
+
:url => BASE_URL + 'users' + @notification_url,
|
29
43
|
:user => @api_key,
|
30
44
|
:password => @api_token,
|
31
45
|
:headers => {
|
32
|
-
platformId: '35'
|
46
|
+
platformId: '35',
|
47
|
+
platformVersion: VERSION
|
33
48
|
}).execute
|
34
49
|
rescue => e
|
35
50
|
e.response
|
@@ -38,11 +53,12 @@ class VoiceIt2
|
|
38
53
|
def checkUserExists(userId)
|
39
54
|
return RestClient::Request.new(
|
40
55
|
:method => :get,
|
41
|
-
:url =>
|
56
|
+
:url => BASE_URL + 'users/' + userId + @notification_url,
|
42
57
|
:user => @api_key,
|
43
58
|
:password => @api_token,
|
44
59
|
:headers => {
|
45
|
-
platformId: '35'
|
60
|
+
platformId: '35',
|
61
|
+
platformVersion: VERSION
|
46
62
|
}).execute
|
47
63
|
rescue => e
|
48
64
|
e.response
|
@@ -51,109 +67,167 @@ class VoiceIt2
|
|
51
67
|
def deleteUser(userId)
|
52
68
|
return RestClient::Request.new(
|
53
69
|
:method => :delete,
|
54
|
-
:url =>
|
70
|
+
:url => BASE_URL + 'users/' + userId + @notification_url,
|
55
71
|
:user => @api_key,
|
56
72
|
:password => @api_token,
|
57
73
|
:headers => {
|
58
|
-
platformId: '35'
|
74
|
+
platformId: '35',
|
75
|
+
platformVersion: VERSION
|
59
76
|
}).execute
|
60
77
|
|
61
78
|
rescue => e
|
62
79
|
e.response
|
63
80
|
end
|
64
81
|
|
65
|
-
def
|
82
|
+
def createManagedSubAccount(firstName, lastName, email, password, contentLanguage)
|
83
|
+
return RestClient::Request.new(
|
84
|
+
:method => :post,
|
85
|
+
:url => BASE_URL + 'subaccount/managed' + @notification_url,
|
86
|
+
:user => @api_key,
|
87
|
+
:password => @api_token,
|
88
|
+
:headers => {
|
89
|
+
platformId: '35',
|
90
|
+
platformVersion: VERSION
|
91
|
+
},
|
92
|
+
:payload => {
|
93
|
+
:multipart => true,
|
94
|
+
:firstName => firstName,
|
95
|
+
:lastName => lastName,
|
96
|
+
:email => email,
|
97
|
+
:password => password,
|
98
|
+
:contentLanguage => contentLanguage,
|
99
|
+
}).execute
|
100
|
+
rescue => e
|
101
|
+
if e.class == Errno::ENOENT
|
102
|
+
raise e.message
|
103
|
+
else
|
104
|
+
e.response
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
def switchSubAccountType(subAccountAPIKey)
|
66
109
|
return RestClient::Request.new(
|
67
|
-
:method => :
|
68
|
-
:url =>
|
110
|
+
:method => :post,
|
111
|
+
:url => BASE_URL + 'subaccount/' + subAccountAPIKey + '/switchType' + @notification_url,
|
69
112
|
:user => @api_key,
|
70
113
|
:password => @api_token,
|
71
114
|
:headers => {
|
72
|
-
platformId: '35'
|
115
|
+
platformId: '35',
|
116
|
+
platformVersion: VERSION
|
73
117
|
}).execute
|
118
|
+
rescue => e
|
119
|
+
e.response
|
120
|
+
end
|
74
121
|
|
122
|
+
def createUnmanagedSubAccount(firstName, lastName, email, password, contentLanguage)
|
123
|
+
return RestClient::Request.new(
|
124
|
+
:method => :post,
|
125
|
+
:url => BASE_URL + 'subaccount/unmanaged' + @notification_url,
|
126
|
+
:user => @api_key,
|
127
|
+
:password => @api_token,
|
128
|
+
:headers => {
|
129
|
+
platformId: '35',
|
130
|
+
platformVersion: VERSION
|
131
|
+
},
|
132
|
+
:payload => {
|
133
|
+
:multipart => true,
|
134
|
+
:firstName => firstName,
|
135
|
+
:lastName => lastName,
|
136
|
+
:email => email,
|
137
|
+
:password => password,
|
138
|
+
:contentLanguage => contentLanguage,
|
139
|
+
}).execute
|
75
140
|
rescue => e
|
141
|
+
if e.class == Errno::ENOENT
|
142
|
+
raise e.message
|
143
|
+
else
|
76
144
|
e.response
|
145
|
+
end
|
77
146
|
end
|
78
147
|
|
79
|
-
def
|
148
|
+
def regenerateSubAccountAPIToken(subAccountAPIKey)
|
80
149
|
return RestClient::Request.new(
|
81
|
-
:method => :
|
82
|
-
:url =>
|
150
|
+
:method => :post,
|
151
|
+
:url => BASE_URL + 'subaccount/' + subAccountAPIKey + @notification_url,
|
83
152
|
:user => @api_key,
|
84
153
|
:password => @api_token,
|
85
154
|
:headers => {
|
86
|
-
platformId: '35'
|
155
|
+
platformId: '35',
|
156
|
+
platformVersion: VERSION
|
87
157
|
}).execute
|
88
|
-
|
89
158
|
rescue => e
|
90
159
|
e.response
|
91
160
|
end
|
92
161
|
|
93
|
-
def
|
162
|
+
def deleteSubAccount(subAccountAPIKey)
|
94
163
|
return RestClient::Request.new(
|
95
|
-
:method => :
|
96
|
-
:url =>
|
164
|
+
:method => :delete,
|
165
|
+
:url => BASE_URL + 'subaccount/' + subAccountAPIKey + @notification_url,
|
97
166
|
:user => @api_key,
|
98
167
|
:password => @api_token,
|
99
168
|
:headers => {
|
100
|
-
platformId: '35'
|
169
|
+
platformId: '35',
|
170
|
+
platformVersion: VERSION
|
101
171
|
}).execute
|
102
172
|
|
103
173
|
rescue => e
|
104
174
|
e.response
|
105
175
|
end
|
106
176
|
|
107
|
-
def
|
177
|
+
def getGroupsForUser(userId)
|
108
178
|
return RestClient::Request.new(
|
109
|
-
:method => :
|
110
|
-
:url =>
|
179
|
+
:method => :get,
|
180
|
+
:url => BASE_URL + 'users/' + userId + '/groups' + @notification_url,
|
111
181
|
:user => @api_key,
|
112
182
|
:password => @api_token,
|
113
183
|
:headers => {
|
114
|
-
platformId: '35'
|
184
|
+
platformId: '35',
|
185
|
+
platformVersion: VERSION
|
115
186
|
}).execute
|
116
187
|
|
117
188
|
rescue => e
|
118
189
|
e.response
|
119
190
|
end
|
120
191
|
|
121
|
-
def
|
192
|
+
def getAllVoiceEnrollments(userId)
|
122
193
|
return RestClient::Request.new(
|
123
|
-
:method => :
|
124
|
-
:url =>
|
194
|
+
:method => :get,
|
195
|
+
:url => BASE_URL + 'enrollments/voice/' + userId + @notification_url,
|
125
196
|
:user => @api_key,
|
126
197
|
:password => @api_token,
|
127
198
|
:headers => {
|
128
|
-
platformId: '35'
|
199
|
+
platformId: '35',
|
200
|
+
platformVersion: VERSION
|
129
201
|
}).execute
|
130
202
|
|
131
203
|
rescue => e
|
132
204
|
e.response
|
133
205
|
end
|
134
206
|
|
135
|
-
def
|
207
|
+
def getAllVideoEnrollments(userId)
|
136
208
|
return RestClient::Request.new(
|
137
|
-
:method => :
|
138
|
-
:url =>
|
209
|
+
:method => :get,
|
210
|
+
:url => BASE_URL + 'enrollments/video/' + userId + @notification_url,
|
139
211
|
:user => @api_key,
|
140
212
|
:password => @api_token,
|
141
213
|
:headers => {
|
142
|
-
platformId: '35'
|
214
|
+
platformId: '35',
|
215
|
+
platformVersion: VERSION
|
143
216
|
}).execute
|
144
217
|
|
145
218
|
rescue => e
|
146
219
|
e.response
|
147
220
|
end
|
148
221
|
|
149
|
-
def
|
222
|
+
def deleteAllEnrollments(userId)
|
150
223
|
return RestClient::Request.new(
|
151
224
|
:method => :delete,
|
152
|
-
:url =>
|
225
|
+
:url => BASE_URL + 'enrollments/' + userId + '/all' + @notification_url,
|
153
226
|
:user => @api_key,
|
154
227
|
:password => @api_token,
|
155
228
|
:headers => {
|
156
|
-
platformId: '35'
|
229
|
+
platformId: '35',
|
230
|
+
platformVersion: VERSION
|
157
231
|
}).execute
|
158
232
|
|
159
233
|
rescue => e
|
@@ -163,11 +237,12 @@ class VoiceIt2
|
|
163
237
|
def getAllFaceEnrollments(userId)
|
164
238
|
return RestClient::Request.new(
|
165
239
|
:method => :get,
|
166
|
-
:url =>
|
240
|
+
:url => BASE_URL + 'enrollments/face/' + userId + @notification_url,
|
167
241
|
:user => @api_key,
|
168
242
|
:password => @api_token,
|
169
243
|
:headers => {
|
170
|
-
platformId: '35'
|
244
|
+
platformId: '35',
|
245
|
+
platformVersion: VERSION
|
171
246
|
}).execute
|
172
247
|
|
173
248
|
rescue => e
|
@@ -177,11 +252,12 @@ class VoiceIt2
|
|
177
252
|
def createVoiceEnrollment(userId, contentLanguage, phrase, filePath)
|
178
253
|
return RestClient::Request.new(
|
179
254
|
:method => :post,
|
180
|
-
:url =>
|
255
|
+
:url => BASE_URL + 'enrollments/voice' + @notification_url,
|
181
256
|
:user => @api_key,
|
182
257
|
:password => @api_token,
|
183
258
|
:headers => {
|
184
|
-
platformId: '35'
|
259
|
+
platformId: '35',
|
260
|
+
platformVersion: VERSION
|
185
261
|
},
|
186
262
|
:payload => {
|
187
263
|
:multipart => true,
|
@@ -201,11 +277,12 @@ class VoiceIt2
|
|
201
277
|
def createVoiceEnrollmentByUrl(userId, contentLanguage, phrase, fileUrl)
|
202
278
|
return RestClient::Request.new(
|
203
279
|
:method => :post,
|
204
|
-
:url =>
|
280
|
+
:url => BASE_URL + 'enrollments/voice/byUrl' + @notification_url,
|
205
281
|
:user => @api_key,
|
206
282
|
:password => @api_token,
|
207
283
|
:headers => {
|
208
|
-
platformId: '35'
|
284
|
+
platformId: '35',
|
285
|
+
platformVersion: VERSION
|
209
286
|
},
|
210
287
|
:payload => {
|
211
288
|
:multipart => true,
|
@@ -225,11 +302,12 @@ class VoiceIt2
|
|
225
302
|
def createFaceEnrollment(userId, filePath)
|
226
303
|
return RestClient::Request.new(
|
227
304
|
:method => :post,
|
228
|
-
:url =>
|
305
|
+
:url => BASE_URL + 'enrollments/face' + @notification_url,
|
229
306
|
:user => @api_key,
|
230
307
|
:password => @api_token,
|
231
308
|
:headers => {
|
232
|
-
platformId: '35'
|
309
|
+
platformId: '35',
|
310
|
+
platformVersion: VERSION
|
233
311
|
},
|
234
312
|
:payload => {
|
235
313
|
:multipart => true,
|
@@ -247,11 +325,12 @@ class VoiceIt2
|
|
247
325
|
def createFaceEnrollmentByUrl(userId, fileUrl)
|
248
326
|
return RestClient::Request.new(
|
249
327
|
:method => :post,
|
250
|
-
:url =>
|
328
|
+
:url => BASE_URL + 'enrollments/face/byUrl' + @notification_url,
|
251
329
|
:user => @api_key,
|
252
330
|
:password => @api_token,
|
253
331
|
:headers => {
|
254
|
-
platformId: '35'
|
332
|
+
platformId: '35',
|
333
|
+
platformVersion: VERSION
|
255
334
|
},
|
256
335
|
:payload => {
|
257
336
|
:multipart => true,
|
@@ -265,11 +344,12 @@ class VoiceIt2
|
|
265
344
|
def createVideoEnrollment(userId, contentLanguage, phrase, filePath)
|
266
345
|
return RestClient::Request.new(
|
267
346
|
:method => :post,
|
268
|
-
:url =>
|
347
|
+
:url => BASE_URL + 'enrollments/video' + @notification_url,
|
269
348
|
:user => @api_key,
|
270
349
|
:password => @api_token,
|
271
350
|
:headers => {
|
272
|
-
platformId: '35'
|
351
|
+
platformId: '35',
|
352
|
+
platformVersion: VERSION
|
273
353
|
},
|
274
354
|
:payload => {
|
275
355
|
:multipart => true,
|
@@ -289,11 +369,12 @@ class VoiceIt2
|
|
289
369
|
def createVideoEnrollmentByUrl(userId, contentLanguage, phrase, fileUrl)
|
290
370
|
return RestClient::Request.new(
|
291
371
|
:method => :post,
|
292
|
-
:url =>
|
372
|
+
:url => BASE_URL + 'enrollments/video/byUrl' + @notification_url,
|
293
373
|
:user => @api_key,
|
294
374
|
:password => @api_token,
|
295
375
|
:headers => {
|
296
|
-
platformId: '35'
|
376
|
+
platformId: '35',
|
377
|
+
platformVersion: VERSION
|
297
378
|
},
|
298
379
|
:payload => {
|
299
380
|
:multipart => true,
|
@@ -310,54 +391,15 @@ class VoiceIt2
|
|
310
391
|
end
|
311
392
|
end
|
312
393
|
|
313
|
-
def deleteFaceEnrollment(userId, faceEnrollmentId)
|
314
|
-
return RestClient::Request.new(
|
315
|
-
:method => :delete,
|
316
|
-
:url => @BASE_URL.to_s + 'enrollments/face/' + userId + '/' + faceEnrollmentId.to_s,
|
317
|
-
:user => @api_key,
|
318
|
-
:password => @api_token,
|
319
|
-
:headers => {
|
320
|
-
platformId: '35'
|
321
|
-
}).execute
|
322
|
-
rescue => e
|
323
|
-
e.response
|
324
|
-
end
|
325
|
-
|
326
|
-
def deleteVoiceEnrollment(userId, voiceEnrollmentId)
|
327
|
-
return RestClient::Request.new(
|
328
|
-
:method => :delete,
|
329
|
-
:url => @BASE_URL.to_s + 'enrollments/voice/' + userId + '/' + voiceEnrollmentId.to_s,
|
330
|
-
:user => @api_key,
|
331
|
-
:password => @api_token,
|
332
|
-
:headers => {
|
333
|
-
platformId: '35'
|
334
|
-
}).execute
|
335
|
-
rescue => e
|
336
|
-
e.response
|
337
|
-
end
|
338
|
-
|
339
|
-
def deleteVideoEnrollment(userId, enrollmentId)
|
340
|
-
return RestClient::Request.new(
|
341
|
-
:method => :delete,
|
342
|
-
:url => @BASE_URL.to_s + 'enrollments/video/' + userId + '/' + enrollmentId.to_s,
|
343
|
-
:user => @api_key,
|
344
|
-
:password => @api_token,
|
345
|
-
:headers => {
|
346
|
-
platformId: '35'
|
347
|
-
}).execute
|
348
|
-
|
349
|
-
rescue => e
|
350
|
-
e.response
|
351
|
-
end
|
352
|
-
|
353
394
|
def getAllGroups()
|
354
395
|
return RestClient::Request.new(
|
355
396
|
:method => :get,
|
356
|
-
:url =>
|
397
|
+
:url => BASE_URL + 'groups' + @notification_url,
|
357
398
|
:user => @api_key,
|
358
399
|
:password => @api_token,
|
359
400
|
:headers => {
|
360
|
-
platformId: '35'
|
401
|
+
platformId: '35',
|
402
|
+
platformVersion: VERSION
|
361
403
|
}).execute
|
362
404
|
rescue => e
|
363
405
|
e.response
|
@@ -366,11 +408,12 @@ class VoiceIt2
|
|
366
408
|
def getPhrases(contentLanguage)
|
367
409
|
return RestClient::Request.new(
|
368
410
|
:method => :get,
|
369
|
-
:url =>
|
411
|
+
:url => BASE_URL + 'phrases/' + contentLanguage + @notification_url,
|
370
412
|
:user => @api_key,
|
371
413
|
:password => @api_token,
|
372
414
|
:headers => {
|
373
|
-
platformId: '35'
|
415
|
+
platformId: '35',
|
416
|
+
platformVersion: VERSION
|
374
417
|
}).execute
|
375
418
|
rescue => e
|
376
419
|
e.response
|
@@ -379,11 +422,12 @@ class VoiceIt2
|
|
379
422
|
def getGroup(groupId)
|
380
423
|
return RestClient::Request.new(
|
381
424
|
:method => :get,
|
382
|
-
:url =>
|
425
|
+
:url => BASE_URL + 'groups/' + groupId + @notification_url,
|
383
426
|
:user => @api_key,
|
384
427
|
:password => @api_token,
|
385
428
|
:headers => {
|
386
|
-
platformId: '35'
|
429
|
+
platformId: '35',
|
430
|
+
platformVersion: VERSION
|
387
431
|
}).execute
|
388
432
|
rescue => e
|
389
433
|
e.response
|
@@ -392,11 +436,12 @@ class VoiceIt2
|
|
392
436
|
def groupExists(groupId)
|
393
437
|
return RestClient::Request.new(
|
394
438
|
:method => :get,
|
395
|
-
:url =>
|
439
|
+
:url => BASE_URL + 'groups/' + groupId + '/exists' + @notification_url,
|
396
440
|
:user => @api_key,
|
397
441
|
:password => @api_token,
|
398
442
|
:headers => {
|
399
|
-
platformId: '35'
|
443
|
+
platformId: '35',
|
444
|
+
platformVersion: VERSION
|
400
445
|
}).execute
|
401
446
|
rescue => e
|
402
447
|
e.response
|
@@ -405,11 +450,12 @@ class VoiceIt2
|
|
405
450
|
def createGroup(description)
|
406
451
|
return RestClient::Request.new(
|
407
452
|
:method => :post,
|
408
|
-
:url =>
|
453
|
+
:url => BASE_URL + 'groups' + @notification_url,
|
409
454
|
:user => @api_key,
|
410
455
|
:password => @api_token,
|
411
456
|
:headers => {
|
412
|
-
platformId: '35'
|
457
|
+
platformId: '35',
|
458
|
+
platformVersion: VERSION
|
413
459
|
},
|
414
460
|
:payload => {
|
415
461
|
:multipart => true,
|
@@ -422,11 +468,12 @@ class VoiceIt2
|
|
422
468
|
def addUserToGroup(groupId, userId)
|
423
469
|
return RestClient::Request.new(
|
424
470
|
:method => :put,
|
425
|
-
:url =>
|
471
|
+
:url => BASE_URL + 'groups/addUser' + @notification_url,
|
426
472
|
:user => @api_key,
|
427
473
|
:password => @api_token,
|
428
474
|
:headers => {
|
429
|
-
platformId: '35'
|
475
|
+
platformId: '35',
|
476
|
+
platformVersion: VERSION
|
430
477
|
},
|
431
478
|
:payload => {
|
432
479
|
:multipart => true,
|
@@ -440,11 +487,12 @@ class VoiceIt2
|
|
440
487
|
def removeUserFromGroup(groupId, userId)
|
441
488
|
return RestClient::Request.new(
|
442
489
|
:method => :put,
|
443
|
-
:url =>
|
490
|
+
:url => BASE_URL + 'groups/removeUser' + @notification_url,
|
444
491
|
:user => @api_key,
|
445
492
|
:password => @api_token,
|
446
493
|
:headers => {
|
447
|
-
platformId: '35'
|
494
|
+
platformId: '35',
|
495
|
+
platformVersion: VERSION
|
448
496
|
},
|
449
497
|
:payload => {
|
450
498
|
:multipart => true,
|
@@ -458,11 +506,12 @@ class VoiceIt2
|
|
458
506
|
def deleteGroup(groupId)
|
459
507
|
return RestClient::Request.new(
|
460
508
|
:method => :delete,
|
461
|
-
:url =>
|
509
|
+
:url => BASE_URL + 'groups/' + groupId + @notification_url,
|
462
510
|
:user => @api_key,
|
463
511
|
:password => @api_token,
|
464
512
|
:headers => {
|
465
|
-
platformId: '35'
|
513
|
+
platformId: '35',
|
514
|
+
platformVersion: VERSION
|
466
515
|
}).execute
|
467
516
|
rescue => e
|
468
517
|
e.response
|
@@ -471,11 +520,12 @@ class VoiceIt2
|
|
471
520
|
def voiceVerification(userId, contentLanguage, phrase, filePath)
|
472
521
|
return RestClient::Request.new(
|
473
522
|
:method => :post,
|
474
|
-
:url =>
|
523
|
+
:url => BASE_URL + 'verification/voice' + @notification_url,
|
475
524
|
:user => @api_key,
|
476
525
|
:password => @api_token,
|
477
526
|
:headers => {
|
478
|
-
platformId: '35'
|
527
|
+
platformId: '35',
|
528
|
+
platformVersion: VERSION
|
479
529
|
},
|
480
530
|
:payload => {
|
481
531
|
:multipart => true,
|
@@ -495,11 +545,12 @@ class VoiceIt2
|
|
495
545
|
def voiceVerificationByUrl(userId, contentLanguage, phrase, fileUrl)
|
496
546
|
return RestClient::Request.new(
|
497
547
|
:method => :post,
|
498
|
-
:url =>
|
548
|
+
:url => BASE_URL + 'verification/voice/byUrl' + @notification_url,
|
499
549
|
:user => @api_key,
|
500
550
|
:password => @api_token,
|
501
551
|
:headers => {
|
502
|
-
platformId: '35'
|
552
|
+
platformId: '35',
|
553
|
+
platformVersion: VERSION
|
503
554
|
},
|
504
555
|
:payload => {
|
505
556
|
:multipart => true,
|
@@ -519,11 +570,12 @@ class VoiceIt2
|
|
519
570
|
def faceVerification(userId, filePath)
|
520
571
|
return RestClient::Request.new(
|
521
572
|
:method => :post,
|
522
|
-
:url =>
|
573
|
+
:url => BASE_URL + 'verification/face' + @notification_url,
|
523
574
|
:user => @api_key,
|
524
575
|
:password => @api_token,
|
525
576
|
:headers => {
|
526
|
-
platformId: '35'
|
577
|
+
platformId: '35',
|
578
|
+
platformVersion: VERSION
|
527
579
|
},
|
528
580
|
:payload => {
|
529
581
|
:multipart => true,
|
@@ -541,11 +593,12 @@ class VoiceIt2
|
|
541
593
|
def faceVerificationByUrl(userId, fileUrl)
|
542
594
|
return RestClient::Request.new(
|
543
595
|
:method => :post,
|
544
|
-
:url =>
|
596
|
+
:url => BASE_URL + 'verification/face/byUrl' + @notification_url,
|
545
597
|
:user => @api_key,
|
546
598
|
:password => @api_token,
|
547
599
|
:headers => {
|
548
|
-
platformId: '35'
|
600
|
+
platformId: '35',
|
601
|
+
platformVersion: VERSION
|
549
602
|
},
|
550
603
|
:payload => {
|
551
604
|
:multipart => true,
|
@@ -559,11 +612,12 @@ class VoiceIt2
|
|
559
612
|
def videoVerification(userId, contentLanguage, phrase, filePath)
|
560
613
|
return RestClient::Request.new(
|
561
614
|
:method => :post,
|
562
|
-
:url =>
|
615
|
+
:url => BASE_URL + 'verification/video' + @notification_url,
|
563
616
|
:user => @api_key,
|
564
617
|
:password => @api_token,
|
565
618
|
:headers => {
|
566
|
-
platformId: '35'
|
619
|
+
platformId: '35',
|
620
|
+
platformVersion: VERSION
|
567
621
|
},
|
568
622
|
:payload => {
|
569
623
|
:multipart => true,
|
@@ -583,11 +637,12 @@ class VoiceIt2
|
|
583
637
|
def videoVerificationByUrl(userId, contentLanguage, phrase, fileUrl)
|
584
638
|
return RestClient::Request.new(
|
585
639
|
:method => :post,
|
586
|
-
:url =>
|
640
|
+
:url => BASE_URL + 'verification/video/byUrl' + @notification_url,
|
587
641
|
:user => @api_key,
|
588
642
|
:password => @api_token,
|
589
643
|
:headers => {
|
590
|
-
platformId: '35'
|
644
|
+
platformId: '35',
|
645
|
+
platformVersion: VERSION
|
591
646
|
},
|
592
647
|
:payload => {
|
593
648
|
:multipart => true,
|
@@ -607,11 +662,12 @@ class VoiceIt2
|
|
607
662
|
def voiceIdentification(groupId, contentLanguage, phrase, filePath)
|
608
663
|
return RestClient::Request.new(
|
609
664
|
:method => :post,
|
610
|
-
:url =>
|
665
|
+
:url => BASE_URL + 'identification/voice' + @notification_url,
|
611
666
|
:user => @api_key,
|
612
667
|
:password => @api_token,
|
613
668
|
:headers => {
|
614
|
-
platformId: '35'
|
669
|
+
platformId: '35',
|
670
|
+
platformVersion: VERSION
|
615
671
|
},
|
616
672
|
:payload => {
|
617
673
|
:multipart => true,
|
@@ -631,11 +687,12 @@ class VoiceIt2
|
|
631
687
|
def voiceIdentificationByUrl(groupId, contentLanguage, phrase, fileUrl)
|
632
688
|
return RestClient::Request.new(
|
633
689
|
:method => :post,
|
634
|
-
:url =>
|
690
|
+
:url => BASE_URL + 'identification/voice/byUrl' + @notification_url,
|
635
691
|
:user => @api_key,
|
636
692
|
:password => @api_token,
|
637
693
|
:headers => {
|
638
|
-
platformId: '35'
|
694
|
+
platformId: '35',
|
695
|
+
platformVersion: VERSION
|
639
696
|
},
|
640
697
|
:payload => {
|
641
698
|
:multipart => true,
|
@@ -655,11 +712,12 @@ class VoiceIt2
|
|
655
712
|
def faceIdentification(groupId, filePath)
|
656
713
|
return RestClient::Request.new(
|
657
714
|
:method => :post,
|
658
|
-
:url =>
|
715
|
+
:url => BASE_URL + 'identification/face' + @notification_url,
|
659
716
|
:user => @api_key,
|
660
717
|
:password => @api_token,
|
661
718
|
:headers => {
|
662
|
-
platformId: '35'
|
719
|
+
platformId: '35',
|
720
|
+
platformVersion: VERSION
|
663
721
|
},
|
664
722
|
:payload => {
|
665
723
|
:multipart => true,
|
@@ -677,11 +735,12 @@ class VoiceIt2
|
|
677
735
|
def faceIdentificationByUrl(groupId,fileUrl)
|
678
736
|
return RestClient::Request.new(
|
679
737
|
:method => :post,
|
680
|
-
:url =>
|
738
|
+
:url => BASE_URL + 'identification/face/byUrl' + @notification_url,
|
681
739
|
:user => @api_key,
|
682
740
|
:password => @api_token,
|
683
741
|
:headers => {
|
684
|
-
platformId: '35'
|
742
|
+
platformId: '35',
|
743
|
+
platformVersion: VERSION
|
685
744
|
},
|
686
745
|
:payload => {
|
687
746
|
:multipart => true,
|
@@ -695,11 +754,12 @@ class VoiceIt2
|
|
695
754
|
def videoIdentification(groupId, contentLanguage, phrase, filePath)
|
696
755
|
return RestClient::Request.new(
|
697
756
|
:method => :post,
|
698
|
-
:url =>
|
757
|
+
:url => BASE_URL + 'identification/video' + @notification_url,
|
699
758
|
:user => @api_key,
|
700
759
|
:password => @api_token,
|
701
760
|
:headers => {
|
702
|
-
platformId: '35'
|
761
|
+
platformId: '35',
|
762
|
+
platformVersion: VERSION
|
703
763
|
},
|
704
764
|
:payload => {
|
705
765
|
:multipart => true,
|
@@ -719,11 +779,12 @@ class VoiceIt2
|
|
719
779
|
def videoIdentificationByUrl(groupId, contentLanguage, phrase, fileUrl)
|
720
780
|
return RestClient::Request.new(
|
721
781
|
:method => :post,
|
722
|
-
:url =>
|
782
|
+
:url => BASE_URL + 'identification/video/byUrl' + @notification_url,
|
723
783
|
:user => @api_key,
|
724
784
|
:password => @api_token,
|
725
785
|
:headers => {
|
726
|
-
platformId: '35'
|
786
|
+
platformId: '35',
|
787
|
+
platformVersion: VERSION
|
727
788
|
},
|
728
789
|
:payload => {
|
729
790
|
:multipart => true,
|
@@ -740,17 +801,37 @@ class VoiceIt2
|
|
740
801
|
end
|
741
802
|
end
|
742
803
|
|
743
|
-
def createUserToken(userId)
|
804
|
+
def createUserToken(userId, secondsToTimeout)
|
744
805
|
return RestClient::Request.new(
|
745
806
|
:method => :post,
|
746
|
-
:url =>
|
807
|
+
:url => BASE_URL + 'users/' + userId + '/token?timeOut=' + secondsToTimeout.to_s,
|
747
808
|
:user => @api_key,
|
748
809
|
:password => @api_token,
|
749
810
|
:headers => {
|
750
|
-
platformId: '35'
|
811
|
+
platformId: '35',
|
812
|
+
platformVersion: VERSION
|
751
813
|
}).execute
|
752
814
|
rescue => e
|
753
815
|
e.response
|
754
816
|
end
|
755
817
|
|
818
|
+
def expireUserTokens(userId)
|
819
|
+
return RestClient::Request.new(
|
820
|
+
:method => :post,
|
821
|
+
:url => BASE_URL + 'users/' + userId + '/expireTokens',
|
822
|
+
:user => @api_key,
|
823
|
+
:password => @api_token,
|
824
|
+
:headers => {
|
825
|
+
platformId: '35',
|
826
|
+
platformVersion: VERSION
|
827
|
+
}).execute
|
828
|
+
rescue => e
|
829
|
+
e.response
|
830
|
+
end
|
831
|
+
|
832
|
+
attr_reader :BASE_URL
|
833
|
+
attr_reader :notification_url
|
834
|
+
attr_reader :api_key
|
835
|
+
attr_reader :api_token
|
836
|
+
|
756
837
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: VoiceIt2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- StephenAkers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A wrapper for VoiceIt API 2
|
14
14
|
email: stephen@voiceit.io
|
@@ -17,10 +17,11 @@ extensions: []
|
|
17
17
|
extra_rdoc_files: []
|
18
18
|
files:
|
19
19
|
- "./VoiceIt2.rb"
|
20
|
-
homepage:
|
20
|
+
homepage: https://voiceit.io
|
21
21
|
licenses:
|
22
22
|
- MIT
|
23
|
-
metadata:
|
23
|
+
metadata:
|
24
|
+
documentation_uri: https://api.voiceit.io?ruby
|
24
25
|
post_install_message:
|
25
26
|
rdoc_options: []
|
26
27
|
require_paths:
|
@@ -37,7 +38,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
37
38
|
version: '0'
|
38
39
|
requirements: []
|
39
40
|
rubyforge_project:
|
40
|
-
rubygems_version: 2.7.
|
41
|
+
rubygems_version: 2.7.6
|
41
42
|
signing_key:
|
42
43
|
specification_version: 4
|
43
44
|
summary: VoiceIt Api 2
|