-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcwsmileback.json
More file actions
758 lines (758 loc) · 23.2 KB
/
Copy pathcwsmileback.json
File metadata and controls
758 lines (758 loc) · 23.2 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
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
{
"openapi" : "3.0.1",
"info" : {
"title" : "SmileBack API",
"description" : "\n## Introduction\n#### Who is this API for?\nThis API is specifically designed for customers, their business intelligence and reporting solutions that want to replicate a customer's SmileBack dataset into their internal storage systems for further analysis and then keep those two datasets in sync.\n#### What does this API offer?\nThe SmileBack Data Replication API offers **purely read-only** access to a customer's own dataset. Special focus is given to making incremental synchronization as fast and efficient as possible on both ends. The customer has full control over granting and revoking their BI/reporting solution, or any other API consuming system, right to access their dataset.\n#### Incremental Updates (IMPORTANT)\nThe integration should regularly enough, but not too frequently, call the SmileBack API to bring its own data storage in sync with the latest dataset in SmileBack. \nSo, when designing solution that will consume SmileBack data, Integrator should think of a balance between Customer's needs on rational frequency of data synchronizations, to provide value to Customer and at the same time optimize API usage. \nHence, please take the following aspects into account:\n- optimize the number of API calls (necessary syncs)\n- minimize the amount of bandwidth used\n- minimize the processing power required - both for the API provider as well as for the API consumer\n#### Authorization flow\nSpecifically for Customers, SmileBack Data Replication API offers simplified authorization flow - **resource owner password-based**.\nFirst, navigate to \"API Credentials\" page under Account menu.\nCopy Client ID & Secret pair, unique and specific for each Customer.\nEncode this pair of keys with Base64 and include into Authorization header: \"Authorization Basic <ClientID:ClientSecret_encoded_keys>\".\nThen include the following in body of request as form_data:\n- grant_type: password\n- scope: read read_recent\n- username: \"email\"\n- password: \"password\"\n\nPrepared authorization request has to call this endpoint:\n```\n POST https://<app_url>/api/token/\n```\nFor better understanding of how **resource owner password-based authorization flow** works, click the \"Authorize\" button below here in Swagger to call for \"Available authorizations\" modal. There in the form you will see what data should be provided within the authorization request header in order to authorize and get access/refresh tokens pair. You will also see, as stated above, that **only read scopes** are declared in SmileBack Data Replication API, as by design it offers **purely read-only access** to a customer's own dataset.\n\nPlease also note, in the full API documentation (PDF is dowloadable here: \"https://docs.connectwise.com/SmileBack/040/010/010\") you'll encounter yet another authorization endpoint - https://<app_url>/account/api/authorize/ - which is implemented to support full OAuth flow, and designed for 3d party systems Integrators, who operate in multi-tenant environment, therefore should not be used for simplified password-based authorization.\n\nFor more information and assistance, please contact us at help@smileback.com\n",
"termsOfService" : "https://www.smileback.com/terms/",
"version" : "v3"
},
"servers" : [ {
"url" : "https://app.smileback.io/api/v3"
} ],
"security" : [ {
"SmileBack" : [ ]
} ],
"paths" : {
"/csat-agents/" : {
"get" : {
"tags" : [ "csat-agents" ],
"description" : "API endpoint for listing active csat agents.",
"operationId" : "csat-agents_list",
"responses" : {
"200" : {
"description" : "",
"content" : { }
}
}
}
},
"/csat-boards/" : {
"get" : {
"tags" : [ "csat-boards" ],
"description" : "API endpoint for listing active csat agents.",
"operationId" : "csat-boards_list",
"responses" : {
"200" : {
"description" : "",
"content" : { }
}
}
}
},
"/csat-companies/" : {
"get" : {
"tags" : [ "csat-companies" ],
"description" : "API endpoint for listing active csat agents.",
"operationId" : "csat-companies_list",
"responses" : {
"200" : {
"description" : "",
"content" : { }
}
}
}
},
"/csat-contacts/" : {
"get" : {
"tags" : [ "csat-contacts" ],
"description" : "API endpoint for listing active csat agents.",
"operationId" : "csat-contacts_list",
"responses" : {
"200" : {
"description" : "",
"content" : { }
}
}
}
},
"/nps-campaigns/" : {
"get" : {
"tags" : [ "nps-campaigns" ],
"description" : "API endpoint for listing active nps campaigns.",
"operationId" : "nps-campaigns_list",
"responses" : {
"200" : {
"description" : "",
"content" : { }
}
}
}
},
"/nps-responses/" : {
"get" : {
"tags" : [ "nps-responses" ],
"description" : "API endpoint for listing and syncing nps responses.",
"operationId" : "nps-responses_list",
"parameters" : [ {
"name" : "created_since",
"in" : "query",
"required" : false,
"style" : "form",
"explode" : true,
"schema" : {
"type" : "string"
}
}, {
"name" : "campaign_name",
"in" : "query",
"required" : false,
"style" : "form",
"explode" : true,
"schema" : {
"type" : "string"
}
}, {
"name" : "score_gt",
"in" : "query",
"required" : false,
"style" : "form",
"explode" : true,
"schema" : {
"type" : "number"
}
}, {
"name" : "score_lt",
"in" : "query",
"required" : false,
"style" : "form",
"explode" : true,
"schema" : {
"type" : "number"
}
}, {
"name" : "score_exact",
"in" : "query",
"required" : false,
"style" : "form",
"explode" : true,
"schema" : {
"type" : "number"
}
}, {
"name" : "limit",
"in" : "query",
"description" : "Number of results to return per page.",
"required" : false,
"style" : "form",
"explode" : true,
"schema" : {
"type" : "integer"
}
}, {
"name" : "offset",
"in" : "query",
"description" : "The initial index from which to return the results.",
"required" : false,
"style" : "form",
"explode" : true,
"schema" : {
"type" : "integer"
}
} ],
"responses" : {
"200" : {
"description" : "",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/inline_response_200"
}
}
}
}
}
}
},
"/nps-responses/{id}/" : {
"get" : {
"tags" : [ "nps-responses" ],
"description" : "API endpoint for listing and syncing nps responses.",
"operationId" : "nps-responses_read",
"parameters" : [ {
"name" : "id",
"in" : "path",
"required" : true,
"style" : "simple",
"explode" : false,
"schema" : {
"type" : "string"
}
} ],
"responses" : {
"200" : {
"description" : "",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/NPSResponse"
}
}
}
}
}
}
},
"/prj-responses/" : {
"get" : {
"tags" : [ "prj-responses" ],
"description" : "API endpoint for listing project responses.",
"operationId" : "prj-responses_list",
"parameters" : [ {
"name" : "limit",
"in" : "query",
"description" : "Number of results to return per page.",
"required" : false,
"style" : "form",
"explode" : true,
"schema" : {
"type" : "integer"
}
}, {
"name" : "offset",
"in" : "query",
"description" : "The initial index from which to return the results.",
"required" : false,
"style" : "form",
"explode" : true,
"schema" : {
"type" : "integer"
}
} ],
"responses" : {
"200" : {
"description" : "",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/inline_response_200_1"
}
}
}
}
}
}
},
"/prj-surveys/" : {
"get" : {
"tags" : [ "prj-surveys" ],
"description" : "API endpoint for listing active project surveys.",
"operationId" : "prj-surveys_list",
"responses" : {
"200" : {
"description" : "",
"content" : { }
}
}
}
},
"/reviews/" : {
"get" : {
"tags" : [ "reviews" ],
"description" : "API endpoint for listing and syncing reviews.",
"operationId" : "reviews_list",
"parameters" : [ {
"name" : "modified_since",
"in" : "query",
"required" : false,
"style" : "form",
"explode" : true,
"schema" : {
"type" : "string"
}
}, {
"name" : "include_unrated",
"in" : "query",
"required" : false,
"style" : "form",
"explode" : true,
"schema" : {
"type" : "string"
}
}, {
"name" : "limit",
"in" : "query",
"description" : "Number of results to return per page.",
"required" : false,
"style" : "form",
"explode" : true,
"schema" : {
"type" : "integer"
}
}, {
"name" : "offset",
"in" : "query",
"description" : "The initial index from which to return the results.",
"required" : false,
"style" : "form",
"explode" : true,
"schema" : {
"type" : "integer"
}
} ],
"responses" : {
"200" : {
"description" : "",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/inline_response_200_2"
}
}
}
}
}
}
},
"/reviews/recent/" : {
"get" : {
"tags" : [ "reviews" ],
"description" : "API endpoint for listing and syncing reviews.",
"operationId" : "reviews_recent",
"parameters" : [ {
"name" : "limit",
"in" : "query",
"description" : "Number of results to return per page.",
"required" : false,
"style" : "form",
"explode" : true,
"schema" : {
"type" : "integer"
}
}, {
"name" : "offset",
"in" : "query",
"description" : "The initial index from which to return the results.",
"required" : false,
"style" : "form",
"explode" : true,
"schema" : {
"type" : "integer"
}
} ],
"responses" : {
"200" : {
"description" : "",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/inline_response_200_2"
}
}
}
}
}
}
},
"/reviews/{id}/" : {
"get" : {
"tags" : [ "reviews" ],
"description" : "API endpoint for listing and syncing reviews.",
"operationId" : "reviews_read",
"parameters" : [ {
"name" : "id",
"in" : "path",
"required" : true,
"style" : "simple",
"explode" : false,
"schema" : {
"type" : "string"
}
} ],
"responses" : {
"200" : {
"description" : "",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Review"
}
}
}
}
}
}
}
},
"components" : {
"schemas" : {
"InternalContact" : {
"type" : "object",
"properties" : {
"id" : {
"title" : "ID",
"type" : "integer",
"readOnly" : true
},
"first_name" : {
"title" : "First name",
"maxLength" : 255,
"type" : "string"
},
"last_name" : {
"title" : "Last name",
"maxLength" : 255,
"type" : "string"
},
"email" : {
"title" : "Email",
"maxLength" : 254,
"minLength" : 1,
"type" : "string",
"format" : "email"
},
"company" : {
"title" : "Company",
"maxLength" : 128,
"type" : "string"
},
"title" : {
"title" : "Title",
"maxLength" : 128,
"type" : "string"
},
"location" : {
"title" : "Location",
"maxLength" : 128,
"type" : "string"
}
}
},
"NPSResponse" : {
"required" : [ "contact" ],
"type" : "object",
"properties" : {
"id" : {
"title" : "ID",
"type" : "integer",
"readOnly" : true
},
"score" : {
"title" : "Score",
"maximum" : 2147483647,
"minimum" : -2147483648,
"type" : "integer"
},
"comment" : {
"title" : "Comment",
"type" : "string",
"readOnly" : true
},
"has_marketing_permission" : {
"title" : "Has marketing permission",
"type" : "boolean",
"description" : "Indicates that end user has given permission for his comment to be used by Customer for marketing purposes."
},
"contact" : {
"$ref" : "#/components/schemas/InternalContact"
},
"contact_remote_id" : {
"title" : "Contact remote id",
"type" : "string",
"readOnly" : true
},
"campaign_name" : {
"title" : "Campaign name",
"type" : "string",
"readOnly" : true
},
"created_at" : {
"title" : "Created at",
"type" : "string",
"format" : "date-time"
}
}
},
"ProjectsResponse" : {
"required" : [ "contact", "response" ],
"type" : "object",
"properties" : {
"response" : {
"title" : "Response",
"type" : "object",
"additionalProperties" : {
"type" : "string",
"nullable" : true
}
},
"contact" : {
"title" : "Contact",
"type" : "object",
"additionalProperties" : {
"type" : "string",
"nullable" : true
}
}
}
},
"TicketSegment" : {
"type" : "object",
"properties" : {
"id" : {
"title" : "Id",
"minLength" : 1,
"type" : "string"
},
"name" : {
"title" : "Name",
"minLength" : 1,
"type" : "string"
}
}
},
"Ticket" : {
"required" : [ "id", "segment", "title" ],
"type" : "object",
"properties" : {
"id" : {
"title" : "Id",
"minLength" : 1,
"type" : "string"
},
"title" : {
"title" : "Title",
"minLength" : 1,
"type" : "string"
},
"segment" : {
"$ref" : "#/components/schemas/TicketSegment"
},
"agents" : {
"type" : "array",
"items" : {
"minLength" : 1,
"type" : "string"
}
},
"closed_on" : {
"title" : "Closed on",
"type" : "string",
"description" : "The moment the ticket was closed in the TSS. (null on legacy reactions/if we were not notified about closure.)",
"format" : "date-time",
"nullable" : true
}
}
},
"Contact" : {
"required" : [ "email", "id", "name" ],
"type" : "object",
"properties" : {
"id" : {
"title" : "Id",
"minLength" : 1,
"type" : "string"
},
"name" : {
"title" : "Name",
"minLength" : 1,
"type" : "string"
},
"email" : {
"title" : "Email",
"minLength" : 1,
"type" : "string"
}
}
},
"Company" : {
"required" : [ "id" ],
"type" : "object",
"properties" : {
"id" : {
"title" : "Id",
"minLength" : 1,
"type" : "string"
},
"name" : {
"title" : "Name",
"type" : "string"
},
"territory_name" : {
"title" : "Territory name",
"type" : "string",
"nullable" : true
},
"territory_remote_id" : {
"title" : "Territory remote id",
"type" : "string",
"nullable" : true
},
"market_name" : {
"title" : "Market name",
"type" : "string",
"nullable" : true
},
"market_remote_id" : {
"title" : "Market remote id",
"type" : "string",
"nullable" : true
}
}
},
"Review" : {
"required" : [ "comment", "company", "contact", "ticket" ],
"type" : "object",
"properties" : {
"id" : {
"title" : "ID",
"type" : "integer",
"readOnly" : true
},
"rating" : {
"title" : "Rating",
"type" : "string",
"readOnly" : true
},
"comment" : {
"title" : "Comment",
"minLength" : 1,
"type" : "string"
},
"ticket" : {
"$ref" : "#/components/schemas/Ticket"
},
"contact" : {
"$ref" : "#/components/schemas/Contact"
},
"company" : {
"$ref" : "#/components/schemas/Company"
},
"status" : {
"title" : "Status",
"type" : "string",
"enum" : [ "open", "done", "deleted" ]
},
"tags" : {
"maxItems" : 20,
"type" : "array",
"items" : {
"title" : "Tags",
"maxLength" : 50,
"minLength" : 1,
"type" : "string"
}
},
"has_marketing_permission" : {
"title" : "Has marketing permission",
"type" : "boolean",
"description" : "Indicates that end user has given permission for their comment to be used by Customer for marketing purposes."
},
"viewed_on" : {
"title" : "Viewed on",
"type" : "string",
"description" : "The moment the ticket notification was first viewed. (null if it has not been viewed yet / is not used in a medium that supports viewing.)",
"format" : "date-time",
"nullable" : true
},
"rated_on" : {
"title" : "Rated on",
"type" : "string",
"description" : "The moment the ticket was first rated by a client. (null if it has not been rated yet: then also sentiment null.)",
"format" : "date-time",
"nullable" : true
},
"permalink" : {
"title" : "Permalink",
"type" : "string",
"readOnly" : true
},
"last_modified" : {
"title" : "Last modified",
"type" : "string",
"description" : "The moment any parameter of the ticket has last been changed. Meant to facilitate incremental syncing reactions across multiple systems.",
"format" : "date-time"
}
}
},
"inline_response_200" : {
"required" : [ "count", "results" ],
"type" : "object",
"properties" : {
"count" : {
"type" : "integer"
},
"next" : {
"type" : "string",
"format" : "uri",
"nullable" : true
},
"previous" : {
"type" : "string",
"format" : "uri",
"nullable" : true
},
"results" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/NPSResponse"
}
}
}
},
"inline_response_200_1" : {
"required" : [ "count", "results" ],
"type" : "object",
"properties" : {
"count" : {
"type" : "integer"
},
"next" : {
"type" : "string",
"format" : "uri",
"nullable" : true
},
"previous" : {
"type" : "string",
"format" : "uri",
"nullable" : true
},
"results" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/ProjectsResponse"
}
}
}
},
"inline_response_200_2" : {
"required" : [ "count", "results" ],
"type" : "object",
"properties" : {
"count" : {
"type" : "integer"
},
"next" : {
"type" : "string",
"format" : "uri",
"nullable" : true
},
"previous" : {
"type" : "string",
"format" : "uri",
"nullable" : true
},
"results" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/Review"
}
}
}
}
},
"securitySchemes" : {
"SmileBack" : {
"type" : "oauth2",
"flows" : {
"password" : {
"tokenUrl" : "https://app.smileback.io/api/token/",
"scopes" : {
"read" : "Grants read access",
"read_recent" : "Grants read_recent access"
}
}
}
}
}
},
"x-original-swagger-version" : "2.0"
}