-
Notifications
You must be signed in to change notification settings - Fork 87
/
apiary.apib
16093 lines (13269 loc) · 545 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: http://api.topcoder.com/v2
# TopCoder API
Programmatically access TopCoder challenges and members.
# Group Authorization
Authorization APIs
## Create JWT Token [/auth]
### Create JWT Token [POST]
+ Parameters
+ username (required, string, `heffan`) ... The username
+ password (required, string, `password`) ... The password
+ Response 200 (application/json)
{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3NtYS5hdXRoMC5jb20vIiwic3ViIjoiYWR8"
}
+ Response 400 (application/json)
{
"name":"Bad Request",
"value":"400",
"description":"This message will explain why the request is invalid or cannot be served."
}
+ Response 404 (application/json)
{
"name":"Not Found",
"value":"404",
"description":"This message will explain why the URI requested is invalid or the resource does not exist."
}
+ Response 500 (application/json)
{
"name":"Internal Server Error",
"value":"500",
"description":"Unknown server error. Please contact support."
}
+ Response 503 (application/json)
{
"name":"Service Unavailable",
"value":"503",
"description":"Servers are up but overloaded. Try again later."
}
## Refresh JWT Token [/reauth]
### Refresh JWT Token [POST]
+ Parameters
+ token (required, string, `eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3NtYS5hdXRoMC5jb20vIiwic3ViIjoiYWR8`) ... The old JWT token
+ Response 200 (application/json)
{
"token": "DyJCdeAiOiH7V1QiLCJhbGciOiJI5zI1NiJ9.eyJpc3MiOiJodHRrezovL3NtYS5uyXRoMC5jb20vIiwic3ViIoo4XSO2"
}
+ Response 400 (application/json)
{
"name":"Bad Request",
"value":"400",
"description":"This message will explain why the request is invalid or cannot be served."
}
+ Response 404 (application/json)
{
"name":"Not Found",
"value":"404",
"description":"This message will explain why the URI requested is invalid or the resource does not exist."
}
+ Response 500 (application/json)
{
"name":"Internal Server Error",
"value":"500",
"description":"Unknown server error. Please contact support."
}
+ Response 503 (application/json)
{
"name":"Service Unavailable",
"value":"503",
"description":"Servers are up but overloaded. Try again later."
}
## Validate SSO Cookie [/validation/sso]
### Validate SSO Cookie [GET]
+ Parameters
+ Cookie (required, string, `tcsso=132456|4a6acc4d5327773989a7e8c23b04e8cd1c3da79a1256590973ed731ffa0f24a2`) ... The sso cookie
+ Response 200 (application/json)
{
"userId": 132456
}
+ Response 400 (application/json)
{
"name":"Bad Request",
"value":"400",
"description":"This message will explain why the request is invalid or cannot be served."
}
+ Response 500 (application/json)
{
"name":"Internal Server Error",
"value":"500",
"description":"Unknown server error. Please contact support."
}
+ Response 503 (application/json)
{
"name":"Service Unavailable",
"value":"503",
"description":"Servers are up but overloaded. Try again later."
}
# Group Reports
Report APIs
## Challenge Costs [/reports/costs/{startDate}/{endDate}?clientid={clientId}&billingId={billingId}&projectId={projectId}&challengeId={challengeId}]
### Challenge Costs [GET]
+ Parameters
+ startDate (required, string, `2013-07-01`) ... Start Date
+ endDate (required, string, `2013-12-01`) ... End Date
+ clientId (optional, number, `4310`) ... Client Id
+ billingId (optional, number, `2310`) ... Billing Id
+ projectId (optional, number, `6707`) ... Project Id
+ challengeId (optional, number, `30000001`) ... Challenge Id
+ Response 200 (application/json)
{
"history":
[
{
"paymentDate": "2013-09-12",
"clientName": "Topcoder",
"clientId": 1,
"billingName": "Topcoder2013",
"projectName": "CS-TC API",
"challengeName": "challenge 1",
"challengeId": 30030010,
"challengeType": "development",
"challengeStatus": "completed",
"launchDate": "2013-08-10",
"completionDate": "2013-08-25",
"paymentType": "contest fee",
"amount": 5000.0
},
{
"paymentDate": "2013-09-15",
"clientName": "Topcoder",
"clientId": 1,
"billingName": "Topcoder2013",
"projectName": "CS-TC API",
"challengeName": "challenge 2",
"challengeId": 30030012,
"challengeType": "development",
"challengeStatus": "completed",
"launchDate": "2013-08-12",
"completionDate": "2013-08-27",
"paymentType": "contest fee",
"amount": 5000.0
}
]
}
+ Response 400 (application/json)
{
"name":"Bad Request",
"value":"400",
"description":"This message will explain why the request is invalid or cannot be served."
}
+ Response 404 (application/json)
{
"name":"Not Found",
"value":"404",
"description":"This message will explain why the URI requested is invalid or the resource does not exist."
}
+ Response 500 (application/json)
{
"name":"Internal Server Error",
"value":"500",
"description":"Unknown server error. Please contact support."
}
+ Response 503 (application/json)
{
"name":"Service Unavailable",
"value":"503",
"description":"Servers are up but overloaded. Try again later."
}
## Client Challenge Costs [/reports/client/costs/?startDate={startDate}&endDate={endDate}&clientid={clientId}&sfdcAccountId={sfdcAccountId}&customerNumber={customerNumer}]
### Client Challenge Costs [GET]
+ Parameters
+ startDate (required, string, `2013-07-01`) ... Start Date
+ endDate (required, string, `2013-12-01`) ... End Date
+ clientId (optional, number, `4310`) ... Client Id
+ sfdcAccountId (optional, string, `4310`) ... SFDC Account Id
+ customerNumber (optional, string, `4310`) ... Customer Number
+ Response 200 (application/json)
{
"history":
[
{
"customerName": "Topcoder",
"customerId": 1,
"projectName": "CS-TC API",
"projectId": 1234,
"challengeName": "challenge 1",
"challengeId": 30030010,
"challengeType": "development",
"challengeStatus": "completed",
"postingDate": "2013-08-10",
"completionDate": "2013-08-25",
"challengeFulfillment": 75,
"challengeMemberCost": 5000.0,
"challengeFee": 2500.0,
"challengeTotalCost": 7500.0,
"challengeDuration": 13.47
},
{
"customerName": "Topcoder2",
"customerId": 2,
"projectName": "NodeJS API",
"projectId": 1235,
"challengeName": "challenge 2",
"challengeId": 30030011,
"challengeType": "development",
"challengeStatus": "completed",
"postingDate": "2013-08-11",
"completionDate": "2013-08-26",
"challengeFulfillment": 80,
"challengeMemberCost": 5000.0,
"challengeFee": 2500.0,
"challengeTotalCost": 7500.0,
"challengeDuration": 13.78
}
]
}
+ Response 400 (application/json)
{
"name":"Bad Request",
"value":"400",
"description":"This message will explain why the request is invalid or cannot be served."
}
+ Response 404 (application/json)
{
"name":"Not Found",
"value":"404",
"description":"This message will explain why the URI requested is invalid or the resource does not exist."
}
+ Response 500 (application/json)
{
"name":"Internal Server Error",
"value":"500",
"description":"Unknown server error. Please contact support."
}
+ Response 503 (application/json)
{
"name":"Service Unavailable",
"value":"503",
"description":"Servers are up but overloaded. Try again later."
}
## Client Active Challenge Costs [/reports/client/activeCosts/?clientid={clientId}&sfdcAccountId={cmc}&customerNumber={customerNumber}]
### Client Active Challenge Costs [GET]
+ Parameters
+ clientId (optional, number, `4310`) ... Client Id
+ sfdcAccountId (optional, string, `4310`) ... CMC account ID
+ customerNumber (optional, string, `4310`) ... Customer number
+ Response 200 (application/json)
{
"active": [
{
"customerName": "Client 9000001",
"customerNumber": "900000100",
"customerId": 9000001,
"billingAccountId": 9000001,
"billingAccountName": "Client 9000001 Billing Account 1",
"projectName": "Client 9000001 Billing Account 1 Project 2",
"challengeName": "Logo Design Contest 2",
"challengeId": 9000002,
"challengeType": "Logo Design",
"challengeStatus": "Active",
"postingDate": "2014-03-27",
"completionDate": "2014-03-29",
"challengeMemberCost": 0,
"challengeFee": 375,
"challengeTotalCost": 375,
"challengeDuration": 1.8,
"lastModificationDate": "2014-03-29",
"registrationEndDate": "2014-03-29",
"submissionEndDate": "2014-04-03",
"checkpointEndDate": "2014-03-30",
"currentPhase": "Checkpoint Screening",
"firstPrize": 1700,
"totalPrize": 1870,
"checkpointPrize": 170,
"registrantsCount": 2,
"submissionsCount": 0,
"checkpointSubmissionsCount": 2,
"challengeScheduledEndDate": "2014-04-08",
"reliability": 4
},
{
"customerName": "Client 9000001",
"customerNumber": "900000100",
"customerId": 9000001,
"billingAccountId": 9000002,
"billingAccountName": "Client 9000001 Billing Account 2",
"projectName": "Client 9000001 Billing Account 2 Project 1",
"challengeName": "Conceptualization Contest 3",
"challengeId": 9000003,
"challengeType": "Conceptualization",
"challengeStatus": "Active",
"postingDate": "2014-03-25",
"completionDate": "2014-03-29",
"challengeMemberCost": 0,
"challengeFee": 6001,
"challengeTotalCost": 6001,
"challengeDuration": 4.3,
"lastModificationDate": "2014-03-29",
"registrationEndDate": "2014-03-27",
"submissionEndDate": "2014-03-30",
"checkpointEndDate": "2014-03-28",
"currentPhase": "Submission",
"firstPrize": 1000,
"totalPrize": 1088,
"checkpointPrize": 88,
"registrantsCount": 3,
"submissionsCount": 0,
"checkpointSubmissionsCount": 3,
"challengeScheduledEndDate": "2014-04-10",
"reliability": 227
}
]
}
+ Response 400 (application/json)
{
"name":"Bad Request",
"value":"400",
"description":"This message will explain why the request is invalid or cannot be served."
}
+ Response 403 (application/json)
{
"name":"Forbidden",
"value":"403",
"description":"The request is understood, but it has been refused or access is not allowed."
}
+ Response 404 (application/json)
{
"name":"Not Found",
"value":"404",
"description":"Client not found"
}
+ Response 500 (application/json)
{
"name":"Internal Server Error",
"value":"500",
"description":"Unknown server error. Please contact support."
}
+ Response 503 (application/json)
{
"name":"Service Unavailable",
"value":"503",
"description":"Servers are up but overloaded. Try again later."
}
## Challenge Analyze [/reports/analyze?projectId={projectId}&openRegistrationDateFrom={openRegistrationDateFrom}&openRegistrationDateTo={openRegistrationDateTo}&challengeType={challengeType}&challengeName={challengeName}&prizeLower={prizeLower}&prizeUpper={prizeUpper}]
### Challenge Analyze [GET]
+ Parameters
+ projectId (optional, string, `1245`) ... The project id.
+ openRegistrationDateFrom (optional, string, `2014-04-01`) ... The open registration date from.
+ openRegistrationDateTo (optional, string, `2014-04-05`) ... The open registration date to.
+ challengeType (optional, string, `Wireframes`) ... The challenge type.
+ challengeName (optional, string, `TC-API`) ... The challenge name.
+ prizeLower (optional, number, `500`) ... The prize lower bound
+ prizeUpper (optional, number, `1800`) ... The prize upper bound.
+ Response 200 (application/json)
{
"results":
[
{
"challengeName": "TC-API Analzye API",
"projectName": "TC-API",
"challengeType": "Assembly",
"client": "Topcoder",
"copilot": "iRabbit",
"csm": [
"nlouie"
]
"architect": "none",
"pm": [
"nlouie",
"Shannon"
]
"challengeStatus": "Active",
"currentPhase": "Registration",
"numberOfRegistrants": 15,
"numberOfUnregistered": 5,
"estimatedNumberOfSubmissions": 3,
"currentNumberOfSubmissions": 1,
"openRegistrationDate": "2014-04-01",
"forumPosts": "11/25",
"numberOfUnansweredThread": 3,
"1stPlacePrize": "1600/1400.0",
"2ndPlacePrize": "750/800.0",
"numberOfDaysLive": "13.5/0.5",
"rating": "3/5/10",
"numberOfRepost": 0
}
]
}
+ Response 400 (application/json)
{
"name":"Bad Request",
"value":"400",
"description":"openRegistrationDateFrom is not a valid date."
}
+ Response 401 (application/json)
{
"name":"Unauthorized",
"value":"401",
"description":"Authorized information needed."
}
+ Response 403 (application/json)
{
"name":"Forbidden",
"value":"403",
"description":"You don't have access to this api."
}
+ Response 500 (application/json)
{
"name":"Internal Server Error",
"value":"500",
"description":"Unknown server error. Please contact support."
}
+ Response 503 (application/json)
{
"name":"Service Unavailable",
"value":"503",
"description":"Servers are up but overloaded. Try again later."
}
## Track Statistics [/reports/{track}?startDate={startDate}&endDate={endDate}]
### Track Statistics [GET]
+ Parameters
+ track (required, string, `design`) ... Track Name. Only allow "Design", "Develop" and "Data"
+ startDate (optional, string, `2013-01-01`) ... timespan start date
+ endDate (optional, string, `2014-01-01`) ... timespan end date
+ Response 200 (application/json)
{
"numberOfRunningChallenges": 10,
"totalPrizeOfRunningChallenges": 13500,
"totalPrizeInGivenTime": 120000,
"numberOfChallengesInGivenTime": 100,
"numberOfRegisteredUsers": 90,
"numberOfActiveUsers": 50
}
+ Response 400 (application/json)
{
"name":"Bad Request",
"value":"400",
"description":"startDate is not a valid date."
}
+ Response 400 (application/json)
{
"name":"Bad Request",
"value":"400",
"description":"endDate is not a valid date."
}
+ Response 400 (application/json)
{
"name":"Bad Request",
"value":"400",
"description":"startDate should be earlier than endDate or at same date."
}
+ Response 400 (application/json)
{
"name":"Bad Request",
"value":"400",
"description":"track should be an element of develop,design,data."
}
+ Response 500 (application/json)
{
"name":"Internal Server Error",
"value":"500",
"description":"Unknown server error. Please contact support."
}
+ Response 503 (application/json)
{
"name":"Service Unavailable",
"value":"503",
"description":"Servers are up but overloaded. Try again later."
}
# Group Platform
Platform APIs
## Activity Summary [/platform/activitySummary]
### Get Activity Summary [GET]
+ Response 200 (application/json)
{
"activeContestsCount": 50,
"activeMembersCount": 500000,
"activeProjectsCount": 30,
"completedProjectsCount": 500,
"prizePurse": "$100000"
}
## Active Billing Accounts [/platform/activeBillingAccounts]
### Active Billing Accounts [GET]
+ Response 200 (application/json)
{
"activeBillingAccounts": [
{
"clientName": "client1",
"clientCustomerNumber": "customer1",
"clientId": 70014096,
"billingAccountId": 70016343,
"billingAccountName": "Liquid",
"subscriptionNumber": "s",
"projectStartDate": "2009-01-01T00:00:00.000Z",
"projectEndDate": "2099-01-01T00:00:00.000Z",
"poNumber": "TC0000377"
},
{
""clientName": "client2",
"clientCustomerNumber": "customer2",
"clientId": 70014096,
"billingAccountId": 70016347,
"billingAccountName": "CIO projects",
"subscriptionNumber": "d",
"projectStartDate": "2009-01-01T00:00:00.000Z",
"projectEndDate": "2099-01-01T00:00:00.000Z",
"poNumber": "TC0000381"
}
]
}
## Customer [/platform/customer]
### Create Customer [POST]
+ Parameters
+ name (required, string, `custABCD`) ... The customer name
+ customerNumber (required, string, `custABCDNum`) ... The customer number
+ Response 200 (application/json)
{
"clientId": "1000021"
}
+ Response 400 (application/json)
{
"name":"Bad Request",
"value":"400",
"description":"This message will explain why the request is invalid or cannot be served."
}
+ Response 401 (application/json)
{
"name":"Unauthorized",
"value":"401",
"description":"Authentication credentials were missing or incorrect."
}
+ Response 403 (application/json)
{
"name":"Forbidden",
"value":"403",
"description":"The request is understood, but it has been refused or access is not allowed."
}
+ Response 500 (application/json)
{
"name":"Internal Server Error",
"value":"500",
"description":"Unknown server error. Please contact support."
}
+ Response 503 (application/json)
{
"name":"Service Unavailable",
"value":"503",
"description":"Servers are up but overloaded. Try again later."
}
## Billing [/platform/billing]
### Create Billing [POST]
+ Parameters
+ subscriptionNumber (required, string, `snABCD`) ... The subscription number of the project to create
+ customerNumber (required, string, `cnDEFG`) ... The customer number of the client with which to associate the project
+ startDate (optional, string, `cnDEFG`) ... The billing account start date
+ endDate (optional, string, `cnDEFG`) ... The billing account end date
+ billingAccountId (optional, number, `1234`) ... The billing account id
+ active (optional, number, `1`) ... billing account active status (1 - active, 0 - inactive)
+ Response 200 (application/json)
{
"billingAccountId": "1000021"
}
+ Response 400 (application/json)
{
"name":"Bad Request",
"value":"400",
"description":"This message will explain why the request is invalid or cannot be served."
}
+ Response 401 (application/json)
{
"name":"Unauthorized",
"value":"401",
"description":"Authentication credentials were missing or incorrect."
}
+ Response 403 (application/json)
{
"name":"Forbidden",
"value":"403",
"description":"The request is understood, but it has been refused or access is not allowed."
}
+ Response 500 (application/json)
{
"name":"Internal Server Error",
"value":"500",
"description":"Unknown server error. Please contact support."
}
+ Response 503 (application/json)
{
"name":"Service Unavailable",
"value":"503",
"description":"Servers are up but overloaded. Try again later."
}
## Billing Account Permission [/platform/billings/{billingAccountId}/users]
### Update Billing Account Permission [POST]
+ Request (application/json)
+ Headers
Authorization : Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZHwxMzI0NTYiLCJleHAiOjEzOTI4MTc4ODQsImF1ZCI6InRvcGNvZGVyIiwiaWF0IjoxMzkyNzU3ODg0fQ.7X2IKkiyyI1ExSM5GNpdhJ8fGGK5-oAjzccX6YL_BKY
[users]["users1,users2"]
+ Parameters
+ billingAccountId (required, number, `300001`) ... The billing account id that account to update
+ users (required, string, `heffan,shannon`) ... The users to attach to billing account
+ Response 200 (application/json)
{
"success": [
"twight"
],
"failed": [
"noOne"
]
}
+ Response 400 (application/json)
{
"name":"Bad Request",
"value":"400",
"description":"billingAccountId should be number."
}
+ Response 400 (application/json)
{
"name":"Bad Request",
"value":"400",
"description":"billingAccountId should be positive."
}
+ Response 400 (application/json)
{
"name":"Bad Request",
"value":"400",
"description":"billingAccountId should be Integer."
}
+ Response 400 (application/json)
{
"name":"Bad Request",
"value":"400",
"description":"billingAccountId should be less or equal to 2147483647."
}
+ Response 400 (application/json)
{
"name":"Bad Request",
"value":"400",
"description":"The billingAccountId is not exist in Topcoder system."
}
+ Response 400 (application/json)
{
"name":"Bad Request",
"value":"400",
"description":"All these users are not in topcoder system."
}
+ Response 401 (application/json)
{
"name":"Unauthorized",
"value":"401",
"description":"You need to login for this api."
}
+ Response 403 (application/json)
{
"name":"Forbidden",
"value":"403",
"description":"You don't have enough authority to access this api."
}
+ Response 500 (application/json)
{
"name":"Internal Server Error",
"value":"500",
"description":"Unknown server error. Please contact support."
}
+ Response 503 (application/json)
{
"name":"Service Unavailable",
"value":"503",
"description":"Servers are up but overloaded. Try again later."
}
## Leaderboard [/platform/leaderboard]
### Get Leaderboard [GET]
+ Parameters
+ type (required, string, `referral`) ... The leaderboard type
+ utmMedium (optional, string, `""`, `Appirio`, `__ALL__`) ... The referral type
+ Response 200 (application/json)
{
"entries": 9,
"description": "The leaderbaord returns all members that have referred at least one new member in the last 6 months.",
"scoreType": "points",
"scoreLabel": "referrals",
"result": [
{
"handle": "Referral9",
"score": 9,
"photo": "http://community.topcoder.com/i/m/Image9.jpg",
"memberSince": "2014-07-21T00:57:05.000+0200",
"country": "United States",
"ratingType": "Red"
},
{
"handle": "Referral8",
"score": 8,
"photo": "http://community.topcoder.com/i/m/Image8.jpg",
"memberSince": "2014-07-21T00:57:05.000+0200",
"country": "United Kingdom",
"ratingType": "Yellow"
},
{
"handle": "Referral6",
"score": 6,
"photo": "http://community.topcoder.com/i/m/Image6.jpg",
"memberSince": "2014-07-21T00:57:05.000+0200",
"country": "United States Minor Outlying Islands",
"ratingType": "Yellow"
},
{
"handle": "Referral2",
"score": 1,
"memberSince": "2014-07-21T00:57:05.000+0200",
"country": "United Kingdom",
"ratingType": "Black"
},
{
"handle": "Referral7",
"score": 7,
"photo": "http://community.topcoder.com/i/m/Image7.jpg",
"memberSince": "2014-07-21T00:57:05.000+0200",
"country": "United States",
"ratingType": "Red"
},
{
"handle": "Referral10",
"score": 10,
"photo": "http://community.topcoder.com/i/m/Image10.jpg",
"memberSince": "2014-07-21T00:57:05.000+0200",
"country": "United Arab Emirates",
"ratingType": "Red"
},
{
"handle": "Referral5",
"score": 5,
"photo": "http://community.topcoder.com/i/m/Image5.jpg",
"memberSince": "2014-07-21T00:57:05.000+0200",
"country": "United States",
"ratingType": "Red"
},
{
"handle": "Referral4",
"score": 4,
"photo": "http://community.topcoder.com/i/m/Image4.jpg",
"memberSince": "2014-07-21T00:57:05.000+0200",
"country": "United Arab Emirates",
"ratingType": "Yellow"
},
{
"handle": "Referral3",
"score": 2,
"memberSince": "2014-07-21T00:57:05.000+0200",
"country": "United States",
"ratingType": "Red"
}
]
}
+ Response 200 (application/json)
{
"error": "Error: type is a required parameter for this action"
}
+ Response 400 (application/json)
{
"error": {
"name": "Bad Request",
"value": 400,
"description": "The request was invalid. An accompanying message will explain why.",
"details": "type should be an element of referral."
}
}
+ Response 400 (application/json)
{
"error": {
"name": "Bad Request",
"value": 400,
"description": "The request was invalid. An accompanying message will explain why.",
"details": "utmMedium should be an element of __all__,appirio."
}
}
+ Response 500 (application/json)
{
"name":"Internal Server Error",
"value":"500",
"description":"Unknown server error. Please contact support."
}
+ Response 503 (application/json)
{
"name":"Service Unavailable",
"value":"503",
"description":"Servers are up but overloaded. Try again later."
}
## Get Challenge Detail [/challenges/{challengeId}]
### Get Challenge Detail [GET]
+ Parameters
+ challengeId (required, number, `30000000`) ... The challenge id.
+ Response 200 (application/json)
{
"challengeType": "Assembly Competition",
"type": "develop",
"challengeName": "Module Assembly - TopCoder NodeJS API Tests Improvement and Normalization",
"challengeId": 30036437,
"projectId": 6757,
"forumId": "19553",
"detailedRequirements": "<h2 style=\"font-family: Arial, Helvetica, Verdana, sans-serif; padding: 0px; margin: 0px; font-weight: bold;\"><span style=\"color: rgb(255, 0, 0);\">Project Overview</span></h2>\n\n<p>TopCoder and the TopCoder community have worked hard to get the platform to its currently level of maturity, but we're far from done. It's time to take the platform to the next level. TopCoder is going to start taking some steps to open up the platform API to the outside and community developers so they could incorporate it in their websites, applications or build their own applications (web, mobile or desktop).</p>\n\n<p>The ultimate goal is to open up and build an "API" that is targeting all different type of audiences - Software and Studio Competitors, SRM/MM competitors, Copilots, Admins and TopCoder partners - each audience will have different interests and usages of the API, so it will be a huge project and we need to make sure that we are in the right direction from the beginning.</p>\n\n<p>Currently, we have run several contests to build the APIs and write tests for testing the APIs. All the tests can be found at https://github.com/cloudspokes/tc-api/tree/master/test</p>\n\n<p>Through these contests, we have found several problems for the tests part as following</p>\n\n<ol>\n\t<li>The tests are not properly named, we'd like to follow the way like 'test.[api name].js', like <span class=\"css-truncate css-truncate-target\"><a class=\"js-directory-link\" href=\"https://github.com/cloudspokes/tc-api/blob/master/test/register_member.js\" id=\"72636476fe496c69e8cc1d0569ffd550-ab6d2363c6933e23ee66bb7b92f4d07841ea286b\" title=\"register_member.js\">register_member.js</a> should be renamed to <u>test.register_member.js</u>.</span></li>\n\t<li>Some of the tests have to presetup the database manually, Some of the tests automically setup and clear the related database tables wisely.</li>\n\t<li>The tests can be passed if run separately, but failed when running togather.</li>\n</ol>\n\n<p>For this contest, we'd like to improve and standarize the way to write tests, so it will be good for further addon and CI integration.</p>\n\n<h2 style=\"font-family: Arial, Helvetica, Verdana, sans-serif; padding: 0px; margin: 0px; font-weight: bold;\"><span style=\"color: rgb(255, 0, 0);\">Competition Task Overview</span></h2>\n\n<p><span style=\"color:#FF0000;\"><span style=\"font-size: 12px;\"><img align=\"absmiddle\" alt=\"\" border=\"0\" height=\"16\" src=\"http://apps.topcoder.com/wiki/images/icons/emoticons/warning.gif\" width=\"16\" /> <strong>Please raise questions as quick as you can, I am familiar with related database and code base, I can provide as much support as I can.</strong></span></span></p>\n\n<p><span style=\"color:#FF0000;\"><span style=\"font-size: 12px;\"><img align=\"absmiddle\" alt=\"\" border=\"0\" height=\"16\" src=\"http://apps.topcoder.com/wiki/images/icons/emoticons/warning.gif\" width=\"16\" /></span><strong>The updated code must still deploy and work on heroku - any submission which can't be deployed on heroku successfully will be failed in screening phase - primary reviewer must check this.</strong></span></p>\n\n<p>The implementation will base on the node.js version of TC platform API - <span class=\"nobr\"><a href=\"https://github.com/cloudspokes/tc-api\" rel=\"nofollow\">https://github.com/cloudspokes/tc-api</a>.</span> <strong>Please follow the existing actionhero pattern for your development.</strong></p>\n\n<h3 style=\"font-family: Arial, Helvetica, Verdana, sans-serif; padding: 0px; margin: 0px; font-weight: bold;\"><span style=\"color: rgb(255, 0, 0);\">Clean State for Running Tests</span></h3>\n\n<p>Currently, some tests requires presetup the database, some tests automically setup and clear the related database tables.</p>\n\n<p>We'd like to follow the approach to setup and clear the related database tables before and after running the tests.</p>\n\n<p>Currently, <span class=\"css-truncate css-truncate-target\"><a class=\"js-directory-link\" href=\"https://github.com/cloudspokes/tc-api/blob/master/test/register_member.js\" id=\"72636476fe496c69e8cc1d0569ffd550-ab6d2363c6933e23ee66bb7b92f4d07841ea286b\" title=\"register_member.js\">register_member.js</a> used similar approach to setup the data before running tests. We'd like to extra similar logic as utility methods, which can be used to execute a batch of sqls (for example, inside one file) or single sql against one database (Currently we can not do with multiple databases, due to the limitation of nodejs informix module).</span></p>\n\n<p>With this utility methods we can easily do setup and teardown databases.</p>\n\n<p><u>before, after, before each, after each hooks</u></p>\n\n<p>Utilize <code>before()</code>, <code>after()</code>, <code>beforeEach()</code>, <code>afterEach()</code> to setup the tests more wise. For detail information, please check http://visionmedia.github.io/mocha/</p>\n\n<h3 style=\"font-family: Arial, Helvetica, Verdana, sans-serif; padding: 0px; margin: 0px; font-weight: bold;\"><span style=\"color: rgb(255, 0, 0);\">Test Directory Restructure and Normalization</span></h3>\n\n<p>We'd like to normalize the directory structure inside <a href=\"https://github.com/cloudspokes/tc-api/blob/master/test\">test</a> directory. Currently, it already gives good starting point, but we'd like revise it as we are making the above changes. Here is the general rules to following</p>\n\n<ol>\n\t<li>All tests should be named like test.[api name].js, so normally, for each api, there should be separated test js files.</li>\n\t<li>All tests from contest winner, should be put directly under test directory.</li>\n\t<li>All reviewers tests should be put under corresponding directory under test directory, like <span class=\"css-truncate css-truncate-target\"><a class=\"js-directory-link\" href=\"https://github.com/cloudspokes/tc-api/tree/master/test/accuracy\" id=\"5d6db9a1dc722586187fc2db530f8388-a107215d06565a781a851de5573da8b935851c3f\" title=\"accuracy\">accuracy</a>, <a class=\"js-directory-link\" href=\"https://github.com/cloudspokes/tc-api/tree/master/test/failure\" id=\"3ee28fe1a60c95b89d29317f122c7021-420d711966add1044306cfaba7036b73d50f95e2\" title=\"failure\">failure</a>, <a class=\"js-directory-link\" href=\"https://github.com/cloudspokes/tc-api/tree/master/test/security\" id=\"e91e6348157868de9dd8b25c81aebfb9-8d796d458ceb76eb46407f9164ed17343d529bf6\" title=\"security\">security</a></span> directory.</li>\n\t<li>All sql files used for tests presetup and teardown should be put under <u>sqls</u> directory, sqls files for accuray, failture, security tests, will be in different directory, directly under the <span class=\"css-truncate css-truncate-target\"><a class=\"js-directory-link\" href=\"https://github.com/cloudspokes/tc-api/tree/master/test/accuracy\" id=\"5d6db9a1dc722586187fc2db530f8388-a107215d06565a781a851de5573da8b935851c3f\" title=\"accuracy\">accuracy</a>, <a class=\"js-directory-link\" href=\"https://github.com/cloudspokes/tc-api/tree/master/test/failure\" id=\"3ee28fe1a60c95b89d29317f122c7021-420d711966add1044306cfaba7036b73d50f95e2\" title=\"failure\">failure</a>, <a class=\"js-directory-link\" href=\"https://github.com/cloudspokes/tc-api/tree/master/test/security\" id=\"e91e6348157868de9dd8b25c81aebfb9-8d796d458ceb76eb46407f9164ed17343d529bf6\" title=\"security\">security</a></span> directory, like accuracy/sqls, failure/sqls etc.</li>\n\t<li>All other test related files will be still put under <u>test_files</u> directory.</li>\n</ol>\n\n<p><span style=\"color:#FF0000;\">If you have better idea and improvement to make the test directory well orginized, please suggest. This can be considered as improvement, reviewers and PMs will consider that.</span></p>\n\n<h3 style=\"font-family: Arial, Helvetica, Verdana, sans-serif; padding: 0px; margin: 0px; font-weight: bold;\"><span style=\"color: rgb(255, 0, 0);\">Scope </span></h3>\n\n<p>All tests under test directory are in scope. If it tests didn't pass orignally, you should be responsible to fix that.</p>\n\n<p>The ultimate goal is we can run all tests or single test successfully. like</p>\n\n<p>Run a single test: <u>./node_modules/.bin/mocha ./test/test.tops.js</u></p>\n\n<p>Run all tests: <u>./node_modules/.bin/mocha ./test</u></p>\n\n<p>Following steps to run the tests.</p>\n\n<ol>\n\t<li>setup environment varibales: . deploy/development.sh</li>\n\t<li>start the local server: npm start</li>\n\t<li>run the tests: as above commands.</li>\n</ol>\n\n<h3 style=\"font-family: Arial, Helvetica, Verdana, sans-serif; padding: 0px; margin: 0px; font-weight: bold;\"><span style=\"color: rgb(255, 0, 0);\">Tests Creation Guide</span></h3>\n\n<p>Beside the above requirements for current tests normalization and improvement, we'd like you to write a general guide which can be followed to further test creation. It just need to be easy to follow.</p>\n\n<h3 style=\"font-family: Arial, Helvetica, Verdana, sans-serif; padding: 0px; margin: 0px; font-weight: bold;\"><span style=\"color: rgb(255, 0, 0);\">Testing</span></h3>\n\n<p><span style=\"font-size:12px;\">The API Framework supports tests. </span>Use <a href=\"https://github.com/visionmedia/supertest\">supertest</a> with <a href=\"http://visionmedia.github.io/mocha/\">mocha</a>. Don't install mocha globally.</p>\n\n<p><span style=\"color:#FF0000;\">you must use mocha BDD style (which is the default), within that, you can optionally use chai.</span></p>\n\n<h3 style=\"font-family: Arial, Helvetica, Verdana, sans-serif; padding: 0px; margin: 0px; font-weight: bold;\"><span style=\"color: rgb(255, 0, 0);\">Code Format</span></h3>\n\n<p>All code must pass <a href=\"http://www.jslint.com/\">jslint</a>. You may use "nomen: true".</p>\n\n<h3 style=\"font-family: Arial, Helvetica, Verdana, sans-serif; padding: 0px; margin: 0px; font-weight: bold;\"><span style=\"color: rgb(255, 0, 0);\">Winner Only</span></h3>\n\n<p>Winner will create pull request against the main github repo in final fix phase and merge the code.</p>\n\n<h3 style=\"font-family: Arial, Helvetica, Verdana, sans-serif; padding: 0px; margin: 0px; font-weight: bold;\"><span style=\"color:#FF0000;\">Virutal Machines (VMs)</span></h3>\n\n<p>VM specific information is found here: <span class=\"nobr\"><a href=\"http://www.topcoder.com/wiki/display/docs/VM+Image+2.5\" rel=\"nofollow\">http://www.topcoder.com/wiki/display/docs/VM+Image+2.5</a></span></p>\n\n<p>Upon registration as a submitter or reviewer you will need to request a VM based on the TopCoder systems image. The VM will be active through aggregation review, after which it will be terminated except for the winner's and the reviewers'. To request your image, please post in contest forum.</p>\n\n<p>Before requesting your VM, you need to ensure that you have an SSH key created and in your member profile. Instructions to do so are here: <span class=\"nobr\"><a href=\"http://www.topcoder.com/wiki/display/projects/Generate+SSH+Key\" rel=\"nofollow\">http://www.topcoder.com/wiki/display/projects/Generate+SSH+Key</a></span>, and instructions to connect afterwards are here: <span class=\"nobr\"><a href=\"http://www.topcoder.com/wiki/display/projects/Connect+Using+SSH+Key\" rel=\"nofollow\">http://www.topcoder.com/wiki/display/projects/Connect+Using+SSH+Key</a></span>.</p>\n\n<p>Please realize that VMs are currently issued manually. We make every attempt to issue the VM as soon as it is requested, however, there may be delays of up to 12 hours depending on time of day when you request. We encourage everyone to request a VM as soon as possible to minimize any such delays.</p>\n\n<h2 style=\"font-family: Arial, Helvetica, Verdana, sans-serif; padding: 0px; margin: 0px; font-weight: bold;\"><span style=\"color: rgb(255, 0, 0);\">Technology Overview</span></h2>\n\n<ul style=\"font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 12px; line-height: 16px;\">\n\t<li>JavaScript</li>\n\t<li><span class=\"nobr\"><a href=\"http://nodejs.org/\" rel=\"nofollow\">Node.js 0.10.x</a></span></li>\n\t<li><a href=\"https://github.com/evantahler/actionHero\">actionhero.js framework</a></li>\n\t<li><a href=\"https://github.com/visionmedia/supertest\">supertest</a></li>\n\t<li><a href=\"http://visionmedia.github.io/mocha/\">mocha</a></li>\n</ul>\n\n<h2 style=\"font-family: Arial, Helvetica, Verdana, sans-serif; padding: 0px; margin: 0px; font-weight: bold;\"><span style=\"color: rgb(255, 0, 0);\">Documentation Provided</span></h2>\n\n<p>Please check the deployment guide in codebase for reference.</p>\n",
"finalSubmissionGuidelines": "<p><strong><span style=\"color:#FF0000;\"><span style=\"line-height: 1.6em;\">Submission Deliverables</span></span></strong></p>\n\n<p><span style=\"font-size:12px;\">A complete list of deliverables can be viewed in the TopCoder Assembly competition Tutorial at: </span><a href=\"http://apps.topcoder.com/wiki/display/tc/Assembly+Competition+Tutorials\">http://apps.topcoder.com/wiki/display/tc/Assembly+Competition+Tutorials</a></p>\n\n<p><span style=\"font-size:12px;\">Below is an overview of the deliverables:</span></p>\n\n<ul>\n\t<li>Source Code.</li>\n\t<li>Deployment guide to configure and verify the application.</li>\n\t<li>General Test Creation Guide</li>\n</ul>\n\n<p><strong><span style=\"color:#FF0000;\"><span style=\"line-height: 1.6em;\">Final Submission </span></span></strong></p>\n\n<p><span style=\"font-size:12px;\">For each member, the final submission should be uploaded to the Online Review Tool.</span></p>\n",
"screeningScorecardId": "30000412",
"reviewScorecardId": "30001470",
"cmcTaskId": "",
"numberOfCheckpointsPrizes": 0,
"topCheckPointPrize": "",
"postingDate": "2013-12-02T09:00:05.000Z",
"registrationEndDate": "2013-12-04T09:00:21.000Z",
"checkpointSubmissionEndDate": "-000001-11-30T00:00:00.000Z",
"submissionEndDate": "2013-12-06T21:20:56.000Z",
"appealsEndDate": "2013-12-09T07:05:33.000Z",
"finalFixEndDate": "2013-12-10T08:33:19.000Z",
"digitalRunPoints": 360,
"reliabilityBonus": 160,
"challengeCommunity": "develop",
"directUrl": "https://www.topcoder.com/direct/contest/detail.action?projectId=30036437",
"technology": [