-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapiary.apib
4259 lines (3839 loc) · 234 KB
/
apiary.apib
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
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
FORMAT: 1A
HOST: https://flarecms.acurian.com//api/Flare/v1
# Flare CMS API
API for communicating with the Flare CMS (which then may communicate with the Acurian Services (A.S.).
object, array, enum, string, boolean, number
https://github.com/apiaryio/mson
https://help.apiary.io/
https://help.apiary.io/api_101/mson-tutorial/
https://github.com/apiaryio/api-blueprint/blob/master/API%20Blueprint%20Specification.md
# Group Initial important W.S. calls (registration/login/etc)
## /appLaunch
### App Launch [POST]
On the app launch (could be 1st launch, and every subsequent launch)
Note: only return the pre-login keys for themes/translations here.
Note: based on the app and version, we can figure out the prelogin Translation keys
Note: on the 1st launch they won't send up device id, but subsequent launch will (hence how you will know if need to create a device-id or not).
Note: check to see if the FCM token has changed for this device-id
Question: Should this WS have authentication like Basic since it doesnt have JWT Auth? (should the other ws requests which do have JWT Auth also have Basic Auth?). Answer: Sampad said that all W.S. should have Basic for ws auth, and we can use the JWT for user auth on WS that need them
Question: Which FCM Topic registrations should happen here? (Answer: os, locale, app, version). I am fine moving these generic ones (along with the patient/study-specific topics) into /register if you want to do them in 1 place.
Please call cms_version of apis for all web services. for example if default is not sent up, try to match up to a version. For now maybe we can always assume default() method?
function register($cms_version){
if($cms_version=='default' || isDefault($cms_version) ) { register_default(); }
else if($cms_version!='default' || versionMatchInDB($cms_version) && functionExists('register_'. $cms_version) ) { register$cms_version(); }
else { register_default(); } //no match
}
function register_default(){
register_v1(); //whats the default cms version
}
function register_v1(){
doStuff for V1...
}
function register_v2(){ //in future this may exist
doStuff for V2...
}
+ Request 200 (application/json)
+ Headers
Authorization: Basic dynamicCMSApiUserPassGoesHere
+ Attributes
+ OS (string) - android or ios or (web)
+ locale (string, optional) - assume 'en' (or 'en_US') if none passed
+ fcm_token (string) - mobile app will give us an FCM Token to register for that device
+ app_name (string) - machine name of app like 'default_flare_app' or 'pfizer_flare_app'
+ app_version (string) - examples: 'v1' or 'v1.5' or 'v2' 'v2.2' (do they want to just match on regex for example: 'v1\.1.*' and/or multiple versioning overrides per OS )
+ cms_version (string) - 'default' or 'v2', which pretend would correspond with login() and login_v2() respectively in the cms
+ mobile_app_version (string) - a value like '1.2.1' sent up by mobile team, which will help us calc if is_app_upgrade_needed needs to be true
+ device_id (string, optional) - *** provide if already gotton on app's 1st launch (response won't issue a new device_id, if one already passed up)
+ app_last_updated_date (string, optional) - *** needs to get the latest info so supply on subsequent launches... optional since we'll know if its empty string or missing to view this also as very first launch and all keys should be in inserts array
+ preferred_screen_density - *** not sure if will be used yet *** android_mdpi, ios_1x, original (possibly for Badge and Avatar urls or i pass all urls and mobile-app can decide which one to use)
+ theme_id (number, optional) - (very first time, nothing is passed) in case pre-login theme totally changed for app, pass back everything for new theme in inserts array otherwise do normal inserts/updates/deletes check within the theme
+ translation_group_id (number, optional) - (very first time, nothing is passed) in case pre-login translation-group totally changed for app, pass back everything for new translation-group in inserts array otherwise do normal inserts/updates/deletes check within the translation-group
+ Body
{
"OS": "android",
"locale": "en_US",
"fcm_token": "abc123...",
"app_name": "default_flare_app",
"app_version": "v1",
"cms_version": "default",
"device_id": "abc123def456ghi7890jklmnopqrstuv",
"app_last_updated_date": "2017-05-01 23:00:00",
"preferred_screen_density": "android_mdpi",
"theme_id": 1,
"translation_group_id": 2
}
+ Response 200 (application/json)
+ Attributes
+ request_status (RequestStatusObject)
+ cms_data (object)
+ is_app_upgrade_needed (boolean) - if true, then mobile app will block app usage and ask to upgrade app ... or provide direct link to upgrade. maybe just /appLaunch?
+ cms_app_last_updated_date (string)
+ device_id (string)
+ theme_info (object) - return prelogin theme keys only!
+ theme_id
+ theme_name (string)
+ is_inherited (boolean)
+ inherited_theme_id (number) - doesn't show up if is_inherited is false
+ inherited_theme_name (string) - doesn't show up if is_inherited is false
+ theme_values (object)
+ inserts (array[TranslationOrThemeKeyValueInsertOrUpdateObject])
+ updates (array[TranslationOrThemeKeyValueInsertOrUpdateObject])
+ deletes (array[TranslationOrThemeKeyValueDeleteObject])
+ translation_info (object) - return prelogin theme keys only!
+ translation_group_id (number) - adding this in case want a quick check later on
+ translation_group_name (string)
+ is_inherited (boolean)
+ inherited_translation_group_id (number) - doesn't show up if is_inherited is false
+ inherited_translation_group_name (string) - doesn't show up if is_inherited is false
+ translation_locale_key (string) - //pretend we send up en_AU but only en is available, i return the locale/lang/country info so app knows which locale or lang we got it from.
+ translation_language (object)
+ lang_code (string)
+ lang_desc (string)
+ translation_country (object)
+ country_code (string) - might be null if we using default en translation pretend
+ country_desc (string) - might be null if we using default en translation pretend
+ translation_values (object)
+ inserts (array[TranslationOrThemeKeyValueInsertOrUpdateObject])
+ updates (array[TranslationOrThemeKeyValueInsertOrUpdateObject])
+ deletes (array[TranslationOrThemeKeyValueDeleteObject])
+ Body
{
"request_status": {
"status": "success"
},
"cms_data": {
"is_app_upgrade_needed": false,
"cms_app_last_updated_date": "2017-01-10 23:45:12",
"device_id": "abc123def456ghi7890jklmnopqrstuv",
"theme_info":
{
"theme_id": 2,
"theme_name": "Theme AAA",
"is_inherited": true,
"inherited_theme_id": 2,
"inherited_theme_name": "Theme A",
"theme_values":
{
"inserts": [
{ "key": "app_background_color", "value": "#FFFFFF", "type": "color_picker", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{ "key": "app_heading_color", "value": "#000000", "type": "color_picker", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{ "key": "app_button_color", "value": "#0000FF", "type": "color_picker", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
-- note: for Image types below,
-- *** if its a high rez image, we will just serve that key and that high-rez image's url, like 1st example below
{ "key": "app_background_image", "value": "https://www.acurianhealth.com/tests/flare_app/default_background.png", "type": "image", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00", },
-- *** if its a zip file uploaded with multiple images per 1 key (_android_hdpi, _ios_1x, etc), then we will APPEND/POSTFIX the resolution to the key to keep it unique... then filter out the 7 or so keys that dont apply to your screen_density
{ "key": "app_background_image_ios_1x", "value": "https://www.acurianhealth.com/tests/flare_app/ios_background_1x.png", "type": "image", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{ "key": "app_background_image_ios_2x", "value": "https://www.acurianhealth.com/tests/flare_app/ios_background_2x.png", "type": "image", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{ "key": "app_background_image_ios_3x", "value": "https://www.acurianhealth.com/tests/flare_app/ios_background_3x.png", "type": "image", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{ "key": "app_background_image_android_mdpi", "value": "https://www.acurianhealth.com/tests/flare_app/android_background_mdpi.png", "type": "image", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{ "key": "app_background_image_android_hdpi", "value": "https://www.acurianhealth.com/tests/flare_app/android_background_hdpi.png", "type": "image", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{ "key": "app_background_image_android_xhdpi", "value": "https://www.acurianhealth.com/tests/flare_app/android_background_xhdpi.png", "type": "image", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{ "key": "app_background_image_android_xxhdpi", "value": "https://www.acurianhealth.com/tests/flare_app/android_background_xxhdpi.png", "type": "image", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{ "key": "app_background_image_android_xxxhdpi", "value": "https://www.acurianhealth.com/tests/flare_app/android_background_xxxhdpi.png", "type": "image", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{ "key": "app_background_image_alt", "value": "https://www.acurianhealth.com/tests/flare_app/default_background_alt.png", "type": "image", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{ "key": "app_android_font_alt", "value": "https://www.acurianhealth.com/tests/flare_app/Arial.ttf", "type": "image", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{ "key": "app_ios_font_alt", "value": "https://www.acurianhealth.com/tests/flare_app/ArialIOS.ttf", "type": "image", "os": "ios", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{ "key": "app_heading_size", "value": "large", "type": "size", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{ "key": "app_heading_android_custom_text", "value": "Arial", "type": "custom_text", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{ "key": "app_heading_ios_custom_text", "value": "ArialIOS", "type": "custom_text", "os": "ios", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" }
],
"updates": [
{ "key": "test_update_key1", "value": "large", "type": "size", "os": "android", "pre_login": true, "updated_date": "2017-05-01 12:00:00" },
{ "key": "test_update_key2", "value": "large", "type": "size", "os": "android", "pre_login": true, "updated_date": "2017-05-01 12:00:00" }
],
"deletes": [
{"key":"test_delete_key1", "deleted_date": "2017-05-01 12:00:00"},
{"key":"test_delete_key2", "deleted_date": "2017-05-01 12:00:00"}
]
}
},
"translation_info": {
"translation_group_id": 1,
"translation_group_name": "Default Flare App translations",
"translation_locale_key": "en_US",
"translation_language": {
"lang_code": "en",
"lang_desc": "English"
},
"translation_country": {
"country_code": "US",
"country_desc": "United States"
},
"translation_values": {
"inserts": [
{"key":"Welcome_mainTitle", "value":"FLARE STUDY", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"Welcome_subTitle", "value":"Welcome!", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"Welcome_subText", "value":"Signup using your online screener registration information", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"Welcome_termsConditionsText", "value":"Terms and Condition", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"Welcome_privaryPolicy", "value":"Privacy Policy", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"Welcome_registerButton", "value":"Register", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"Registration_title", "value":"New User Registration", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"Registration_name", "value":"Name", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"Registration_username", "value":"Username", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"Registration_password", "value":"Password", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"Registration_email", "value":"Email Id", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"Registration_phone", "value":"Phone Number", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"Registration_registrationKey", "value":"Registration Key", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"Registration_registrationButton", "value":"Register", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"RegistrationDialog_title", "value":"Congratulations", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"RegistrationDialog_description", "value":"You have successfully registered", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"RegistrationDialog_okay", "value":"Okay", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"Login_mainTitle", "value":"FLARE STUDY", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"Login_password", "value":"Password", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"Login_username", "value":"Username", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"Login_authenticateButton", "value":"LOGIN", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"Login_registerButton", "value":"NEW USER Registration", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"Login_forgotPassword", "value":"Forgot your password?", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"Login_resetText", "value":"Reset it", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"Home_title", "value":"Flare Study", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"Home_rewardsText", "value":"Reward Points", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"Home_flareStatusText", "value":"Flare Status", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"Home_lastSiteVisitText", "value":"Last Site Visit", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"Home_flareNotVerifiedStatus", "value":"Not Verified", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"Home_flareReported", "value":"Flares Reported", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"Home_siteVisits", "value":"Site Visits", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"Home_FlareDetectionDiaglo_title", "value":"FLARE DETECTED", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"Home_FlareDetectionDialog_contactDetailsText", "value":"Please contact site at", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"SurveyDecisionScreen_title", "value":"How are you feeling?", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"SurveyDecisionScreen_ok", "value":"Ok", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"SurveyDecisionScreen_notOk", "value":"Not Ok", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"Drawer_userName", "value":"John Smith", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"Drawer_profileText", "value":"My Profile", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"Drawer_homeMenu", "value":"Home", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"Drawer_notificationsMenu", "value":"Notifications", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"Drawer_studyMaterialMenu", "value":"Study Material", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"Drawer_siteDetailsMenu", "value":"Contact Site", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"Drawer_settingsMenu", "value":"Settings", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" },
{"key":"Drawer_logoutMenu", "value":"Logout", "os": "android", "pre_login": true, "inserted_date": "2017-05-01 12:00:00" }
],
"updates": [
{"key":"test_update_key1", "value":"Logout", "os": "android", "pre_login": true, "updated_date": "2017-05-01 12:00:00" },
{"key":"test_update_key2", "value":"Logout", "os": "android", "pre_login": true, "updated_date": "2017-05-01 12:00:00" }
],
"deletes": [
{"key":"test_delete_key1", "deleted_date": "2017-05-01 12:00:00"},
{"key":"test_delete_key2", "deleted_date": "2017-05-01 12:00:00"}
]
}
}
},
"acurian_services_data": {}
}
## /validateFlareActivationKey
### Validate Flare Activation/Registration Key [POST]
Note: should call /validateFlareRegistrationKey AS service
The next call /register call should confirm its the same patient id I heard.
Note: about app_last_updated_date being passed here: I know its passed in payload in case i need it... But mobile-app shouldn't update the app_last_updated date, i don't think this request should return cms_data
Note: the response can be something like: RegistrationKeyValidation: "EXPIRED" or
+ Request 200 (application/json)
+ Headers
Authorization: Basic dynamicCMSApiUserPassGoesHere
+ Attributes
+ OS (string) - android or ios or (web)
+ locale (string, optional) - assume 'en' (or 'en_US') if none passed
+ fcm_token (string) - mobile app will give us an FCM Token to register for that device
+ app_name (string) - machine name of app like 'default_flare_app' or 'pfizer_flare_app'
+ app_version (string) - examples: 'v1' or 'v1.5' or 'v2' 'v2.2' (do they want to just match on regex for example: 'v1\.1.*' and/or multiple versioning overrides per OS )
+ cms_version (string) - 'default' or 'v2', which pretend would correspond with login() and login_v2() respectively in the cms
+ device_id (string, optional) - provide if already gotton on app's 1st launch (response won't issue a new device_id, if one already passed up)
+ app_last_updated_date (string, optional) - needs to get the latest info so supply on subsequent launches
+ preferred_screen_density - *** not sure if will be used yet *** android_mdpi, ios_1x, original (possibly for Badge and Avatar urls or i pass all urls and mobile-app can decide which one to use)
+ registration_key - *** is there something else that can be used if they dont have activation key?
+ Body
{
"OS": "android",
"locale": "en_US",
"fcm_token": "abc123...",
"app_name": "default_flare_app",
"app_version": "v1",
"cms_version": "default",
"device_id": "abc123def456ghi7890jklmnopqrstuv",
"app_last_updated_date": "2017-05-01 23:00:00",
"registration_key": "LMYLF6"
}
+ Response 200 (application/json)
+ Attributes
+ request_status (RequestStatusObject)
+ cms_data - empty
+ acurian_services_data
+ Body
{
"request_status": {
"status": "success"
},
"cms_data": {},
"acurian_services_data": {
apiResponse: {
RegistrationKeyValidation: "VALID_AND_AVAILABLE_FOR_REGISTRATION"
},
apiErrors: [{
code: 200,
status: "OK",
message: "Registration key is valid and available for registration",
moreInfo: "Registration key is valid and available for registration",
httpStatus: "OK",
versionInfo: "Supported"
}
]
}
}
## /resetFlareUserRegistrationKey
### Reset (and possibly Generate) Flare Patient Registration Key [POST]
Note: should call /sendFlareRegKeyResetLink (which in turn will call /resetFlareUserRegKey from clicking the email link) AS service (note: this used to be called old /resetFlareUserRegistrationKey WS directly which is incorrect)
Some of these params below aren't needed but for now we agreed to always accept if they are available and sent up from the mobile-app (OS till app_last_updated_date for example)
+ Request 200 (application/json)
+ Headers
Authorization: Basic dynamicCMSApiUserPassGoesHere
+ Attributes
+ OS (string) -
+ locale (string, optional) -
+ fcm_token (string) -
+ app_name (string) -
+ app_version (string) -
+ cms_version (string) -
+ device_id (string, optional) -
+ app_last_updated_date (string, optional) -
+ email (required)
+ Body
{
"OS": "android",
"locale": "en_US",
"fcm_token": "abc123...",
"app_name": "default_flare_app",
"app_version": "v1",
"cms_version": "default",
"device_id": "abc123def456ghi7890jklmnopqrstuv",
"app_last_updated_date": "2017-05-01 23:00:00",
"email":"[email protected]",
}
+ Response 200 (application/json)
+ Attributes
+ request_status (RequestStatusObject)
+ cms_data - empty
+ acurian_services_data
+ Body
{
"request_status": {
"status": "success"
},
"cms_data": {},
"acurian_services_data": {
apiResponse: {
uniqueId: "7JT2U8"
},
apiErrors: [
{
code: 200,
status: "Success",
message: "Success",
moreInfo: "Success",
httpStatus: "OK",
versionInfo: "Supported"
}
]
}
}
+ Response 409 (application/json)
+ Attributes
+ request_status (RequestStatusObject)
+ cms_data - empty
+ acurian_services_data
+ Body
{
"request_status": {
"status": "error",
"errors": [ {
"error_source": "acurian_services_error",
"error_code": "PATIENT_ALREADY_REGISTERED_EXCEPTION_EXAMPLE",
"error_message": "Patient already registered"
}
]
},
"cms_data": {},
"acurian_services_data": {
apiResponse: {
patientInfo: {
flareUserId: 0,
emailId: "[email protected]",
phoneNumber: "123-456-7890",
password: null,
registrationKey: null,
languagePref: null,
studyId: -1,
textPref: null,
phonePref: null,
emailPref: null,
surveyFreq: null,
notifFreq: null,
patientId: 0,
oldPassword: null,
newPassword: null,
status: null,
firstName: "Acurian",
lastName: "Trial",
projectCode: null,
registrationKeyExpired: null,
site: null,
metaData: null,
dob: "26-03-1973",
zipCode: "19044",
streetAddress: "Street 12"
}
},
apiErrors: [{
code: 409,
status: "PATIENT_ALREADY_REGISTERED_EXCEPTION_EXAMPLE",
message: "Patient already registered",
moreInfo: "Patient already registered",
httpStatus: "OK",
versionInfo: "Supported"
}]
}
}
## /register
### Register [POST]
Note: should call /registerFlareUser AS service and /getFlareSurvey AS service for the 2 objects under acurian_services_data
Note: similar to how we filtered theme/translation keys for pre-login keys for /appLaunch, make sure to filter theme/translation keys for post-login keys for /register
upon registration (after validating the token which happens separately)
Question: should we issue a jwt token to auto-login you in here, or call /login or /authorization after?: Answer: we should issue a jwt token and call AS /authorize with the same user/password so they can see that someone 'logged in' (their AS register doesn't do this)
Note: subscribe to FCM topics here as needed.
Note: create a good patient schema here since we'll have the flare_user_id and things to related to it like device_id, fcm_token, etc.
+ Request 200 (application/json)
+ Headers
Authorization: Basic dynamicCMSApiUserPassGoesHere
+ Attributes
+ OS (string) - android or ios or (web)
+ locale (string, optional) - assume 'en' (or 'en_US') if none passed
+ fcm_token (string) - mobile app will give us an FCM Token to register for that device
+ app_name (string) - machine name of app like 'default_flare_app' or 'pfizer_flare_app'
+ app_version (string) - examples: 'v1' or 'v1.5' or 'v2' 'v2.2' (do they want to just match on regex for example: 'v1\.1.*' and/or multiple versioning overrides per OS )
+ cms_version (string) - 'default' or 'v2', which pretend would correspond with login() and login_v2() respectively in the cms
+ device_id (string) - provide since already done on app 1st launch
+ app_last_updated_date (string) - needs to get the latest info
+ preferred_screen_density - *** not sure if will be used yet *** android_mdpi, ios_1x, original (possibly for Badge and Avatar urls or i pass all urls and mobile-app can decide which one to use)
+ activation_key - *** is there something else that can be used if they dont have activation key?
+ email (string, required) - *** email from
+ password (string, optional) - *** Note: any password inputs I believe will always be md5-ed be4 they get to us
+ Body
{
"OS": "android",
"locale": "en_US",
"fcm_token": "abc123...",
"app_name": "default_flare_app",
"app_version": "v1",
"cms_version": "default"
"device_id": "def124",
"app_last_updated_date": "2017-05-01 23:00:00",
"preferred_screen_density": "android_mdpi",
"activation_key": "usertypingsomething",
"email": "[email protected]",
"phone_number": "abc1234",
"password": "md5(password@2!$test)"
}
+ Response 200 (application/json)
+ Attributes
+ request_status (RequestStatusObject)
+ cms_data (object)
+ cms_app_last_updated_date (string) -
+ jwt_token (string) - hmmm so if we can't call our own /login since it will return data as if you logged in for 1st time, then we have to call AS's login directly and get the jwt token here (also will issue one if user logs out and has to do a CMS /login)
+ theme_info (object) - filter post-login theme keys only!
+ theme_id
+ theme_name (string)
+ is_inherited (boolean)
+ inherited_theme_id (number) - doesn't show up if is_inherited is false
+ inherited_theme_name (string) - doesn't show up if is_inherited is false
+ theme_values (object)
+ inserts (array[TranslationOrThemeKeyValueInsertOrUpdateObject])
+ updates (array[TranslationOrThemeKeyValueInsertOrUpdateObject])
+ deletes (array[TranslationOrThemeKeyValueDeleteObject])
+ translation_info (object) - filter post-login translation keys only!
+ translation_group_id (number) - adding this in case want a quick check later on
+ translation_group_name (string)
+ is_inherited (boolean)
+ inherited_translation_group_id (number) - doesn't show up if is_inherited is false
+ inherited_translation_group_name (string) - doesn't show up if is_inherited is false
+ translation_locale_key (string) - //pretend we send up en_AU but only en is available, i return the locale/lang/country info so app knows which locale or lang we got it from.
+ translation_language (object)
+ lang_code (string)
+ lang_desc (string)
+ translation_country (object)
+ country_code (string) - might be null if we using default en translation pretend
+ country_desc (string) - might be null if we using default en translation pretend
+ translation_values (object)
+ inserts (array[TranslationOrThemeKeyValueInsertOrUpdateObject])
+ updates (array[TranslationOrThemeKeyValueInsertOrUpdateObject])
+ deletes (array[TranslationOrThemeKeyValueDeleteObject])
+ study_materials
+ inserts (array[AppMaterialOrStudyMaterialInsertOrUpdateObject])
+ updates (array[AppMaterialOrStudyMaterialInsertOrUpdateObject])
+ deletes (array[AppMaterialOrStudyMaterialDeleteObject])
+ app_materials
+ inserts (array[AppMaterialOrStudyMaterialInsertOrUpdateObject])
+ updates (array[AppMaterialOrStudyMaterialInsertOrUpdateObject])
+ deletes (array[AppMaterialOrStudyMaterialDeleteObject])
+ avatars
+ avatar_group_id (number)
+ avatar_group_name (string)
+ fallback_translation_key_avatar_awarded (string) - lookup can fail
+ fallback_translation_key_avatar_achieve_title (string) - lookup can fail
+ fallback_translation_key_avatar_achieve_body (string) - lookup can fail
+ inserts (array[AvatarInsertOrUpdateObject])
+ updates (array[AvatarInsertOrUpdateObject])
+ deletes (array[AvatarOrBadgeDeleteObject])
+ badges
+ badge_group_id (number)
+ badge_group_name (string)
+ fallback_translation_key_badge_awarded (string) - could be empty too
+ fallback_translation_key_badge_achieve_title (string) - could be empty too
+ fallback_translation_key_badge_achieve_body (string) - could be empty too
+ inserts (array[BadgeInsertOrUpdateObject])
+ updates (array[BadgeInsertOrUpdateObject])
+ deletes (array[AvatarOrBadgeDeleteObject])
+ app_info
+ latency_minutes (number) - this can probably be moved into study_info but im not very picky on this since its a true app configuration vs study... maybe we want to add more things in the future to the app_info
+ study_info
+ study_id (number) - already in the
+ project_code (string)
+ cms_study_id (number)
+ avatar_trigger (string) - for now we only have 1 type of trigger, so using string for now. later we maybe have an id from the dropdown
+ badge_trigger (string) - for now we only have 1 type of trigger, so using string for now. later we maybe have an id from the dropdown
+ number_hours_maintain_streak_data (number)
+ allow_user_to_take_survey_if_in_flare (boolean)
+ allow_gain_avatars_offline (boolean)
+ allow_gain_badges_offline (boolean)
+ allow_gain_same_badge_multiple_times (boolean)
+ show_baseline_after_register (boolean)
+ show_non_baseline_after_register (boolean)
+ show_baseline_in_survey (boolean)
+ editable_baseline_in_survey (boolean)
+ show_baseline_link_in_settings (boolean)
+ spectrum_graph_colors (array[SpectrumColorObject]) - hardcoded for now, we will make a CMS page later to collect this info which will build the spectrum graph dynamically
+ patient_profile_score
+ patient_profile_score_formula (string)
+ patient_profile_score_mapping (array[PatientProfileScoreMappingObject])
+ question_color_image_mapping
+ questions (array[QuestionColorImageMappingObject])
+ acurian_services_data (object)
+ patient_info (object) - pull this data from the AS service: POST /registerFlareUser (params: emailID, phoneNumber, password, registrationKey, languagePref ... correspond to our values: email, phone_number, password, activation_key, locale)
+ site_info (object) - pull this data form the AS service: POST /getFlareSiteInfoByPatientId
+ survey_info (object) - pull this data from the AS service: GET /getFlareSurvey
+ Body
{
"request_status": {
"status": "success"
},
"cms_data": {
"cms_app_last_updated_date": "2017-01-10 23:45:12",
"jwt_token": "def456...",
"theme_info": {
"theme_id": 2,
"theme_name": "Theme AAA",
"is_inherited": true,
"inherited_theme_id": 2,
"inherited_theme_name": "Theme A",
"theme_values": {
"inserts": [{
"key": "app_background_color",
"value": "#FFFFFF",
"type": "color_picker",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "app_heading_color",
"value": "#000000",
"type": "color_picker",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "app_button_color",
"value": "#0000FF",
"type": "color_picker",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "app_background_image",
"value": "https://www.acurianhealth.com/tests/flare_app/default_background.png",
"type": "image",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "app_background_image_iOS_1x",
"value": "https://www.acurianhealth.com/tests/flare_app/ios_background_1x.png",
"type": "image",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "app_background_image_iOS_2x",
"value": "https://www.acurianhealth.com/tests/flare_app/ios_background_2x.png",
"type": "image",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "app_background_image_iOS_3x",
"value": "https://www.acurianhealth.com/tests/flare_app/ios_background_3x.png",
"type": "image",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "app_background_image_android_mdpi",
"value": "https://www.acurianhealth.com/tests/flare_app/android_background_mdpi.png",
"type": "image",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "app_background_image_android_hdpi",
"value": "https://www.acurianhealth.com/tests/flare_app/android_background_hdpi.png",
"type": "image",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "app_background_image_android_xhdpi",
"value": "https://www.acurianhealth.com/tests/flare_app/android_background_xhdpi.png",
"type": "image",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "app_background_image_android_xxhdpi",
"value": "https://www.acurianhealth.com/tests/flare_app/android_background_xxhdpi.png",
"type": "image",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "app_background_image_android_xxxhdpi",
"value": "https://www.acurianhealth.com/tests/flare_app/android_background_xxxhdpi.png",
"type": "image",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "app_background_image_alt",
"value": "https://www.acurianhealth.com/tests/flare_app/default_background_alt.png",
"type": "image",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
},
{
"key": "app_android_font_alt",
"value": "https://www.acurianhealth.com/tests/flare_app/Arial.ttf",
"type": "file",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "app_ios_font_alt",
"value": "https://www.acurianhealth.com/tests/flare_app/ArialIOS.ttf",
"type": "file",
"os": "ios",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
},
{
"key": "app_heading_size",
"value": "large",
"type": "size",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "app_heading_android_custom_text",
"value": "Arial",
"type": "custom_text",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "app_heading_ios_custom_text",
"value": "ArialIOS",
"type": "custom_text",
"os": "ios",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}
],
"updates": [{
"key": "test_update_key1",
"value": "large",
"type": "size",
"os": "android",
"pre_login": true,
"updated_date": "2017-05-01 12:00:00"
}, {
"key": "test_update_key2",
"value": "large",
"type": "size",
"os": "android",
"pre_login": true,
"updated_date": "2017-05-01 12:00:00"
}
],
"deletes": [{
"key": "test_delete_key1",
"deleted_date": "2017-05-01 12:00:00"
}, {
"key": "test_delete_key2",
"deleted_date": "2017-05-01 12:00:00"
}
]
}
},
"translation_info": {
"translation_group_id": 1,
"translation_group_name": "Default Flare App translations",
"translation_locale_key": "en_US",
"translation_language": {
"lang_code": "en",
"lang_desc": "English"
},
"translation_country": {
"country_code": "US",
"country_desc": "United States"
},
"translation_values": {
"inserts": [{
"key": "Welcome_mainTitle",
"value": "FLARE STUDY",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "Welcome_subTitle",
"value": "Welcome!",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "Welcome_subText",
"value": "Signup using your online screener registration information",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "Welcome_termsConditionsText",
"value": "Terms and Condition",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "Welcome_privaryPolicy",
"value": "Privacy Policy",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "Welcome_registerButton",
"value": "Register",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "Registration_title",
"value": "New User Registration",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "Registration_name",
"value": "Name",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "Registration_username",
"value": "Username",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "Registration_password",
"value": "Password",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "Registration_email",
"value": "Email Id",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "Registration_phone",
"value": "Phone Number",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "Registration_registrationKey",
"value": "Registration Key",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "Registration_registrationButton",
"value": "Register",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "RegistrationDialog_title",
"value": "Congratulations",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "RegistrationDialog_description",
"value": "You have successfully registered",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "RegistrationDialog_okay",
"value": "Okay",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "Login_mainTitle",
"value": "FLARE STUDY",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "Login_password",
"value": "Password",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "Login_username",
"value": "Username",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "Login_authenticateButton",
"value": "LOGIN",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "Login_registerButton",
"value": "NEW USER Registration",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "Login_forgotPassword",
"value": "Forgot your password?",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "Login_resetText",
"value": "Reset it",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "Home_title",
"value": "Flare Study",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "Home_rewardsText",
"value": "Reward Points",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "Home_flareStatusText",
"value": "Flare Status",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "Home_lastSiteVisitText",
"value": "Last Site Visit",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "Home_flareNotVerifiedStatus",
"value": "Not Verified",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "Home_flareReported",
"value": "Flares Reported",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "Home_siteVisits",
"value": "Site Visits",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "Home_FlareDetectionDiaglo_title",
"value": "FLARE DETECTED",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "Home_FlareDetectionDialog_contactDetailsText",
"value": "Please contact site at",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "SurveyDecisionScreen_title",
"value": "How are you feeling?",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "SurveyDecisionScreen_ok",
"value": "Ok",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "SurveyDecisionScreen_notOk",
"value": "Not Ok",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "Drawer_userName",
"value": "John Smith",
"os": "android",
"pre_login": true,
"inserted_date": "2017-05-01 12:00:00"
}, {
"key": "Drawer_profileText",