forked from NdoleStudio/httpsms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.ts
More file actions
638 lines (590 loc) · 17.7 KB
/
api.ts
File metadata and controls
638 lines (590 loc) · 17.7 KB
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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
/* eslint-disable */
/* tslint:disable */
// @ts-nocheck
/*
* ---------------------------------------------------------------
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
* ## ##
* ## AUTHOR: acacode ##
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
* ---------------------------------------------------------------
*/
export interface EntitiesBillingUsage {
/** @example "2022-06-05T14:26:02.302718+03:00" */
created_at: string
/** @example "2022-01-31T23:59:59+00:00" */
end_timestamp: string
/** @example "32343a19-da5e-4b1b-a767-3298a73703cb" */
id: string
/** @example 465 */
received_messages: number
/** @example 321 */
sent_messages: number
/** @example "2022-01-01T00:00:00+00:00" */
start_timestamp: string
/** @example 0 */
total_cost: number
/** @example "2022-06-05T14:26:10.303278+03:00" */
updated_at: string
/** @example "WB7DRDWrJZRGbYrv2CKGkqbzvqdC" */
user_id: string
}
export interface EntitiesDiscord {
/** @example "2022-06-05T14:26:02.302718+03:00" */
created_at: string
/** @example "32343a19-da5e-4b1b-a767-3298a73703cb" */
id: string
/** @example "1095780203256627291" */
incoming_channel_id: string
/** @example "Game Server" */
name: string
/** @example "1095778291488653372" */
server_id: string
/** @example "2022-06-05T14:26:10.303278+03:00" */
updated_at: string
/** @example "WB7DRDWrJZRGbYrv2CKGkqbzvqdC" */
user_id: string
}
export interface EntitiesHeartbeat {
/** @example true */
charging: boolean
/** @example "32343a19-da5e-4b1b-a767-3298a73703cb" */
id: string
/** @example "+18005550199" */
owner: string
/** @example "2022-06-05T14:26:01.520828+03:00" */
timestamp: string
/** @example "WB7DRDWrJZRGbYrv2CKGkqbzvqdC" */
user_id: string
/** @example "344c10f" */
version: string
}
export interface EntitiesMessage {
/** @example false */
can_be_polled: boolean
/** @example "+18005550100" */
contact: string
/** @example "This is a sample text message" */
content: string
/** @example "2022-06-05T14:26:02.302718+03:00" */
created_at: string
/** @example "2022-06-05T14:26:09.527976+03:00" */
delivered_at: string
/** @example false */
encrypted: boolean
/** @example "2022-06-05T14:26:09.527976+03:00" */
expired_at: string
/** @example "2022-06-05T14:26:09.527976+03:00" */
failed_at: string
/** @example "UNKNOWN" */
failure_reason: string
/** @example "32343a19-da5e-4b1b-a767-3298a73703cb" */
id: string
/** @example "2022-06-05T14:26:09.527976+03:00" */
last_attempted_at: string
/** @example 1 */
max_send_attempts: number
/** @example "2022-06-05T14:26:09.527976+03:00" */
order_timestamp: string
/** @example "+18005550199" */
owner: string
/** @example "2022-06-05T14:26:09.527976+03:00" */
received_at: string
/** @example "153554b5-ae44-44a0-8f4f-7bbac5657ad4" */
request_id: string
/** @example "2022-06-05T14:26:01.520828+03:00" */
request_received_at: string
/** @example "2022-06-05T14:26:09.527976+03:00" */
scheduled_at: string
/** @example "2022-06-05T14:26:09.527976+03:00" */
scheduled_send_time: string
/** @example 0 */
send_attempt_count: number
/**
* SendDuration is the number of nanoseconds from when the request was received until when the mobile phone send the message
* @example 133414
*/
send_time: number
/** @example "2022-06-05T14:26:09.527976+03:00" */
sent_at: string
/**
* SIM is the SIM card to use to send the message
* * SMS1: use the SIM card in slot 1
* * SMS2: use the SIM card in slot 2
* * DEFAULT: used the default communication SIM card
* @example "DEFAULT"
*/
sim: string
/** @example "pending" */
status: string
/** @example "mobile-terminated" */
type: string
/** @example "2022-06-05T14:26:10.303278+03:00" */
updated_at: string
/** @example "WB7DRDWrJZRGbYrv2CKGkqbzvqdC" */
user_id: string
}
export interface EntitiesMessageThread {
/** @example "indigo" */
color: string
/** @example "+18005550100" */
contact: string
/** @example "2022-06-05T14:26:09.527976+03:00" */
created_at: string
/** @example "32343a19-da5e-4b1b-a767-3298a73703ca" */
id: string
/** @example false */
is_archived: boolean
/** @example "This is a sample message content" */
last_message_content: string
/** @example "32343a19-da5e-4b1b-a767-3298a73703ca" */
last_message_id: string
/** @example "2022-06-05T14:26:09.527976+03:00" */
order_timestamp: string
/** @example "+18005550199" */
owner: string
/** @example "PENDING" */
status: string
/** @example "2022-06-05T14:26:09.527976+03:00" */
updated_at: string
/** @example "WB7DRDWrJZRGbYrv2CKGkqbzvqdC" */
user_id: string
}
export interface EntitiesPhone {
/** @example "2022-06-05T14:26:02.302718+03:00" */
created_at: string
/** @example "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzd....." */
fcm_token: string
/** @example "32343a19-da5e-4b1b-a767-3298a73703cb" */
id: string
/**
* MaxSendAttempts determines how many times to retry sending an SMS message
* @example 2
*/
max_send_attempts: number
/** MessageExpirationSeconds is the duration in seconds after sending a message when it is considered to be expired. */
message_expiration_seconds: number
/** @example 1 */
messages_per_minute: number
/** @example "This phone cannot receive calls. Please send an SMS instead." */
missed_call_auto_reply: string
/** @example "+18005550199" */
phone_number: string
/** SIM card that received the message */
sim: string
/** @example "2022-06-05T14:26:10.303278+03:00" */
updated_at: string
/** @example "WB7DRDWrJZRGbYrv2CKGkqbzvqdC" */
user_id: string
}
export interface EntitiesPhoneAPIKey {
/** @example "pk_DGW8NwQp7mxKaSZ72Xq9v67SLqSbWQvckzzmK8D6rvd7NywSEkdMJtuxKyEkYnCY" */
api_key: string
/** @example "2022-06-05T14:26:02.302718+03:00" */
created_at: string
/** @example "32343a19-da5e-4b1b-a767-3298a73703cb" */
id: string
/** @example "Business Phone Key" */
name: string
/** @example ["[32343a19-da5e-4b1b-a767-3298a73703cb","32343a19-da5e-4b1b-a767-3298a73703cc]"] */
phone_ids: string[]
/** @example ["[+18005550199","+18005550100]"] */
phone_numbers: string[]
/** @example "2022-06-05T14:26:02.302718+03:00" */
updated_at: string
/** @example "user@gmail.com" */
user_email: string
/** @example "WB7DRDWrJZRGbYrv2CKGkqbzvqdC" */
user_id: string
}
export interface EntitiesUser {
/** @example "32343a19-da5e-4b1b-a767-3298a73703cb" */
active_phone_id: string
/** @example "x-api-key" */
api_key: string
/** @example "2022-06-05T14:26:02.302718+03:00" */
created_at: string
/** @example "name@email.com" */
email: string
/** @example "WB7DRDWrJZRGbYrv2CKGkqbzvqdC" */
id: string
/** @example true */
notification_heartbeat_enabled: boolean
/** @example true */
notification_message_status_enabled: boolean
/** @example true */
notification_newsletter_enabled: boolean
/** @example true */
notification_webhook_enabled: boolean
/** @example "2022-06-05T14:26:02.302718+03:00" */
subscription_ends_at: string
/** @example "8f9c71b8-b84e-4417-8408-a62274f65a08" */
subscription_id: string
/** @example "free" */
subscription_name: string
/** @example "2022-06-05T14:26:02.302718+03:00" */
subscription_renews_at: string
/** @example "on_trial" */
subscription_status: string
/** @example "Europe/Helsinki" */
timezone: string
/** @example "2022-06-05T14:26:10.303278+03:00" */
updated_at: string
}
export interface EntitiesWebhook {
/** @example "2022-06-05T14:26:02.302718+03:00" */
created_at: string
/** @example ["[message.phone.received]"] */
events: string[]
/** @example "32343a19-da5e-4b1b-a767-3298a73703cb" */
id: string
/** @example ["[+18005550199","+18005550100]"] */
phone_numbers: string[]
/** @example "DGW8NwQp7mxKaSZ72Xq9v67SLqSbWQvckzzmK8D6rvd7NywSEkdMJtuxKyEkYnCY" */
signing_key: string
/** @example "2022-06-05T14:26:10.303278+03:00" */
updated_at: string
/** @example "https://example.com" */
url: string
/** @example "WB7DRDWrJZRGbYrv2CKGkqbzvqdC" */
user_id: string
}
export interface RequestsDiscordStore {
incoming_channel_id: string
name: string
server_id: string
}
export interface RequestsDiscordUpdate {
incoming_channel_id: string
name: string
server_id: string
}
export interface RequestsHeartbeatStore {
charging: boolean
phone_numbers: string[]
}
export interface RequestsMessageBulkSend {
/** @example "This is a sample text message" */
content: string
/**
* Encrypted is used to determine if the content is end-to-end encrypted. Make sure to set the encryption key on the httpSMS mobile app
* @example false
*/
encrypted: boolean
/** @example "+18005550199" */
from: string
/**
* RequestID is an optional parameter used to track a request from the client's perspective
* @example "153554b5-ae44-44a0-8f4f-7bbac5657ad4"
*/
request_id?: string
/** @example ["+18005550100","+18005550100"] */
to: string[]
}
export interface RequestsMessageCallMissed {
/** @example "+18005550199" */
from: string
/** @example "SIM1" */
sim: string
/** @example "2022-06-05T14:26:09.527976+03:00" */
timestamp: string
/** @example "+18005550100" */
to: string
}
export interface RequestsMessageEvent {
/**
* EventName is the type of event
* * SENT: is emitted when a message is sent by the mobile phone
* * FAILED: is event is emitted when the message could not be sent by the mobile phone
* * DELIVERED: is event is emitted when a delivery report has been received by the mobile phone
* @example "SENT"
*/
event_name: string
/** Reason is the exact error message in case the event is an error */
reason: string
/**
* Timestamp is the time when the event was emitted, Please send the timestamp in UTC with as much precision as possible
* @example "2022-06-05T14:26:09.527976+03:00"
*/
timestamp: string
}
export interface RequestsMessageReceive {
/** @example "This is a sample text message received on a phone" */
content: string
/**
* Encrypted is used to determine if the content is end-to-end encrypted. Make sure to set the encryption key on the httpSMS mobile app
* @example false
*/
encrypted: boolean
/** @example "+18005550199" */
from: string
/**
* SIM card that received the message
* @example "SIM1"
*/
sim: string
/**
* Timestamp is the time when the event was emitted, Please send the timestamp in UTC with as much precision as possible
* @example "2022-06-05T14:26:09.527976+03:00"
*/
timestamp: string
/** @example "+18005550100" */
to: string
}
export interface RequestsMessageSend {
/** @example "This is a sample text message" */
content: string
/**
* Encrypted is used to determine if the content is end-to-end encrypted. Make sure to set the encryption key on the httpSMS mobile app
* @example false
*/
encrypted: boolean
/** @example "+18005550199" */
from: string
/**
* RequestID is an optional parameter used to track a request from the client's perspective
* @example "153554b5-ae44-44a0-8f4f-7bbac5657ad4"
*/
request_id?: string
/**
* SendAt is an optional parameter used to schedule a message to be sent at a later time
* @example "2022-06-05T14:26:09.527976+03:00"
*/
send_at?: string
/** @example "+18005550100" */
to: string
}
export interface RequestsMessageThreadUpdate {
/** @example true */
is_archived: boolean
}
export interface RequestsPhoneAPIKeyStoreRequest {
/** @example "My Phone API Key" */
name: string
}
export interface RequestsPhoneFCMToken {
/** @example "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzd....." */
fcm_token: string
/** @example "[+18005550199]" */
phone_number: string
/**
* SIM is the SIM slot of the phone in case the phone has more than 1 SIM slot
* @example "SIM1"
*/
sim: string
}
export interface RequestsPhoneUpsert {
/** @example "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzd....." */
fcm_token: string
/**
* MaxSendAttempts is the number of attempts when sending an SMS message to handle the case where the phone is offline.
* @example 2
*/
max_send_attempts: number
/**
* MessageExpirationSeconds is the duration in seconds after sending a message when it is considered to be expired.
* @example 12345
*/
message_expiration_seconds: number
/** @example 1 */
messages_per_minute: number
/** @example "e.g. This phone cannot receive calls. Please send an SMS instead." */
missed_call_auto_reply: string
/** @example "+18005550199" */
phone_number: string
/**
* SIM is the SIM slot of the phone in case the phone has more than 1 SIM slot
* @example "SIM1"
*/
sim: string
}
export interface RequestsUserNotificationUpdate {
/** @example true */
heartbeat_enabled: boolean
/** @example true */
message_status_enabled: boolean
/** @example true */
newsletter_enabled: boolean
/** @example true */
webhook_enabled: boolean
}
export interface RequestsUserUpdate {
/** @example "32343a19-da5e-4b1b-a767-3298a73703cb" */
active_phone_id: string
/** @example "Europe/Helsinki" */
timezone: string
}
export interface RequestsWebhookStore {
events: string[]
/** @example ["+18005550100","+18005550100"] */
phone_numbers: string[]
signing_key: string
url: string
}
export interface RequestsWebhookUpdate {
events: string[]
/** @example ["+18005550100","+18005550100"] */
phone_numbers: string[]
signing_key: string
url: string
}
export interface ResponsesBadRequest {
/** @example "The request body is not a valid JSON string" */
data: string
/** @example "The request isn't properly formed" */
message: string
/** @example "error" */
status: string
}
export interface ResponsesBillingUsageResponse {
data: EntitiesBillingUsage
/** @example "item created successfully" */
message: string
/** @example "success" */
status: string
}
export interface ResponsesBillingUsagesResponse {
data: EntitiesBillingUsage[]
/** @example "item created successfully" */
message: string
/** @example "success" */
status: string
}
export interface ResponsesDiscordResponse {
data: EntitiesDiscord
/** @example "item created successfully" */
message: string
/** @example "success" */
status: string
}
export interface ResponsesDiscordsResponse {
data: EntitiesDiscord[]
/** @example "item created successfully" */
message: string
/** @example "success" */
status: string
}
export interface ResponsesHeartbeatResponse {
data: EntitiesHeartbeat
/** @example "item created successfully" */
message: string
/** @example "success" */
status: string
}
export interface ResponsesHeartbeatsResponse {
data: EntitiesHeartbeat[]
/** @example "item created successfully" */
message: string
/** @example "success" */
status: string
}
export interface ResponsesInternalServerError {
/** @example "We ran into an internal error while handling the request." */
message: string
/** @example "error" */
status: string
}
export interface ResponsesMessageResponse {
data: EntitiesMessage
/** @example "item created successfully" */
message: string
/** @example "success" */
status: string
}
export interface ResponsesMessageThreadsResponse {
data: EntitiesMessageThread[]
/** @example "item created successfully" */
message: string
/** @example "success" */
status: string
}
export interface ResponsesMessagesResponse {
data: EntitiesMessage[]
/** @example "item created successfully" */
message: string
/** @example "success" */
status: string
}
export interface ResponsesNoContent {
/** @example "action performed successfully" */
message: string
/** @example "success" */
status: string
}
export interface ResponsesNotFound {
/** @example "cannot find message with ID [32343a19-da5e-4b1b-a767-3298a73703ca]" */
message: string
/** @example "error" */
status: string
}
export interface ResponsesOkString {
data: string
/** @example "Request handled successfully" */
message: string
/** @example "success" */
status: string
}
export interface ResponsesPhoneAPIKeyResponse {
data: EntitiesPhoneAPIKey
/** @example "item created successfully" */
message: string
/** @example "success" */
status: string
}
export interface ResponsesPhoneAPIKeysResponse {
data: EntitiesPhoneAPIKey[]
/** @example "item created successfully" */
message: string
/** @example "success" */
status: string
}
export interface ResponsesPhoneResponse {
data: EntitiesPhone
/** @example "item created successfully" */
message: string
/** @example "success" */
status: string
}
export interface ResponsesPhonesResponse {
data: EntitiesPhone[]
/** @example "item created successfully" */
message: string
/** @example "success" */
status: string
}
export interface ResponsesUnauthorized {
/** @example "Make sure your API key is set in the [X-API-Key] header in the request" */
data: string
/** @example "You are not authorized to carry out this request." */
message: string
/** @example "error" */
status: string
}
export interface ResponsesUnprocessableEntity {
data: Record<string, string[]>
/** @example "validation errors while sending message" */
message: string
/** @example "error" */
status: string
}
export interface ResponsesUserResponse {
data: EntitiesUser
/** @example "item created successfully" */
message: string
/** @example "success" */
status: string
}
export interface ResponsesWebhookResponse {
data: EntitiesWebhook
/** @example "item created successfully" */
message: string
/** @example "success" */
status: string
}
export interface ResponsesWebhooksResponse {
data: EntitiesWebhook[]
/** @example "item created successfully" */
message: string
/** @example "success" */
status: string
}