diff --git a/actions/terms.js b/actions/terms.js index 0baeb0efb..704d307a4 100755 --- a/actions/terms.js +++ b/actions/terms.js @@ -1,11 +1,14 @@ /* * Copyright (C) 2014 TopCoder Inc., All Rights Reserved. * - * @version 1.1 - * @author hesibo, snowone + * @version 1.2 + * @author TCSCODER, hesibo, snowone * * changes in 1.1: * add support for docusign template id for terms of use details api + * + * changes in 1.2: + * add the new "getTermsForUser" action */ "use strict"; @@ -105,6 +108,86 @@ var getTermsOfUse = function (api, connection, dbConnectionMap, next) { }); }; +/** + * Gets the terms details of the given list + * and the terms agreement status for the given user + * + * @param {Object} api The api object that is used to access the global infrastructure + * @param {Object} connection The connection object for the current request + * @param {Object} dbConnectionMap The database connection map for the current request + * @param {Function} next The callback to be called after this function is done + */ +var getTermsForUser = function (api, connection, dbConnectionMap, next) { + var helper = api.helper, + sqlParams = {}; + + async.waterfall([ + // Check if the user is logged in + function (cb) { + if (connection.caller.accessLevel === "anon") { + cb(new UnauthorizedError("Authentication credential was missing.")); + } else { + cb(); + } + }, + // Check the userId parameter + function (cb) { + var error = helper.checkIdParameter(connection.params.userId, "User ID"); + cb(error || null); + }, + // Check if the user has a right to get this information + function (cb) { + sqlParams.userId = connection.params.userId; + if (connection.caller.accessLevel !== "admin" + && Number(connection.caller.userId) !== Number(sqlParams.userId)) { + cb(new ForbiddenError("This user cannot get these data of other users")); + } else { + cb(); + } + }, + // Check terms of use Ids + function (cb) { + sqlParams.termsIds = connection.params.termsOfUseIds.split(","); + async.each(sqlParams.termsIds, function (termsId, cb) { + var error = helper.checkIdParameter(termsId, "Each Terms Of Use ID"); + cb(error || null); + }, cb); + }, + // Run query + function (cb) { + api.dataAccess.executeQuery("get_terms_for_user", sqlParams, dbConnectionMap, cb); + }, + // Prepare and submit the result + function (rows, cb) { + var columnMap = { + "type": "terms_type", + "agreeabilityType": "agreeability_type", + "agreed": "agreed", + "text": "terms_text", + "title": "title", + "termsOfUseId": "terms_of_use_id", + "url": "url" + }; + + _.each(rows, function (row) { + _.each(columnMap, function (field, property) { + var tmp = row[field]; + delete row[field]; + row[property] = tmp; + }); + }); + cb(null, rows); + } + ], function (err, result) { + if (err) { + helper.handleError(api, connection, err); + } else { + connection.response = { terms: result }; + } + next(connection, true); + }); +}; + /** * This function gets the challenge results for both develop (software) and design (studio) contests. * @@ -228,6 +311,33 @@ exports.getTermsOfUse = { } }; +/** + * The API for getting the terms details of the given list + * and the terms agreement status for the given user + */ +exports.getTermsForUser = { + name: "getTermsForUser", + description: "Get the terms details of the given list " + + "and the terms agreement status for the given user", + inputs: { + required: ["termsOfUseIds", "userId"], + optional: [] + }, + blockedConnectionTypes: [], + outputExample: {}, + version: "v2", + transaction: "read", + databases: ["common_oltp"], + run: function (api, connection, next) { + if (connection.dbConnectionMap) { + api.log("Execute getTermsForUser#run", 'debug'); + getTermsForUser(api, connection, connection.dbConnectionMap, next); + } else { + api.helper.handleNoConnection(api, connection, next); + } + } +}; + /** * The API for agree terms of use. It is transactional. */ diff --git a/apiary.apib b/apiary.apib index f7dd6dcd6..7377b1f30 100644 --- a/apiary.apib +++ b/apiary.apib @@ -9,9 +9,11 @@ Authorization APIs ## Create JWT Token [/auth] ### Create JWT Token [POST] -+ Parameters - + username (required, string, `heffan`) ... The username - + password (required, string, `password`) ... The password ++ Attributes + + username: `heffan` (required, string) ... The username + + password: `password` (required, string) ... The password + ++ Request Create JWT Token (application/json) + Response 200 (application/json) @@ -53,8 +55,10 @@ Authorization APIs ## Refresh JWT Token [/reauth] ### Refresh JWT Token [POST] -+ Parameters - + token (required, string, `eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3NtYS5hdXRoMC5jb20vIiwic3ViIjoiYWR8`) ... The old JWT token ++ Attributes + + token: `eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3NtYS5hdXRoMC5jb20vIiwic3ViIjoiYWR8` (required, string) ... The old JWT token + ++ Request Refresh JWT Token (application/json) + Response 200 (application/json) @@ -96,8 +100,12 @@ Authorization APIs ## Validate SSO Cookie [/validation/sso] ### Validate SSO Cookie [GET] -+ Parameters - + Cookie (required, string, `tcsso=132456|4a6acc4d5327773989a7e8c23b04e8cd1c3da79a1256590973ed731ffa0f24a2`) ... The sso cookie + ++ Request + + + Headers + + Cookie: tcsso=132456|4a6acc4d5327773989a7e8c23b04e8cd1c3da79a1256590973ed731ffa0f24a2 + Response 200 (application/json) @@ -132,7 +140,7 @@ Authorization APIs # Group Reports Report APIs -## Challenge Costs [/reports/costs/{startDate}/{endDate}?clientid={clientId}&billingId={billingId}&projectId={projectId}&challengeId={challengeId}] +## Challenge Costs [/reports/costs/{startDate}/{endDate}{?clientId}{?billingId}{?projectId}{?challengeId}] ### Challenge Costs [GET] + Parameters @@ -213,7 +221,7 @@ Report APIs "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 [/reports/client/costs/{?startDate}{?endDate}{?clientId}{?sfdcAccountId}{?customerNumber}] ### Client Challenge Costs [GET] + Parameters @@ -297,7 +305,7 @@ Report APIs "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 [/reports/client/activeCosts/{?clientId}{?sfdcAccountId}{?customerNumber}] ### Client Active Challenge Costs [GET] + Parameters @@ -307,72 +315,73 @@ Report APIs + 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 - } - ] -} + { + "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) { @@ -413,7 +422,7 @@ Report APIs "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 [/reports/analyze{?projectId}{?openRegistrationDateFrom}{?openRegistrationDateTo}{?challengeType}{?challengeName}{?prizeLower}{?prizeUpper}] ### Challenge Analyze [GET] + Parameters @@ -502,7 +511,7 @@ Report APIs "description":"Servers are up but overloaded. Try again later." } -## Track Statistics [/reports/{track}?startDate={startDate}&endDate={endDate}] +## Track Statistics [/reports/{track}{?startDate}{?endDate}] ### Track Statistics [GET] + Parameters @@ -604,7 +613,7 @@ Platform APIs "poNumber": "TC0000377" }, { - ""clientName": "client2", + "clientName": "client2", "clientCustomerNumber": "customer2", "clientId": 70014096, "billingAccountId": 70016347, @@ -619,9 +628,11 @@ Platform APIs ## Customer [/platform/customer] ### Create Customer [POST] -+ Parameters - + name (required, string, `custABCD`) ... The customer name - + customerNumber (required, string, `custABCDNum`) ... The customer number ++ Attributes + + name: `custABCD` (required, string) ... The customer name + + customerNumber: `custABCDNum` (required, string) ... The customer number + ++ Request Create Customer (application/json) + Response 200 (application/json) @@ -673,13 +684,15 @@ Platform APIs ## 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) ++ Attributes + + subscriptionNumber: `snABCD` (required, string) ... The subscription number of the project to create + + customerNumber: `cnDEFG` (required, string) ... The customer number of the client with which to associate the project + + startDate: `cnDEFG` (optional, string) ... The billing account start date + + endDate: `cnDEFG` (optional, string) ... The billing account end date + + billingAccountId: `1234` (optional, number) ... The billing account id + + active: `1` (optional, number) ... billing account active status (1 - active, 0 - inactive) + ++ Request Create Billing (application/json) + Response 200 (application/json) @@ -727,7 +740,7 @@ Platform APIs "description":"Servers are up but overloaded. Try again later." } -## Billing Account Permission [/platform/billings/{billingAccountId}/users] +## Billing Account Permission [/platform/billings/{billingAccountId}/{users}] ### Update Billing Account Permission [POST] + Request (application/json) @@ -736,8 +749,6 @@ Platform APIs 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 @@ -835,90 +846,92 @@ Platform APIs ## 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" - } - ] -} ++ Attributes + + type: `referral` (required, string) ... The leaderboard type + + utmMedium: `Appirio` (optional, string) ... The referral type + ++ Request Get Leaderboard (application/json) + ++ 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) @@ -965,197 +978,6 @@ Platform APIs "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": "

Project Overview

\n\n

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).

\n\n

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.

\n\n

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

\n\n

Through these contests, we have found several problems for the tests part as following

\n\n
    \n\t
  1. The tests are not properly named, we'd like to follow the way like 'test.[api name].js', like register_member.js should be renamed to test.register_member.js.
  2. \n\t
  3. Some of the tests have to presetup the database manually, Some of the tests automically setup and clear the related database tables wisely.
  4. \n\t
  5. The tests can be passed if run separately, but failed when running togather.
  6. \n
\n\n

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.

\n\n

Competition Task Overview

\n\n

\"\" 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.

\n\n

\"\"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.

\n\n

The implementation will base on the node.js version of TC platform API - https://github.com/cloudspokes/tc-api. Please follow the existing actionhero pattern for your development.

\n\n

Clean State for Running Tests

\n\n

Currently, some tests requires presetup the database, some tests automically setup and clear the related database tables.

\n\n

We'd like to follow the approach to setup and clear the related database tables before and after running the tests.

\n\n

Currently, register_member.js 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).

\n\n

With this utility methods we can easily do setup and teardown databases.

\n\n

before, after, before each, after each hooks

\n\n

Utilize before(), after(), beforeEach(), afterEach()  to setup the tests more wise. For detail information, please check http://visionmedia.github.io/mocha/

\n\n

Test Directory Restructure and Normalization

\n\n

We'd like to normalize the directory structure inside test 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

\n\n
    \n\t
  1. All tests should be named like test.[api name].js, so normally, for each api, there should be separated test js files.
  2. \n\t
  3. All tests from contest winner, should be put directly under test directory.
  4. \n\t
  5. All reviewers tests should be put under corresponding directory under test directory, like accuracy, failure, security directory.
  6. \n\t
  7. All sql files used for tests presetup and teardown should be put under sqls directory, sqls files for accuray, failture, security tests, will be in different directory, directly under the accuracy, failure, security directory, like accuracy/sqls, failure/sqls etc.
  8. \n\t
  9. All other test related files will be still put under test_files directory.
  10. \n
\n\n

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.

\n\n

Scope

\n\n

All tests under test directory are in scope. If it tests didn't pass orignally, you should be responsible to fix that.

\n\n

The ultimate goal is we can run all tests or single test successfully. like

\n\n

Run a single test:  ./node_modules/.bin/mocha ./test/test.tops.js

\n\n

Run all tests: ./node_modules/.bin/mocha ./test

\n\n

Following steps  to run the tests.

\n\n
    \n\t
  1. setup environment varibales: . deploy/development.sh
  2. \n\t
  3. start the local server: npm start
  4. \n\t
  5. run the tests: as above commands.
  6. \n
\n\n

Tests Creation Guide

\n\n

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.

\n\n

Testing

\n\n

The API Framework supports tests. Use supertest with mocha. Don't install mocha globally.

\n\n

you must use mocha BDD style (which is the default), within that, you can optionally use chai.

\n\n

Code Format

\n\n

All code must pass jslint. You may use "nomen: true".

\n\n

Winner Only

\n\n

Winner will create pull request against the main github repo in final fix phase and merge the code.

\n\n

Virutal Machines (VMs)

\n\n

VM specific information is found here: http://www.topcoder.com/wiki/display/docs/VM+Image+2.5

\n\n

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.

\n\n

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: http://www.topcoder.com/wiki/display/projects/Generate+SSH+Key, and instructions to connect afterwards are here: http://www.topcoder.com/wiki/display/projects/Connect+Using+SSH+Key.

\n\n

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.

\n\n

Technology Overview

\n\n\n\n

Documentation Provided

\n\n

Please check the deployment guide in codebase for reference.

\n", - "finalSubmissionGuidelines": "

Submission Deliverables

\n\n

A complete list of deliverables can be viewed in the TopCoder Assembly competition Tutorial at: http://apps.topcoder.com/wiki/display/tc/Assembly+Competition+Tutorials

\n\n

Below is an overview of the deliverables:

\n\n\n\n

Final Submission

\n\n

For each member, the final submission should be uploaded to the Online Review Tool.

\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": [ - "Java", - "MySQL" - ], - "prize": [ - 800, - 400 - ], - "generalCheckpointFeedback": "This is general feedback from all competitors.", - "Documents": [ - { - "documentName": "document 1", - "url": "http://community.topcoder.com/tc?module=DownloadDocument&docid=30400000" - }, - { - "documentName": "document 2", - "url": "http://community.topcoder.com/tc?module=DownloadDocument&docid=30400001" - }, - { - "documentName": "document 3", - "url": "http://community.topcoder.com/tc?module=DownloadDocument&docid=30400002" - } - ], - "numberOfRegistrants": 18, - "numberOfSubmissions": 2, - "platforms": [ - "AWS", - "Cloud Foundry" - ], - "event": { - "id": 3437, - "description": "TCO" - } - } - -+ Response 200 (application/json) - - { - "challengeType": "First2Finish", - "type": "develop", - "challengeName": "this is a F2F challenge", - "challengeId": 30500000, - "projectId": 30400001, - "screeningScorecardId": "3", - "reviewScorecardId": "1", - "cmcTaskId": "ab", - "numberOfCheckpointsPrizes": 0, - "topCheckPointPrize": "", - "currentStatus": "Active", - "digitalRunPoints": 510, - "reliabilityBonus": 200, - "challengeCommunity": "develop", - "directUrl": "https://www.topcoder.com/direct/contest/detail.action?projectId=30500000", - "technology": ["Java", "MySQL"], - "prize": [ - 1000 - ], - "Documents": [ - { - "documentName": "document 1", - "url": "http://community.topcoder.com/tc?module=DownloadDocument&docid=30500000" - }, - { - "documentName": "document 2", - "url": "http://community.topcoder.com/tc?module=DownloadDocument&docid=30500001" - } - ], - "numberOfSubmissions": 1, - "numberOfRegistrants": 1, - "platforms": [ - "AWS", - "Cloud Foundry" - ], - "event": { - "id": 3437, - "description": "TCO" - } - } -+ Response 200 (application/json) - - { - "challengeType": "Copilot Posting", - "type": "develop", - "challengeName": "this is a Copilot post challenge", - "challengeId": 32500000, - "projectId": 30400001, - "detailedRequirements": "detailed requirement content", - "finalSubmissionGuidelines": "final submission guideline content", - "cmcTaskId": "ab", - "numberOfCheckpointsPrizes": 0, - "topCheckPointPrize": "", - "copilotDetailedRequirements": "copilot private_description_text", - "currentStatus": "Active", - "digitalRunPoints": 510, - "reliabilityBonus": 200, - "challengeCommunity": "develop", - "directUrl": "https://www.topcoder.com/direct/contest/detail.action?projectId=32500000", - "technology": ["Java", "MySQL"], - "prize": [ - 1000 - ], - "numberOfRegistrants": 1, - "Documents": [ - { - "documentName": "document 1", - "url": "http://community.topcoder.com/tc?module=DownloadDocument&docid=30500000" - }, - { - "documentName": "document 3", - "url": "http://community.topcoder.com/tc?module=DownloadDocument&docid=32500000" - }, - { - "documentName": "document 4", - "url": "http://community.topcoder.com/tc?module=DownloadDocument&docid=32500001" - }, - { - "documentName": "document 2", - "url": "http://community.topcoder.com/tc?module=DownloadDocument&docid=30500001" - } - ], - "numberOfSubmissions": 1, - "platforms": [ - "AWS", - "Cloud Foundry" - ] - } - -+ 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." - } - ## Get Challenge Registrants [/challenges/registrants/{challengeId}] ### Get Challenge Registrants [GET] @@ -1533,7 +1355,7 @@ Register a new user. } ### Create a new user [POST] -+ Request (application/json) ++ Request [Users][] @@ -1585,7 +1407,6 @@ Register a new user. "description":"Servers are up but overloaded. Try again later." } -### Create a new user via social login [POST] + Request (application/json) { @@ -2036,7 +1857,6 @@ Register a new user. "description":"Servers are up but overloaded. Try again later." } -## My Profile [/user/profile] ### My Profile [POST] + Request @@ -2141,7 +1961,7 @@ Register a new user. } -## Get User Develop Challenges [/user/{handle}/challenges/develop?pageIndex={pageIndex}&pageSize={pageSize}&sortColumn={sortColumn}&sortOrder={sortOrder}] +## Get User Develop Challenges [/user/{handle}/challenges/develop{?pageIndex}{?pageSize}{?sortColumn}{?sortOrder}] ### Get User Challenges [GET] + Parameters @@ -2221,7 +2041,7 @@ Register a new user. "description":"Servers are up but overloaded. Try again later." } -## Get User Design Challenges [/user/{handle}/challenges/design?pageIndex={pageIndex}&pageSize={pageSize}&sortColumn={sortColumn}&sortOrder={sortOrder}] +## Get User Design Challenges [/user/{handle}/challenges/design{?pageIndex}{?pageSize}{?sortColumn}{?sortOrder}] ### Get User Challenges [GET] + Parameters @@ -2303,7 +2123,7 @@ Register a new user. -## Search My Challenges [/user/challenges?type={type}&pageIndex={pageIndex}&pageSize={pageSize}&sortColumn={sortColumn}&sortOrder={sortOrder}&communityId={communityId}&submissionEndFrom={submissionEndFrom}&submissionEndTo={submissionEndTo}&challengeType={challengeType}&platforms={platforms}&technologies={technologies}&prizeLowerBound={prizeLowerBound}&prizeUpperBound={prizeUpperBound}] +## Search My Challenges [/user/challenges{?type}{?pageIndex}{?pageSize}{?sortColumn}{?sortOrder}{?communityId}{?submissionEndFrom}{?submissionEndTo}{?challengeType}{?platforms}{?technologies}{?prizeLowerBound}{?prizeUpperBound}] ### Search My Challenges [GET] + Parameters @@ -2315,7 +2135,7 @@ Register a new user. + communityId (optional, number, `1`) ... The community id. + submissionEndFrom (optional, string, `2014-03-01`) ... submission end date from value. + submissionEndTo (optional, string, `2014-03-15`) ... submission end date to value. - + challengeType (optional, string, `assembly') ... challenge type + + challengeType (optional, string, `assembly`) ... challenge type + platforms (optional, string, `google,heroku`) ... platforms filter + technologies (optional, string, `java,javascript`) ... technologies filter + prizeLowerBound (optional, number, `1000`) ... prize lowerbound @@ -2467,10 +2287,11 @@ Register a new user. ## get User Identity Information [/user/identity] ### Search My Challenges [GET] -Request ++ Request -+ Headers - Authorization : Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZHwxMzI0NTYiLCJleHAiOjEzOTM3MDM1NzEsImF1ZCI6 + + Headers + + Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZHwxMzI0NTYiLCJleHAiOjEzOTM3MDM1NzEsImF1ZCI6 + Response 200 (application/json) @@ -2505,7 +2326,7 @@ Request "description":"Servers are up but overloaded. Try again later." } -## Get User Algo Challenges [/user/{handle}/challenges/algo?pageIndex={pageIndex}&pageSize={pageSize}&sortOrder={sortOrder}&sortColumn={sortColumn}] +## Get User Algo Challenges [/user/{handle}/challenges/algo{?pageIndex}{?pageSize}{?sortOrder}{?sortColumn}] ### Get User Algo Challenges [GET] + Parameters @@ -2540,6 +2361,7 @@ Request } + Response 400 (application/json) + { "name": "Bad Request", "value": 400, @@ -2548,6 +2370,7 @@ Request } + Response 400 (application/json) + { "name": "Bad Request", "value": 400, @@ -2556,6 +2379,7 @@ Request } + Response 400 (application/json) + { "name": "Bad Request", "value": 400, @@ -2564,6 +2388,7 @@ Request } + Response 400 (application/json) + { "name": "Bad Request", "value": 400, @@ -2572,6 +2397,7 @@ Request } + Response 400 (application/json) + { "name": "Bad Request", "value": 400, @@ -2580,6 +2406,7 @@ Request } + Response 400 (application/json) + { "name": "Bad Request", "value": 400, @@ -2588,6 +2415,7 @@ Request } + Response 400 (application/json) + { "name": "Bad Request", "value": 400, @@ -2596,6 +2424,7 @@ Request } + Response 400 (application/json) + { "name": "Bad Request", "value": 400, @@ -2604,6 +2433,7 @@ Request } + Response 400 (application/json) + { "name": "Bad Request", "value": 400, @@ -2612,6 +2442,7 @@ Request } + Response 400 (application/json) + { "name": "Bad Request", "value": 400, @@ -2620,6 +2451,7 @@ Request } + Response 400 (application/json) + { "name": "Bad Request", "value": 400, @@ -2628,6 +2460,7 @@ Request } + Response 400 (application/json) + { "name": "Bad Request", "value": 400, @@ -2636,6 +2469,7 @@ Request } + Response 400 (application/json) + { "name": "Bad Request", "value": 400, @@ -2644,6 +2478,7 @@ Request } + Response 400 (application/json) + { "name": "Bad Request", "value": 400, @@ -2652,6 +2487,7 @@ Request } + Response 404 (application/json) + { "name": "Not Found", "value": 404, @@ -2676,7 +2512,7 @@ Request } -## Get User Marathon Matches Information [/user/{handle}/challenges/marathon?pageIndex={pageIndex}&pageSize={pageSize}&sortColumn={sortColumn}&sortOrder={sortOrder}] +## Get User Marathon Matches Information [/user/{handle}/challenges/marathon{?pageIndex}{?pageSize}{?sortColumn}{?sortOrder}] ### Get User Marathon Matches Information [GET] + Parameters @@ -2712,6 +2548,7 @@ Request } + Response 400 (application/json) + { "name": "Bad Request", "value": 400, @@ -2720,6 +2557,7 @@ Request } + Response 400 (application/json) + { "name": "Bad Request", "value": 400, @@ -2728,6 +2566,7 @@ Request } + Response 400 (application/json) + { "name": "Bad Request", "value": 400, @@ -2736,6 +2575,7 @@ Request } + Response 400 (application/json) + { "name": "Bad Request", "value": 400, @@ -2744,6 +2584,7 @@ Request } + Response 400 (application/json) + { "name": "Bad Request", "value": 400, @@ -2752,6 +2593,7 @@ Request } + Response 400 (application/json) + { "name": "Bad Request", "value": 400, @@ -2760,6 +2602,7 @@ Request } + Response 400 (application/json) + { "name": "Bad Request", "value": 400, @@ -2768,6 +2611,7 @@ Request } + Response 400 (application/json) + { "name": "Bad Request", "value": 400, @@ -2776,6 +2620,7 @@ Request } + Response 400 (application/json) + { "name": "Bad Request", "value": 400, @@ -2784,6 +2629,7 @@ Request } + Response 400 (application/json) + { "name": "Bad Request", "value": 400, @@ -2792,6 +2638,7 @@ Request } + Response 400 (application/json) + { "name": "Bad Request", "value": 400, @@ -2800,6 +2647,7 @@ Request } + Response 400 (application/json) + { "name": "Bad Request", "value": 400, @@ -2808,6 +2656,7 @@ Request } + Response 400 (application/json) + { "name": "Bad Request", "value": 400, @@ -2869,7 +2718,7 @@ Request "description":"Servers are up but overloaded. Try again later." } -## Validate Social [/users/validateSocial?socialProviderId={socialProviderId}&socialUserId={socialUserId}] +## Validate Social [/users/validateSocial{?socialProviderId}{?socialUserId}] ### Validate Handle [GET] + Parameters @@ -2906,7 +2755,7 @@ Request "description":"Servers are up but overloaded. Try again later." } -## Generate Reset Token [/users/resetToken/?handle={handle}&email={email}] +## Generate Reset Token [/users/resetToken/{?handle}{?email}] ### Generate Reset Token [GET] - return "successful" flag set to true @@ -2973,8 +2822,12 @@ Request ### Reset Password [POST] + Parameters + handle (required, string, `iRabbit`) ... Member Handle - + token (required, string, `snABCD`) ... The reset password token - + password (required, string, `cnDEFG`) ... The new password + ++ Attributes + + token: `snABCD` (required, string) ... The reset password token + + password: `cnDEFG` (required, string) ... The new password + ++ Request Reset Password (application/json) + Response 200 (application/json) @@ -3025,9 +2878,11 @@ Request ## Update Password [/users/password] ### Update Password [POST] -+ Parameters - + oldPassword (required, string, `snABCD`) ... The old password - + newPassword (required, string, `cnDEFG`) ... The new password ++ Attributes + + oldPassword: `snABCD` (required, string) ... The old password + + newPassword: `cnDEFG` (required, string) ... The new password + ++ Request Update Password (application/json) + Response 200 (application/json) @@ -3075,7 +2930,7 @@ Request "description":"Servers are up but overloaded. Try again later." } -## Activate User [/users/activate?code={code}] +## Activate User [/users/activate{?code}] ### Activate User [GET] + Parameters + code (required, string, `BHWXAG3R`) ... The activation code @@ -3139,8 +2994,9 @@ Request Request -+ Headers - Authorization : Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZHwxMzI0NTYiLCJleHAiOjEzOTM3MDM1NzEsImF1ZCI6 + + Headers + + Authorization : Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZHwxMzI0NTYiLCJleHAiOjEzOTM3MDM1NzEsImF1ZCI6 + Parameters + photo (required, file) ... The photo file. @@ -3201,7 +3057,7 @@ Request #Group Software Challenges -## Review Opportunities [/develop/reviewOpportunities/?pageIndex={pageIndex}&pageSize={pageSize}&sortColumn={sortColumn}&sortOrder={sortOrder}] +## Review Opportunities [/develop/reviewOpportunities/?{filter}={value}{&pageIndex}{&pageSize}{&sortColumn}{&sortOrder} ### Get Review Opportunities [GET] + Parameters @@ -3427,7 +3283,12 @@ Request + Parameters + challengeId (required, number, `30000000`) ... The challenge id. - + reviewApplicationRoleId (optional, number, `1`) ... The review application role id to apply. + ++ Attributes + + + reviewApplicationRoleId: `1` (optional, number) ... The review application role id to apply. + ++ Request Apply Develop Review Opportunity Information (application/json) + Response 200 (application/json) @@ -3575,11 +3436,16 @@ Request "description":"Servers are up but overloaded. Try again later." } -## Apply Design Review Opportunity [/design/reviewOpportunities/:challengeId/apply] +## Apply Design Review Opportunity [/design/reviewOpportunities/{challengeId}/apply] ### Apply Design Review Opportunity [POST] + Parameters + challengeId (required, string, `3001`) ... The challenge id - + isSpecReview (required, boolean, `true` or false) ... The spec review flag + ++ Attributes + + + isSpecReview: `true` (required, boolean) ... The spec review flag + ++ Request Apply Design Review Opportunity (application/json) + Response 200 (application/json) @@ -3748,7 +3614,7 @@ Request } -## Software Member Statistics [/users/{handle}/statistics/develop?track={track}] +## Software Member Statistics [/users/{handle}/statistics/develop{?track}] ### Software Member Statistics [GET] + Parameters @@ -3975,7 +3841,7 @@ Request } -## Search Active Software Challenges [/challenges/active?type=develop&pageIndex={pageIndex}&pageSize={pageSize}&sortColumn={sortColumn}&sortOrder={sortOrder}&communityId={communityId}&submissionEndFrom={submissionEndFrom}&submissionEndTo={submissionEndTo}&type={type}&platforms={platforms}&technologies={technologies}&prizeLowerBound={prizeLowerBound}&prizeUpperBound={prizeUpperBound}] +## Search Active Software Challenges [/challenges/active?type=develop{&pageIndex}{&pageSize}{&sortColumn}{&sortOrder}{&communityId}{&submissionEndFrom}{&submissionEndTo}{&type}{&platforms}{&technologies}{&prizeLowerBound}{&prizeUpperBound}] ### Search Active Software Challenges [GET] + Parameters @@ -3986,7 +3852,7 @@ Request + communityId (optional, number, `1`) ... The community id. + submissionEndFrom (optional, string, `2014-03-01`) ... submission end date from value. + submissionEndTo (optional, string, `2014-03-15`) ... submission end date to value. - + type (optional, string, `assembly') ... challenge type + + type (optional, string, `assembly`) ... challenge type + platforms (optional, string, `google,heroku`) ... platforms filter + technologies (optional, string, `java,javascript`) ... technologies filter + prizeLowerBound (optional, number, `1000`) ... prize lowerbound @@ -4132,7 +3998,7 @@ Request "description":"Servers are up but overloaded. Try again later." } -## Search Open Software Challenges [/challenges/open?type=develop&pageIndex={pageIndex}&pageSize={pageSize}&sortColumn={sortColumn}&sortOrder={sortOrder}&communityId={communityId}&submissionEndFrom={submissionEndFrom}&submissionEndTo={submissionEndTo}&type={type}&platforms={platforms}&technologies={technologies}&prizeLowerBound={prizeLowerBound}&prizeUpperBound={prizeUpperBound}] +## Search Open Software Challenges [/challenges/open?type=develop{&pageIndex}{&pageSize}{&sortColumn}{&sortOrder}{&communityId}{&submissionEndFrom}{&submissionEndTo}{&type}{&platforms}{&technologies}{&prizeLowerBound}{&prizeUpperBound}] ### Search Open Software Challenges [GET] + Parameters @@ -4143,7 +4009,7 @@ Request + communityId (optional, number, `1`) ... The community id. + submissionEndFrom (optional, string, `2014-03-01`) ... submission end date from value. + submissionEndTo (optional, string, `2014-03-15`) ... submission end date to value. - + type (optional, string, `assembly') ... challenge type + + type (optional, string, `assembly`) ... challenge type + platforms (optional, string, `google,heroku`) ... platforms filter + technologies (optional, string, `java,javascript`) ... technologies filter + prizeLowerBound (optional, number, `1000`) ... prize lowerbound @@ -4289,7 +4155,7 @@ Request "description":"Servers are up but overloaded. Try again later." } -## Search Past Software Challenges [/challenges/past?type=develop&pageIndex={pageIndex}&pageSize={pageSize}&sortColumn={sortColumn}&sortOrder={sortOrder}&communityId={communityId}&submissionEndFrom={submissionEndFrom}&submissionEndTo={submissionEndTo}&type={type}&platforms={platforms}&technologies={technologies}&prizeLowerBound={prizeLowerBound}&prizeUpperBound={prizeUpperBound}] +## Search Past Software Challenges [/challenges/past?type=develop{&pageIndex}{&pageSize}{&sortColumn}{&sortOrder}{&communityId}{&submissionEndFrom}{&submissionEndTo}{&type}{&platforms}{&technologies}{&prizeLowerBound}{&prizeUpperBound}] ### Search Past Software Challenges [GET] + Parameters @@ -4300,7 +4166,7 @@ Request + communityId (optional, number, `1`) ... The community id. + submissionEndFrom (optional, string, `2014-03-01`) ... submission end date from value. + submissionEndTo (optional, string, `2014-03-15`) ... submission end date to value. - + type (optional, string, `assembly') ... challenge type + + type (optional, string, `assembly`) ... challenge type + platforms (optional, string, `google,heroku`) ... platforms filter + technologies (optional, string, `java,javascript`) ... technologies filter + prizeLowerBound (optional, number, `1000`) ... prize lowerbound @@ -4434,7 +4300,7 @@ Request "description":"Servers are up but overloaded. Try again later." } -## Search Upcoming Software Challenges [/challenges/upcoming?type=develop&pageIndex={pageIndex}&pageSize={pageSize}&sortColumn={sortColumn}&sortOrder={sortOrder}&communityId={communityId}&submissionEndFrom={submissionEndFrom}&submissionEndTo={submissionEndTo}&type={type}&platforms={platforms}&technologies={technologies}&prizeLowerBound={prizeLowerBound}&prizeUpperBound={prizeUpperBound}] +## Search Upcoming Software Challenges [/challenges/upcoming?type=develop{&pageIndex}{&pageSize}{&sortColumn}{&sortOrder}{&communityId}{&submissionEndFrom}{&submissionEndTo}{&type}{&platforms}{&technologies}{&prizeLowerBound}{&prizeUpperBound}] ### Search Upcoming Software Challenges [GET] + Parameters @@ -4445,7 +4311,7 @@ Request + communityId (optional, number, `1`) ... The community id. + submissionEndFrom (optional, string, `2014-03-01`) ... submission end date from value. + submissionEndTo (optional, string, `2014-03-15`) ... submission end date to value. - + type (optional, string, `assembly') ... challenge type + + type (optional, string, `assembly`) ... challenge type + platforms (optional, string, `google,heroku`) ... platforms filter + technologies (optional, string, `java,javascript`) ... technologies filter + prizeLowerBound (optional, number, `1000`) ... prize lowerbound @@ -5167,13 +5033,16 @@ Request ## Software Challenge Upload Submission [/develop/challenges/{challengeid}/submit] ### Upload a submission by using base64 encoding[POST] -+ Request (application/json) + Parameters + challengeid (required, number, `30000000`) ... The challenge id. - + fileName (required, string, `abcd.zip`) ... The name of the file that is being uploaded - + fileData (required, string, `SGVsbG8gV29ybGQ=`) ... The Base64 encoded content of the file being uploaded. The example value is 'Hello World' base64 encoded - + type (optional, string, `checkpoint`) ... The type of submission. Can be 'final' or 'checkpoint'. If absent, 'final' is assumed. + ++ Attributes + + fileName: `abcd.zip` (required, string) ... The name of the file that is being uploaded + + fileData: `SGVsbG8gV29ybGQ=` (required, string) ... The Base64 encoded content of the file being uploaded. The example value is 'Hello World' base64 encoded + + type: `checkpoint` (optional, string) ... The type of submission. Can be 'final' or 'checkpoint'. If absent, 'final' is assumed. + ++ Request Upload a submission by using base64 encoding (application/json) + Response 200 (application/json) @@ -5244,8 +5113,12 @@ Request + Parameters + challengeid (required, number, `30000000`) ... The challenge id. - + submissionFile (required, string, `abcd.zip`) ... The submission zip - + type (optional, string, `checkpoint`) ... The type of submission. Can be 'final' or 'checkpoint'. If absent, 'final' is assumed. + ++ Attributes + + submissionFile: `abcd.zip` (required, string) ... The submission zip + + type: `checkpoint` (optional, string) ... The type of submission. Can be 'final' or 'checkpoint'. If absent, 'final' is assumed. + ++ Request Upload a submission by using direct file upload (application/json) + Response 200 (application/json) @@ -5315,19 +5188,23 @@ Request + Request (application/json) + Parameters - + challlengeId (required, integer, 545464) ... The challenge id - + submissionFile (required, string, `abcd.zip`) ... The submission zip - + sourceFile (required, string, `efgh.zip`) ... The source zip - + previewFile (required, string, `hijk.png`) ... The preview image file - + type (optional, string, `checkpoint`) ... The type of submission. Can be 'submission' or 'checkpoint'. If absent, 'submission' is assumed. - + fonts (optional, string, `fs1||fs2||fs3`) ... Double pipe separated font sources - + fontNames (optional, string, `fn1||fn2||fn3`) ... Double pipe separated font names - + fontUrls (optional, string, `google.com||yahoo.com||grephouse.com`) ... Double pipe separated font urls - + stockArtNames (optional, string, `sa1||sa2||sa3`) ... Double pipe separated stock art names - + stockArtFileNumbers (optional, string, `fn1||fn2||fn3`) ... Double pipe separated stock art file numbers - + stockArtUrls (optional, string, `google.com||yahoo.com||grephouse.com`) ... Double pipe separated font urls - + rank (optional, integer, 2) ... The rank of a submission - + comment (optional, string, `a comment`) ... optional comment + + challlengeId (required, integer, `545464`) ... The challenge id + ++ Attributes + + submissionFile: `abcd.zip` (required, string) ... The submission zip + + sourceFile: `efgh.zip` (required, string) ... The source zip + + previewFile: `hijk.png` (required, string) ... The preview image file + + type: `checkpoint` (optional, string) ... The type of submission. Can be 'submission' or 'checkpoint'. If absent, 'submission' is assumed. + + fonts: `fs1||fs2||fs3` (optional, string) ... Double pipe separated font sources + + fontNames: `fn1||fn2||fn3` (optional, string) ... Double pipe separated font names + + fontUrls: `google.com||yahoo.com||grephouse.com` (optional, string) ... Double pipe separated font urls + + stockArtNames: `sa1||sa2||sa3` (optional, string) ... Double pipe separated stock art names + + stockArtFileNumbers: `fn1||fn2||fn3` (optional, string) ... Double pipe separated stock art file numbers + + stockArtUrls: `google.com||yahoo.com||grephouse.com` (optional, string) ... Double pipe separated font urls + + rank: `2` (optional, number) ... The rank of a submission + + comment: `a comment` (optional, string) ... optional comment + ++ Request Upload a submission (application/json) + Response 200 (application/json) @@ -5384,7 +5261,7 @@ Request "description":"Servers are up but overloaded. Try again later." } -## Top Ranked Members [/develop/statistics/tops/{contestType}?pageIndex={pageIndex}&pageSize={pageSize}] +## Top Ranked Members [/develop/statistics/tops/{contestType}{?pageIndex}{?pageSize}] ### Top Ranked Members [GET] + Parameters @@ -5460,7 +5337,7 @@ Request # Group Studio Challenges -## Search Active Studio Challenges [/challenges/active?&type=design&pageSize={pageSize}&pageIndex={pageIndex}&sortColumn={sortColumn}&sortOrder={sortOrder}&communityId={communityId}&submissionEndFrom={submissionEndFrom}&submissionEndTo={submissionEndTo}] +## Search Active Studio Challenges [/challenges/active?&type=design{&pageSize}{&pageIndex}{&sortColumn}{&sortOrder}{&communityId}{&submissionEndFrom}{&submissionEndTo}] ### Search Active Studio Challenges [GET] + Parameters @@ -5580,7 +5457,7 @@ Request "description":"Servers are up but overloaded. Try again later." } -## Search Open Studio Challenges [/challenges/open?type=design&pageSize={pageSize}&pageIndex={pageIndex}&sortColumn={sortColumn}&sortOrder={sortOrder}&communityId={communityId}&submissionEndFrom={submissionEndFrom}&submissionEndTo={submissionEndTo}] +## Search Open Studio Challenges [/challenges/open?type=design{&pageSize}{&pageIndex}{&sortColumn}{&sortOrder}{&communityId}{&submissionEndFrom}{&submissionEndTo}] ### Search Open Studio Challenges [GET] + Parameters @@ -5700,7 +5577,7 @@ Request "description":"Servers are up but overloaded. Try again later." } -## Search Past Studio Challenges [/challenges/past?type=design&pageSize={pageSize}&pageIndex={pageIndex}&sortColumn={sortColumn}&sortOrder={sortOrder}&communityId={communityId}&submissionEndFrom={submissionEndFrom}&submissionEndTo={submissionEndTo}] +## Search Past Studio Challenges [/challenges/past?type=design{&pageSize}{&pageIndex}{&sortColumn}{&sortOrder}{&communityId}{&submissionEndFrom}{&submissionEndTo}] ### Search Past Studio Challenges [GET] + Parameters @@ -5812,7 +5689,7 @@ Request "description":"Servers are up but overloaded. Try again later." } -## Search Upcoming Studio Challenges [/challenges/upcoming?type=design&pageSize={pageSize}&pageIndex={pageIndex}&sortColumn={sortColumn}&sortOrder={sortOrder}&communityId={communityId}&submissionEndFrom={submissionEndFrom}&submissionEndTo={submissionEndTo}] +## Search Upcoming Studio Challenges [/challenges/upcoming?type=design{&pageSize}{&pageIndex}{&sortColumn}{&sortOrder}{&communityId}{&submissionEndFrom}{&submissionEndTo}] ### Search Upcoming Studio Challenges [GET] + Parameters @@ -5920,205 +5797,6 @@ Request "description":"Servers are up but overloaded. Try again later." } -## Get Studio Challenge Detail [/challenges/{challengeId}] -### Get Studio Challenge Detail [GET] - -+ Parameters - + challengeId (required, number, `30000000`) ... The challenge id. - -+ Response 200 (application/json) - - { - "challengeType": "Web Design", - "challengeName": "CS-TC Help Center Storyboard Design Contest", - "challengeId": 30036283, - "projectId": 6847, - "forumId": "4076", - "introduction": "This is the overview. It can contain HTML.", - "round1Introduction": "Round 1 Intro", - "round2Introduction": "Round 2 Intro", - "roundOneDetails": "Description for round 1.", - "roundTwoDetails": "Description for round 2.", - "detailedRequirements": "

The main aim of this contest is to come up designs for the New CS-TC Help-Center, this large help-center which will cover help information for all sections which includes Design, Software, Data/Algorithms, Copilots/Reviewers, and TopCoder UniversityThe Help Center will have its own wordpress theme and wordpress "site".
\n
\nWe recently ran a few design contests to create new site design for the TopCoder-Cloudspokes Community, in this contest - you will reuse many of the design elements to help us build a consistent design.
\n
\nIMPORTANT!! Design Considerations:
\n- Please use the global header and navigation at the top and a global footer at the bottom from the attached storyboards
\n- Follow the color scheme as shown in the attached designs.
\n- Create icons whereever necessary, follow the design aesthetics from the attached designs.
\n- Continue the FLAT design trend shown in the New Designs
\n- You may reuse any designs from the attached Storyboards.

\n- We are looking for your help in designing the desktop view (1024 x 768) and mobile view (320 x 480)

\n\n

General Requirements: 
\nBelow are some of the areas, where we would like to see your creativity by coming up with an out of the box solutions…

\n\n

Navigation: 
\n- It will show "Sections > Topics > Sub-Topics", please see the attached excel file to get an idea on what a section, topic could be.
\n- We would like the navigation for this help-center to be in a sidebar like shown in the wireframe
\n- We need consistent icons for each of the section, they are "Design, Development, Data/Algorithms, Copilots/Reviewers and TopCoder University"
\n- Please reuse the icons for Design, Development and Data/Algorithms from the attached designs
\n- Design the icons for Copilots/Reviewers and TopCoder University.
\n- Based on the wireframe, we are planning to show a smaller version of these section icons in the left side collpased view i.e. when a section is selected and a medium size above the Topics/Sub-topics list with the name of the section.
\n- Create the hover and selected styles for all these navigation links (Section, Topics, Sub-topics).
\n- Probably we will need a scroll bar to be shown in the Topics/Sub-topics navigation like shown in the wireframe - as this list could be long.
\n- You also need to think on how these should be planned for a mobile view?

\n\n

Breadcrumbs:
\n- Please show breadcrumbs in your designs, follow the wireframes for this.
\n- Please create the hover and selected style for this

\n\n

Search:
\n- We will need a prominent location for the search bar like shown in the wireframe.
\n- Search bar will shown in all pages within the help-center.
\n- Design this search bar, create search icon if needed.
\n- Please place the following words inside the search bar: "Search Help Center".
\n- Also, show your designs for the auto-suggest drop-down. (i.e. as a user types the text, they need to see matching topics in a drop-down).
\n
\nSupport: 
\n- We need an Email Support link shown on all pages, like shown in the wireframe
\n- 
Please use the following words for the support email area: "Email Support Team".
\n- Please come up with better designs for this.

\n\n

Page Requirements
\nBelow are the required pages from the wireframe...

\n
\nHelp Center Home:
\nThis is main page in the help-center, it will be a gateway for the user to proceed to other sections of the help-center
\n- This page will play a very important role in the help-center. 
\n- Please reduce the height of the slideshow a bit.
\n- We will have the colored bars with the icon and name of the section at the bottom of the slideshow - clicking on these will show the corresponding slide. 
\n- Colored bars shown at the bottom of the slideshow need to have a Hover and Active styles
\n- FAQs will be a static area shown on the right side.

\n- Click on the "More" in 'Member Tips" shown at the bottom, please design the member tips view.
\n- Please follow the wireframe for contents to be shown in this page.
\n
\nSection:
\nThis New Help Center would contain mainly five sections to start with; they are Design, Development, Data/Algorithms, Copilots/Reviewers, and TopCoder University.
\n- You can reach the section landing page simply by clicking on the any of the section shown in the left.
\n- These sections would have their own landing page, follow the contents from the wireframe.
\n- This page has a banner at the top, you may use a placeholder for it.
\n- This page shows contents in Grid and List view, please reuse the grid/list buttons from the attached designs.
\n- Please show your designs for grid and list views
\n
\nTopics:
\n- Click on a "Topic Name" (example: In studio section, topics names are Competition Types, Tournaments etc..) from the left-side navigation to reach this page.
\n- This page shows Topic Summary at the top, since this will be consistent in all topic landing pages, please create a style to show the summary.
\n- Below the topic summary, we will list all the Sub-topics within that topic.
\n- Please remove the "thumb image, username and date" - its not required, just the sub-topic title and a few lines from it should be fine.
\n
\nSub-Topics:
\n- In the wireframe, from the topic landing page, click on any of the listed sub-topics to view the sub-topic page.

\n- These are the exact pages where a user would see the help information in the form of Articles, Videos, and Tutorials/Walkthroughs etc…
\n- Follow the wireframe for the contents
\n- These would contain 'Title' and followed by "Table of Contents" at the top, these table of contents will mostly be used for the help contents in Software section - please come up with a design that highlishts these table of contents.
\n- At the bottom, we will have two columns 1) "Related" which will have a few links and 2) Resources - which will show few documents and a video thumbnail. How should these be shown?
\n
\nSearch Results:

\nAs mentioned earlier, a search bar is expected to be in all pages:
\n- Click on the magnifier icon in the search bar to see the results
\n- The top buttons shown in the search results are filters, how should these be shown in your designs?
\n- Follow the contents from the wireframe.

\n\n

Branding Guidelines
\n- Please use the logo from the attached storyboard designs
\n- Please follow the colors from the attached designs.
\n- Please continue to use the Flat design concept 

\n\n

Target User
\n-Members, Copilots, Reviewers, Customers and CS-TC Admins

\n\n

Judging Criteria
\n- How well you create your designs based on the wireframes.
\n- Cleanliness of your graphics and design.
\n- Design looks and User Experience.

\n\n

Submission & Source Files
\nPreview Image
\nPlease create your preview image as one (1) 1024x1024px JPG or PNG file in RGB color mode at 72dpi and place a screenshot of your submission within it.

\n\n

Submission File
\nSubmit JPG/PNG for your submission files.

\n\n

Source Files
\nAll original source files of the submitted design. Files should be created in Adobe Photoshop and saved as layered PSD file.

\n\n

Final Fixes
\nAs part of the final fixes phase you may be asked to modify your graphics (sizes or colors) or modify overall colors. We may ask you to update your design or graphics based on other winning placements.

\n", - "screeningScorecardId": "30001363", - "reviewScorecardId": "30001031", - "cmcTaskId": "", - "numberOfCheckpointsPrizes": 5, - "topCheckPointPrize": "100", - "postingDate": "2013-11-20T22:36:15.000Z", - "registrationEndDate": "2013-11-27T06:54:05.000Z", - "checkpointSubmissionEndDate": "2013-11-25T06:30:16.000Z", - "submissionEndDate": "2013-11-27T06:54:09.000Z", - "appealsEndDate": "2013-11-27T23:44:18.000Z", - "finalFixEndDate": "2013-11-27T23:44:18.000Z", - "submissionLimit": "3", - "sourceFileTypes": [ - { - "extension": "psd", - "description": "Adobe Photoshop" - }, - { - "extension": "ai", - "description": "Adobe Illustrator" - } - ], - "submissionsViewable": "true", - "reviewType": "PEER, COMMUNITY, or INTERNAL", - "downloads": [ - { - "docId": 12345678, - "name": "design_guide.pdf", - "description": "Standard Design Guide" - }, - { - "docId": 87654321, - "name": "sample.doc", - "description": "Sample of what we want." - } - ], - "currentPhaseEndDate": "-000001-11-30T00:00:00.000Z", - "currentStatus": "Completed", - "currentPhaseName": "", - "currentPhaseRemainingTime": 0, - "digitalRunPoints": 625, - "challengeCommunity": "design", - "directUrl": "https://www.topcoder.com/direct/contest/detail.action?projectId=30036283", - "prize": [ - 1500, - 500 - ], - "generalCheckpointFeedback": "This is general feedback from all competitors.", - "checkpoints": [ - { - "submissionId": 162433, - "submitter": "t3uku", - "submissionTime": "2013-11-24T11:36:23.000Z", - "feedback": "This is the checkpoint feedback.", - "totalImages": 18 - }, - { - "submissionId": 162470, - "submitter": "CoralBlue", - "submissionTime": "2013-11-25T06:24:16.000Z", - "feedback": "This is the checkpoint feedback.", - "totalImages": 18 - }, - { - "submissionId": 162464, - "submitter": "thinkcreeper", - "submissionTime": "2013-11-25T02:36:01.000Z", - "feedback": "This is the checkpoint feedback.", - "totalImages": 18 - } - ], - "submissions": [ - { - "submissionId": 162533, - "submitter": "t3uku", - "submissionTime": "2013-11-26T22:14:01.000Z", - "totalImages": 18 - }, - { - "submissionId": 162559, - "submitter": "CoralBlue", - "submissionTime": "2013-11-27T06:46:15.000Z", - "totalImages": 18 - }, - { - "submissionId": 162555, - "submitter": "thinkcreeper", - "submissionTime": "2013-11-27T05:11:19.000Z", - "totalImages": 18 - } - ], - "winners": [ - { - "submissionId": 162555, - "submitter": "thinkcreeper", - "submissionTime": "2013-11-27T05:11:19.000Z", - "totalImages": 18, - "placement": 1, - "prize": "1500" - }, - { - "submissionId": 162111, - "submitter": "iamtong", - "submissionTime": "2013-11-26T05:11:19.000Z", - "totalImages": 14, - "placement": 2, - "prize": "600" - } - ], - "Documents": [ - { - "documentName": "document 1", - "url": "http://community.topcoder.com/tc?module=DownloadDocument&docid=30400000" - }, - { - "documentName": "document 2", - "url": "http://community.topcoder.com/tc?module=DownloadDocument&docid=30400001" - }, - { - "documentName": "document 3", - "url": "http://community.topcoder.com/tc?module=DownloadDocument&docid=30400002" - } - ], - "phases": [ - { - "type": "Registration", - "status": "Open", - "scheduledStartTime": "2013-12-05T12:22:07.000Z", - "actualStartTime": "2013-12-05T12:22:07.000Z", - "scheduledEndTime": "2013-12-05T12:22:07.000Z", - "actualEndTime": null - }, - { - "type": "Submission", - "status": "Scheduled", - "scheduledStartTime": "2013-12-05T12:22:07.000Z", - "actualStartTime": null, - "scheduledEndTime": "2013-12-05T12:22:07.000Z", - "actualEndTime": null - } - ], - "event": { - "id": 3437, - "description": "TCO" - } - } - -+ 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." - } - ## Get Studio Challenge Result [/design/challenges/result/{challengeId}] ### Get Studio Challenge Result [GET] @@ -6268,7 +5946,7 @@ Request "description":"Servers are up but overloaded. Try again later." } -##Design Review Opportunities [/design/reviewOpportunities?pageIndex={pageIndex}&pageSize={pageSize}&sortColumn={sortColumn}&sortOrder={sortOrder}] +##Design Review Opportunities [/design/reviewOpportunities?{filter}={value}{&pageIndex}{&pageSize}{&sortColumn}{&sortOrder}] ### Get Design Review Opportunities [GET] + Parameters @@ -6573,7 +6251,7 @@ Request "description":"Servers are up but overloaded. Try again later." } -## Studio Member Recent Winning Submissions [/users/{handle}/statistics/design/recentWins?numberOfRecentWins={numberOfRecentWins}] +## Studio Member Recent Winning Submissions [/users/{handle}/statistics/design/recentWins{?numberOfRecentWins}] ### Studio Member Recent Winning Submissions [GET] + Parameters @@ -6928,7 +6606,7 @@ Request "description":"Servers are up but overloaded. Try again later." } -## Get SRM Rounds For Problem [/data/srm/problems/:problemId/rounds] +## Get SRM Rounds For Problem [/data/srm/problems/{problemId}/rounds] ### Get SRM Rounds For Problem [GET] + Parameters @@ -7037,7 +6715,7 @@ Request "description":"Servers are up but overloaded. Try again later." } -## View Algorithm SRM Challenges [/data/srm/challenges?listType={listType}&pageSize={pageSize}&pageIndex={pageIndex}&sortColumn={sortColumn}&sortOrder={sortOrder}] +## View Algorithm SRM Challenges [/data/srm/challenges?{filter}={value}{&listType}{&pageSize}{&pageIndex}{&sortColumn}{&sortOrder}] ### View Algorithm SRM Challenges [GET] + Parameters @@ -7131,7 +6809,7 @@ Request "description":"Servers are up but overloaded. Try again later." } -## Get SRM Practice Problems [/data/srm/practice/problems?pageIndex={pageIndex}&pageSize={pageSize}&sortColumn={sortColumn}&sortOrder={sortOrder}&problemId={problemId}&problemName={problemName}&problemTypes={problemTypes}&statuses={statuses}&myPointsLowerBound={myPointsLowerBound}&myPointsUpperBound={myPointsUpperBound}&pointsUpperBound={pointsUpperBound}&pointsLowerBound={pointsLowerBound}] +## Get SRM Practice Problems [/data/srm/practice/problems{?pageIndex}{?pageSize}{?sortColumn}{?sortOrder}{?problemId}{?problemName}{?problemTypes}{?statuses}{?myPointsLowerBound}{?myPointsUpperBound}{?pointsUpperBound}{?pointsLowerBound}{?difficulty}] ### Get SRM Practice Problems [GET] + Parameters @@ -7312,7 +6990,7 @@ Request "description":"Servers are up but overloaded. Try again later." } -## Get SRM Schedule [/data/srm/schedule?pageIndex={pageIndex}&pageSize={pageSize}&sortColumn={sortColumn}&sortOrder={sortOrder}&statuses={statuses}&types={types}®istrationStartTimeBefore={registrationStartTimeBefore}®istrationEndTimeBefore={registrationEndTimeBefore}&codingStartTimeBefore={codingStartTimeBefore}&codingEndTimeBefore={codingEndTimeBefore}&intermissionStartTimeBefore={intermissionStartTimeBefore}&intermissionEndTimeBefore={intermissionEndTimeBefore}&challengeStartTimeBefore={challengeStartTimeBefore}&challengeEndTimeBefore={challengeEndTimeBefore}&systestStartTimeBefore={systestStartTimeBefore}&systestEndTimeBefore={systestEndTimeBefore}®istrationStartTimeAfter={registrationStartTimeAfter}®istrationEndTimeAfter={registrationEndTimeAfter}&codingStartTimeAfter={codingStartTimeAfter}&codingEndTimeAfter={codingEndTimeAfter}&intermissionStartTimeAfter={intermissionStartTimeAfter}&intermissionEndTimeAfter={intermissionEndTimeAfter}&challengeStartTimeAfter={challengeStartTimeAfter}&challengeEndTimeAfter={challengeEndTimeAfter}&systestStartTimeAfter={systestStartTimeAfter}&systestEndTimeAfter={systestEndTimeAfter}] +## Get SRM Schedule [/data/srm/schedule{?pageIndex}{?pageSize}{?sortColumn}{?sortOrder}{?statuses}{?types}{?registrationStartTimeBefore}{?registrationEndTimeBefore}{?codingStartTimeBefore}{?codingEndTimeBefore}{?intermissionStartTimeBefore}{?intermissionEndTimeBefore}{?challengeStartTimeBefore}{?challengeEndTimeBefore}{?systestStartTimeBefore}{?systestEndTimeBefore}{?registrationStartTimeAfter}{?registrationEndTimeAfter}{?codingStartTimeAfter}{?codingEndTimeAfter}{?intermissionStartTimeAfter}{?intermissionEndTimeAfter}{?challengeStartTimeAfter}{?challengeEndTimeAfter}{?systestStartTimeAfter}{?systestEndTimeAfter}] ### Get SRM Schedule [GET] + Parameters @@ -7795,7 +7473,7 @@ Request "description":"Servers are up but overloaded. Try again later." } -## View Algorithm Marathon Challenges [/data/marathon/challenges?listType={listType}&pageSize={pageSize}&pageIndex={pageIndex}&sortColumn={sortColumn}&sortOrder={sortOrder}] +## View Algorithm Marathon Challenges [/data/marathon/challenges?{filter}={value}{&listType}{&pageSize}{&pageIndex}{&sortColumn}{&sortOrder}] ### View Algorithm Marathon Challenges [GET] + Parameters @@ -7875,7 +7553,7 @@ Request "description":"Servers are up but overloaded. Try again later." } -## View Past Data Science Challenges [/dataScience/challenges/past?pageIndex={pageIndex}&pageSize={pageSize}&sortColumn={sortColumn}&sortOrder={sortOrder}&submissionEndFrom={submissionEndFrom}&submissionEndTo={submissionEndTo}] +## View Past Data Science Challenges [/dataScience/challenges/past{?pageIndex}{?pageSize}{?sortColumn}{?sortOrder}{?submissionEndFrom}{?submissionEndTo}] ### View Past Data Science Challenges [GET] + Parameters @@ -8037,7 +7715,7 @@ Request "description":"Servers are up but overloaded. Try again later." } -## View Active Data Science Challenges [/dataScience/challenges/active?submissionEndFrom={submissionEndFrom}&submissionEndTo={submissionEndTo}] +## View Active Data Science Challenges [/dataScience/challenges/active{?submissionEndFrom}{?submissionEndTo}] ### View Active Data Science Challenges [GET] + Parameters @@ -8127,7 +7805,7 @@ Request "description":"Servers are up but overloaded. Try again later." } -## View Upcoming Data Science Challenges [/dataScience/challenges/upcoming?submissionEndFrom={submissionEndFrom}&submissionEndTo={submissionEndTo}] +## View Upcoming Data Science Challenges [/dataScience/challenges/upcoming{?submissionEndFrom}{?submissionEndTo}] ### View Upcoming Data Science Challenges [GET] + Parameters @@ -8408,19 +8086,21 @@ Request } ## Create SRM Contest Round API [/data/srm/rounds] -### Create SRM Contest Round API [POST] (application/json) +### Create SRM Contest Round API [POST] -+ Parameters - + contest_id (required, integer) round's contest_id - + invitaitonalType (required, integer) round's invitaitonalType - + registrationLimit (required, integer) round's registrationLimit - + name (required, string) round's name - + short_name (required, string) round's short_name - + status (required, string) round's status - * type (required, object) round's type, it's id should be set. - * region (required, object) round's region, it's id should be set. - * roomAssignment (required, object) round's roomAssginment, with field codersPerRoom(integer), type(integer), isByDivision, isByRegion, isFinal(boolean), p(Number). - * auto_end (optional, boolean) auto end flag ++ Attributes + + contest_id (required, integer) - round's contest_id + + invitaitonalType (required, number) - round's invitaitonalType + + registrationLimit (required, number) - round's registrationLimit + + name (required, string) - round's name + + short_name (required, string) - round's short_name + + status (required, string) - round's status + + type (required, object) - round's type, it's id should be set. + + region (required, object) - round's region, it's id should be set. + + roomAssignment (required, object) - round's roomAssginment, with field codersPerRoom(integer), type(integer), isByDivision, isByRegion, isFinal(boolean), p(Number). + + auto_end (optional, boolean) - auto end flag + ++ Request Create SRM Contest Round API (application/json) + Response 200 (application/json) @@ -8469,20 +8149,25 @@ Request } ## Modify SRM Contest Round API [/data/srm/rounds/{oldRoundId}] -### Modify SRM Contest Round API [PUT] (application/json) +### Modify SRM Contest Round API [PUT] + Parameters - + contest_id (required, integer) round's contest_id - + oldRoundId (required, integer) modifying round's id - + id (required, integer) round's id - + invitaitonalType (required, integer) round's invitaitonalType - + registrationLimit (required, integer) round's registrationLimit - + name (required, string) round's name - + short_name (required, string) round's short_name - + status (required, string) round's status - * type (required, object) round's type, it's id should be set. - * region (required, object) round's region, it's id should be set. - * roomAssignment (required, object) round's roomAssginment, with field codersPerRoom(integer), type(integer), isByDivision, isByRegion, isFinal(boolean), p(Number). + + oldRoundId (required, number) - modifying round's id + ++ Attributes + + contest_id (required, number) - round's contest_id + + oldRoundId (required, number) - modifying round's id + + id (required, number) - round's id + + invitaitonalType (required, number) - round's invitaitonalType + + registrationLimit (required, number) - round's registrationLimit + + name (required, string) - round's name + + short_name (required, string) - round's short_name + + status (required, string) - round's status + * type (required, object) - round's type, it's id should be set. + * region (required, object) - round's region, it's id should be set. + * roomAssignment (required, object) - round's roomAssginment, with field codersPerRoom(integer), type(integer), isByDivision, isByRegion, isFinal(boolean), p(Number). + ++ Request Modify SRM Contest Round API (application/json) + Response 200 (application/json) @@ -8552,7 +8237,7 @@ Request ### Delet SRM Contest Round API [DELETE] + Parameters - + roundId (required, integer) deleting round's id + + roundId (required, number) - deleting round's id + Response 200 (application/json) @@ -9453,7 +9138,7 @@ Request "description":"Servers are up but overloaded. Try again later." } -## Top Ranked Marathon Members [/data/marathon/statistics/tops?rankType={rankType}] +## Top Ranked Marathon Members [/data/marathon/statistics/tops{?rankType}] ### Top Ranked Marathon Members [GET] + Parameters @@ -9552,7 +9237,7 @@ Request "description":"Servers are up but overloaded. Try again later." } -## Top Ranked SRM Members [/data/srm/statistics/tops?rankType={rankType}&pageIndex={pageIndex}&pageSize={pageSize}] +## Top Ranked SRM Members [/data/srm/statistics/tops{?rankType}{?pageIndex}{?pageSize}] ### Top Ranked SRM Members [GET] + Parameters @@ -9850,12 +9535,12 @@ Request "description":"Servers are up but overloaded. Try again later." } -## Terms of Use for a challenge [/terms/{challengeId}] +## Terms of Use for a challenge [/terms/{challengeId}{?role}] ### Terms of Use for a challenge [GET] + Parameters + challengeId (required, number, `1234567`) ... The challenge for which to get terms of use - + role (optional, string, 'copilot') ... The role of the user + + role (optional, string, `copilot`) ... The role of the user + Response 200 (application/json) @@ -10200,39 +9885,113 @@ Request "description":"Servers are up but overloaded. Try again later." } -## Get round terms of use [/data/srm/rounds/:roundId/terms] -### Get round terms of use by round id [GET] - -- Only when jwt passed can we get the round terms of use. +## Get terms details for an user [/terms/for/{userId}/{termsOfUseIds}] +### Get terms details for an user [GET] + Parameters - + roundId (required, number, `13672`) ... The id of round + + userId (required, number, `132458`) ... The id of the user + + termsOfUseIds (required, string, `40000001,40000002,40000003`) ... A single terms of use id or a comma-separated list of ids + Request - + + Headers - - Authorization : Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZHwxMzI0NTYiLCJleHAiOjEzOTM3MDM1NzEsImF1ZCI6InRvcGNvZGVyIiwiaWF0IjoxMzkzNjQzNTcxfQ.F2iohKp2nwjQeGqrBD1wn42GJUD0r28aGjhDle7KujA + + Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3NtYS5hdXRoMC5jb20vIiwic3ViIjoiYWR8MTMyNDU2IiwiYXVkIjoiQ01hQnV3U25ZMFZ1NjhQTHJXYXR2dnUzaUlpR1BoN3QiLCJleHAiOjE1MDMwMTUyMzUsImlhdCI6MTQ2NzAxNTIzNX0.urwqVgAxShU2cAgSt67P3hsLdYb4xh9dxuGS-_ZNFzE + Response 200 (application/json) { - "roundTermsContent": "The round terms content..." + "terms": [ + { + "type": "General Product Terms of Use", + "agreeabilityType": "Electronically-agreeable", + "agreed": true, + "text": "This is the Node API Sample Term Of Use 1.", + "title": "NodeJS API Sample Term Of Use 1", + "termsOfUseId": 40000001, + "url": "http://topcoder.com/tou40000001.txt" + }, + { + "type": "Product Terms Of Use", + "agreeabilityType": "Electronically-agreeable", + "agreed": true, + "text": "This is the Node API Sample Term Of Use 2.", + "title": "NodeJS API Sample Term Of Use 2", + "termsOfUseId": 40000002, + "url": "http://topcoder.com/tou40000002.txt" + }, + { + "type": "Site Terms of Use", + "agreeabilityType": "Electronically-agreeable", + "agreed": false, + "text": "This is the Node API Sample Term Of Use 3.", + "title": "NodeJS API Sample Term Of Use 3", + "termsOfUseId": 40000003, + "url": "http://topcoder.com/tou40000003.txt" + }, + { + "type": "Corp Site Terms of Use", + "agreeabilityType": "Non-electronically-agreeable", + "agreed": false, + "text": "This is the Node API Sample Term Of Use 4.", + "title": "NodeJS API Sample Term Of Use 4", + "termsOfUseId": 40000004, + "url": "http://topcoder.com/tou40000004.txt" + }, + { + "type": "Contest", + "agreeabilityType": "Non-electronically-agreeable", + "agreed": false, + "text": "This is the Node API Sample Term Of Use 5.", + "title": "NodeJS API Sample Term Of Use 5", + "termsOfUseId": 40000005, + "url": "http://topcoder.com/tou40000005.txt" + } + ] + } + ++ Response 400 (application/json) + + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "User ID should be positive." + } + } + ++ Response 400 (application/json) + + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "Each Terms Of Use ID should be number." + }, } + + Response 401 (application/json) { - "name":"Unauthorized", - "value":"401", - "description":"Authentication credentials were missing or incorrect." + "error": { + "name": "Unauthorized", + "value": 401, + "description": "Authentication credentials were missing or incorrect.", + "details": "Authentication credential was missing." + } } -+ Response 404 (application/json) ++ Response 403 (application/json) { - "name":"Not Found", - "value":"404", - "description":"This message will explain why the URI requested is invalid or the resource does not exist." + "error": { + "name": "Forbidden", + "value": 403, + "description": "The request is understood, but it has been refused or access is not allowed.", + "details": "This user cannot get these data of other users" + }, } + Response 500 (application/json) @@ -10251,13 +10010,13 @@ Request "description":"Servers are up but overloaded. Try again later." } -## Agree terms of use [/terms/{termsOfUseId}/agree] -### Agree terms of use by id [POST] +## Get round terms of use [/data/srm/rounds/{roundId}/terms] +### Get round terms of use by round id [GET] -- Only when jwt passed can we agree the terms of use. +- Only when jwt passed can we get the round terms of use. + Parameters - + termsOfUseId (required, number, `534532`) ... The id of terms of use + + roundId (required, number, `13672`) ... The id of round + Request @@ -10268,52 +10027,14 @@ Request + Response 200 (application/json) { - "success": true - } - -+ Response 400 (application/json) - - { - "name":"Bad Request", - "value":"400", - "description":"The request was invalid. An accompanying message will explain why." - "details":"The term is not electronically agreeable." - } - -+ Response 400 (application/json) - - { - "name":"Bad Request", - "value":"400", - "description":"The request was invalid. An accompanying message will explain why." - "details":"You have agreed to this terms of use before." - } - -+ Response 400 (application/json) - - { - "name":"Bad Request", - "value":"400", - "description":"The request was invalid. An accompanying message will explain why." - "details":"You can't agree to this terms of use before you have agreed to all the dependencies terms of use." + "roundTermsContent": "The round terms content..." } - + Response 401 (application/json) { "name":"Unauthorized", "value":"401", "description":"Authentication credentials were missing or incorrect." - "details":"Authentication credential was missing." - } - -+ Response 403 (application/json) - - { - "name":"Forbidden", - "value":"403", - "description":"The request is understood, but it has been refused or access is not allowed." - "details":"Sorry, you can not agree to this terms of use." } + Response 404 (application/json) @@ -10322,10 +10043,8 @@ Request "name":"Not Found", "value":"404", "description":"This message will explain why the URI requested is invalid or the resource does not exist." - "details:":"No such terms of use exists." } - + Response 500 (application/json) { @@ -10342,13 +10061,221 @@ Request "description":"Servers are up but overloaded. Try again later." } -## My Submissions [/challenges/submissions/{challengeId}/mySubmissions] -### My Submissions [GET] +### Set Round Terms API [POST] + Parameters - + challengeId (required, number, `30005520`) ... The challenge id. + + roundId (required, number, `1000001`) ... The id of the round to set. -+ Response 200 (application/json) ++ Attributes + + terms: 'test terms' (required, string) ... The terms parameter. + ++ Request Set Round Terms API (application/json) + + + Headers + + Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZHwxMzI0NTYiLCJleHAiOjEzOTI4MTc4ODQsImF1ZCI6InRvcGNvZGVyIiwiaWF0IjoxMzkyNzU3ODg0fQ.7X2IKkiyyI1ExSM5GNpdhJ8fGGK5-oAjzccX6YL_BKY + ++ Response 200 (application/json) + + { + "success": true + } + ++ Response 400 (application/json) + + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "roundId should be number." + } + } + ++ Response 400 (application/json) + + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "roundId should be Integer." + } + } + ++ Response 400 (application/json) + + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "roundId should be positive." + } + } + ++ Response 400 (application/json) + + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "roundId should be less or equal to 2147483647." + } + } + ++ Response 400 (application/json) + + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "The round terms should not be empty." + } + } + ++ Response 401 (application/json) + + { + "error": { + "name": "Unauthorized", + "value": 401, + "description": "The request is understood, but it has been refused or access is not allowed.", + "details": "Authorized information needed." + } + } + ++ Response 403 (application/json) + + { + "error": { + "name": "Forbidden", + "value": 403, + "description": "The request is understood, but it has been refused or access is not allowed.", + "details": "Admin access only." + } + } + ++ Response 500 (application/json) + + { + "error": { + "name":"Internal Server Error", + "value":"500", + "description":"Unknown server error. Please contact support." + } + } + ++ Response 503 (application/json) + + { + "error": { + "name":"Service Unavailable", + "value":"503", + "description":"Servers are up but overloaded. Try again later." + } + } + +## Agree terms of use [/terms/{termsOfUseId}/agree] +### Agree terms of use by id [POST] + +- Only when jwt passed can we agree the terms of use. + ++ Parameters + + termsOfUseId (required, number, `534532`) ... The id of terms of use + ++ Request + + + Headers + + Authorization : Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZHwxMzI0NTYiLCJleHAiOjEzOTM3MDM1NzEsImF1ZCI6InRvcGNvZGVyIiwiaWF0IjoxMzkzNjQzNTcxfQ.F2iohKp2nwjQeGqrBD1wn42GJUD0r28aGjhDle7KujA + ++ Response 200 (application/json) + + { + "success": true + } + ++ Response 400 (application/json) + + { + "name":"Bad Request", + "value":"400", + "description":"The request was invalid. An accompanying message will explain why." + "details":"The term is not electronically agreeable." + } + ++ Response 400 (application/json) + + { + "name":"Bad Request", + "value":"400", + "description":"The request was invalid. An accompanying message will explain why." + "details":"You have agreed to this terms of use before." + } + ++ Response 400 (application/json) + + { + "name":"Bad Request", + "value":"400", + "description":"The request was invalid. An accompanying message will explain why." + "details":"You can't agree to this terms of use before you have agreed to all the dependencies terms of use." + } + ++ Response 401 (application/json) + + { + "name":"Unauthorized", + "value":"401", + "description":"Authentication credentials were missing or incorrect." + "details":"Authentication credential was missing." + } + ++ Response 403 (application/json) + + { + "name":"Forbidden", + "value":"403", + "description":"The request is understood, but it has been refused or access is not allowed." + "details":"Sorry, you can not agree to this terms of use." + } + ++ 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." + "details:":"No such terms of use exists." + } + + ++ 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." + } + +## My Submissions [/challenges/submissions/{challengeId}/mySubmissions] +### My Submissions [GET] + ++ Parameters + + challengeId (required, number, `30005520`) ... The challenge id. + ++ Response 200 (application/json) { "submissions": [ @@ -10433,7 +10360,7 @@ Request # Group Members API -## Search members by handle [/users/search?handle={handle}&pageIndex={pageIndex}&pageSize={pageSize}&caseSensitive={caseSensitive}] +## Search members by handle [/users/search{?handle}{?pageIndex}{?pageSize}{?caseSensitive}] ### Search members by handle [GET] + Parameters @@ -10444,58 +10371,58 @@ Request + Response 200 (application/json) - { - "total": 2, - "pageIndex": 1, - "pageSize": 10, - "users": - [ - { - "handle": "Hung", - "userId": 124764 - }, - { - "handle": "heffan", - "userId": 132456 - } - ] - } + { + "total": 2, + "pageIndex": 1, + "pageSize": 10, + "users": + [ + { + "handle": "Hung", + "userId": 124764 + }, + { + "handle": "heffan", + "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." - "details:":"caseSensitive should be 'true' or 'false'." - } + { + "name":"Bad Request", + "value":"400", + "description":"This message will explain why the request is invalid or cannot be served." + "details:":"caseSensitive should be 'true' or 'false'." + } + Response 400 (application/json) - { - "name":"Bad Request", - "value":"400", - "description":"This message will explain why the request is invalid or cannot be served." - "details:":"pageIndex should be positive." - } + { + "name":"Bad Request", + "value":"400", + "description":"This message will explain why the request is invalid or cannot be served." + "details:":"pageIndex should be positive." + } + Response 400 (application/json) - { - "name":"Bad Request", - "value":"400", - "description":"This message will explain why the request is invalid or cannot be served." - "details:":"pageSize should be positive." - } + { + "name":"Bad Request", + "value":"400", + "description":"This message will explain why the request is invalid or cannot be served." + "details:":"pageSize should be positive." + } + Response 400 (application/json) - { - "name":"Bad Request", - "value":"400", - "description":"This message will explain why the request is invalid or cannot be served." - "details:":"handle should be non-null and non-empty string." - } + { + "name":"Bad Request", + "value":"400", + "description":"This message will explain why the request is invalid or cannot be served." + "details:":"handle should be non-null and non-empty string." + } + Response 500 (application/json) @@ -10513,7 +10440,7 @@ Request "description":"Servers are up but overloaded. Try again later." } -## Check Email Availability [/users/validateEmail?email={email}] +## Check Email Availability [/users/validateEmail{?email}] ### Check Email Availability [GET] + Parameters @@ -10544,12 +10471,12 @@ Request "description":"Servers are up but overloaded. Try again later." } -## Software Copilot Statistics [/copilots/{handle}/statistics/develop?track={track}] +## Software Copilot Statistics [/copilots/{handle}/statistics/develop{?track}] ### Software Copilot Statistics [GET] + Parameters + handle (required, string, `iRabbit`) ... Member Handle - + track (optional, string, 'development') ... The track name + + track (optional, string, `development`) ... The track name + Response 200 (application/json) @@ -10611,12 +10538,12 @@ Request - Only when jwt passed can we use this api -+ Parameters - + templateId (required, UUID, `E12C78DE-67B1-4150-BEC8-C44CE20A2F0B`) ... The template id - + tabs (optional, String, `Handle||anix`) ... The default values to set for the tabs. Double pipe delimited. Multiple such parameters can be sent. - + returnUrl (optional, String, `http://localhost:8080/v2/terms/docusign/returnSigning&envelopeId=`) ... The return url. ++ Attributes + + templateId: `E12C78DE-67B1-4150-BEC8-C44CE20A2F0B` (required, string) ... The template id + + tabs: `Handle||anix` (optional, string) ... The default values to set for the tabs. Double pipe delimited. Multiple such parameters can be sent. + + returnUrl: `http://localhost:8080/v2/terms/docusign/returnSigning&envelopeId=` (optional, string) ... The return url. -+ Request ++ Request Docusign Recipient View URL (application/json) + Headers @@ -10670,7 +10597,7 @@ Request "description":"Servers are up but overloaded. Try again later." } -## Top Track Members [/users/tops/{trackType}?pageIndex={pageIndex}&pageSize={pageSize}] +## Top Track Members [/users/tops/{trackType}{?pageIndex}{?pageSize}] ### Top Track Members [GET] + Parameters @@ -10748,7 +10675,7 @@ Request # Group Download API -## Download Documents API [/download/document/{docid}?challengeId={challengeId}] +## Download Documents API [/download/document/{docid}{?challengeId}] ### Download Documents API [GET] + Parameters @@ -10797,11 +10724,11 @@ Request "description":"Servers are up but overloaded. Try again later." } -## Download Design Submissions API [/design/download/{submissionId}?submissionType={submissionType}] +## Download Design Submissions API [/design/download/{submissionId}{?submissionType}{?submissionImageTypeId}{?submissionFileIndex}] ### Download Design Submissions API [GET] + Parameters - + submission (required, number, `123456`) ... The submission id. + + submissionId (required, number, `123456`) ... The submission id. + submissionType (required, string, `preview`) ... The submission type should be preview or original + submissionImageTypeId (optional) ... The image type id, 25, 26, 28, 29, 30, 31 for tiny, thumb, small, medium and full + submissionFileIndex (optional) ... THe file index @@ -10848,7 +10775,7 @@ Request "description":"Servers are up but overloaded. Try again later." } -## Download Develop Submissions API [/develop/download/{submissionId}] +## Download Develop Submissions API [/develop/download/{submissionId}{?username}{?password}] ### Download Develop Submissions API [GET] + Parameters @@ -10913,6 +10840,7 @@ Payments APIs } + Response 200 (application/json) + { "paymentAccrualAmount": 43, "paymentMethod": "Western Union" @@ -10956,10 +10884,10 @@ Payments APIs } ### Payment Preference [POST] -+ Parameters - + paymentMethod (required, string, `Western Union`) ... Payment Method: PayPal, Western Union, Payoneer - + paypalAccountEmail (optional, string, if paymentMethods === "PayPal", else prohibited, must not exceed 100 characters, `heffan@gmail.com`) ... Email address of PayPal account - + paymentAccrualAmount (optional, integer, must be greater than or equal to 25, `100`) ... Accrual amount to be paid ++ Attrtibutes + + paymentMethod: `Western Union` (required, string) ... Payment Method: PayPal, Western Union, Payoneer + + paypalAccountEmail: `heffan@gmail.com` (optional, string) ... Email address of PayPal account (if paymentMethods === "PayPal", else prohibited, must not exceed 100 characters) + + paymentAccrualAmount: `100` (optional, number) ... Accrual amount to be paid (must be greater than or equal to 25) + Response 200 (application/json) @@ -11106,7 +11034,7 @@ Payments APIs -## Payment List [/payments?type={type}&status={status}&pageIndex={pageIndex}&pageSize={pageSize}&sortColumn={sortColumn}&sortOrder={sortOrder}] +## Payment List [/payments{?type}{?status}{?pageIndex}{?pageSize}{?sortColumn}{?sortOrder}] ### Payment List [GET] + Parameters @@ -11121,7 +11049,7 @@ Payments APIs + Headers - Authorization : Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZHwxMzI0NTYiLCJleHAiOjEzOTI4MTc4ODQsImF1ZCI6InRvcGNvZGVyIiwiaWF0IjoxMzkyNzU3ODg0fQ.7X2IKkiyyI1ExSM5GNpdhJ8fGGK5-oAjzccX6YL_BKY + Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZHwxMzI0NTYiLCJleHAiOjEzOTI4MTc4ODQsImF1ZCI6InRvcGNvZGVyIiwiaWF0IjoxMzkyNzU3ODg0fQ.7X2IKkiyyI1ExSM5GNpdhJ8fGGK5-oAjzccX6YL_BKY + Response 200 (application/json) @@ -11275,13 +11203,14 @@ Payments APIs ## Docusign Callback [/terms/docusignCallback] ### Docusign Callback [POST] -+ Parameters - + envelopeStatus (required, String, `Complete`) ... The status of the envelope - + envelopeId (required, UUID, `9103DC77-D8F1-4D7B-BED1-6116604EE98C`) ... The envelope to process - + tabs (required, Array, [{tabLabel: 'Handle', tabValue: 'anix'}, {...}]) ... The tab values. Can be empty - + connectKey (required, String, 'ABCDED-12435-EDFADSEC') The conenct key ++ Attributes + + envelopeStatus: `Complete` (required, string) ... The status of the envelope + + envelopeId: `9103DC77-D8F1-4D7B-BED1-6116604EE98C` (required, string) ... The envelope to process + + tabs (required, array) ... The tab values. [{tabLabel: 'Handle', tabValue: 'anix'}, {...}]. Can be empty. + + connectKey: 'ABCDED-12435-EDFADSEC' (required, string) ... The conenct key + Response 200 (application/json) + { "message": "some message" } @@ -11318,7 +11247,7 @@ Payments APIs "description":"Servers are up but overloaded. Try again later." } -## Auth0 Callback API [/auth0/callback] +## Auth0 Callback API [/auth0/callback{?code}{?state}] ### Auth0 Callback API [GET] + Parameters @@ -11428,791 +11357,792 @@ Managing SRM Contests APIs + Response 200 (application/json) -[ - { - "contestId": 1000, - "name": "SRM 67 DIV 2", - "startDate": null, - "endDate": null, - "status": "A", - "groupId": -1, - "adText": null, - "adStart": null, - "adEnd": null, - "adTask": null, - "adCommand": null, - "activateMenu": null, - "season": null - }, - { - "contestId": 1001, - "name": "Name 1", - "startDate": "2014-06-02 09:00", - "endDate": "2014-06-12 09:00", - "status": "A", - "groupId": -1, - "adText": "Ad Text 1", - "adStart": "2014-06-03 09:00", - "adEnd": "2014-06-08 09:00", - "adTask": "Ad Task 1", - "adCommand": "Ad Command 1", - "activateMenu": 0, - "season": { - "seasonId": 3001, - "name": "Season 1" - } - } -] + [ + { + "contestId": 1000, + "name": "SRM 67 DIV 2", + "startDate": null, + "endDate": null, + "status": "A", + "groupId": -1, + "adText": null, + "adStart": null, + "adEnd": null, + "adTask": null, + "adCommand": null, + "activateMenu": null, + "season": null + }, + { + "contestId": 1001, + "name": "Name 1", + "startDate": "2014-06-02 09:00", + "endDate": "2014-06-12 09:00", + "status": "A", + "groupId": -1, + "adText": "Ad Text 1", + "adStart": "2014-06-03 09:00", + "adEnd": "2014-06-08 09:00", + "adTask": "Ad Task 1", + "adCommand": "Ad Command 1", + "activateMenu": 0, + "season": { + "seasonId": 3001, + "name": "Season 1" + } + } + ] + Response 401 (application/json) -{ - "error": { - "name": "Unauthorized", - "value": 401, - "description": "The request is understood, but it has been refused or access is not allowed.", - "details": "Authorized access only." - } -} + { + "error": { + "name": "Unauthorized", + "value": 401, + "description": "The request is understood, but it has been refused or access is not allowed.", + "details": "Authorized access only." + } + } + Response 403 (application/json) -{ - "error": { - "name": "Forbidden", - "value": 403, - "description": "The request is understood, but it has been refused or access is not allowed.", - "details": "Admin access only." - } -} - -## Create New Contest [/data/srm/contests] + { + "error": { + "name": "Forbidden", + "value": 403, + "description": "The request is understood, but it has been refused or access is not allowed.", + "details": "Admin access only." + } + } ### Create New Contest [POST] -+ Parameters - + name (required, string, `Name`) ... The contest name. - + startDate (string, `2014-06-01 09:00`) ... The contest start date. - + endDate (string, `2014-06-01 09:00`) ... The contest end date. - + status (string, has length 1, `A`) ... The contest status. - + groupId (number, `1`) ... The group id. - + adText (string, max length 250, `Ad Text`) ... The ad text. - + adStart (string, `2014-06-01 09:00`) ... The ad start. - + adEnd (string, `2014-06-01 09:00`) ... The ad end. - + adTask (string, max length 30 ,`Ad Task`) ... The ad task. - + adCommand (string, max length 30, `Ad Command`) ... The ad command. - + activateMenu (number, `0`) ... The activate menu flag. - + seasonId (number, `123456`) ... The season id. - -+ Response 200 (application/json) ++ Attributes + + name: `Name` (required, string) ... The contest name. + + startDate: `2014-06-01 09:00` (string) ... The contest start date. + + endDate: `2014-06-01 09:00` (string) ... The contest end date. + + status: `A` (string) ... The contest status. Has length 1. + + groupId: `1` (number) ... The group id. + + adText: `Ad Text` (string) ... The ad text, max length 250. + + adStart: `2014-06-01 09:00` (string) ... The ad start. + + adEnd: `2014-06-01 09:00` (string) ... The ad end. + + adTask: `Ad Task` (string) ... The ad task, max length 30. + + adCommand: `Ad Command` (string) ... The ad command, max length 30. + + activateMenu: `0` (number) ... The activate menu flag. + + seasonId: `123456` (number) ... The season id. - { - "contestId": 132678 - } ++ Request Create New Contest (application/json) -+ Response 400 (application/json) ++ Response 200 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "name should be defined." - } -} + { + "contestId": 132678 + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "name should be string." - } -} - -+ Response 400 (application/json) - -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "name should be non-null and non-empty string." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "name should be defined." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "Length of name must not exceed 50 characters." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "name should be string." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "name contains unescaped quotes." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "name should be non-null and non-empty string." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "startDate is not a valid date." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "Length of name must not exceed 50 characters." + } + } + ++ Response 400 (application/json) + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "name contains unescaped quotes." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "endDate is not a valid date." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "startDate is not a valid date." + } + } + + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "startDate does not precede endDate." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "endDate is not a valid date." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "status should be string." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "startDate does not precede endDate." + } + } ++ Response 400 (application/json) + + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "status should be string." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "status must be of length 1" - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "status must be of length 1" + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "status unknown." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "status unknown." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "groupId should be number." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "groupId should be number." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "groupId is unknown." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "groupId is unknown." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "adText should be string." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "adText should be string." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "Length of adText must not exceed 250 characters." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "Length of adText must not exceed 250 characters." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "adText contains unescaped quotes." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "adText contains unescaped quotes." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "adStart is not a valid date." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "adStart is not a valid date." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "adEnd is not a valid date." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "adEnd is not a valid date." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "adStart does not precede adEnd." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "adStart does not precede adEnd." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "adTask should be string." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "adTask should be string." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "Length of adTask must not exceed 30 characters." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "Length of adTask must not exceed 30 characters." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "adTask contains unescaped quotes." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "adTask contains unescaped quotes." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "adCommand should be string." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "adCommand should be string." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "Length of adCommand must not exceed 30 characters." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "Length of adCommand must not exceed 30 characters." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "adCommand contains unescaped quotes." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "adCommand contains unescaped quotes." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "activateMenu should be number." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "activateMenu should be number." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "seasonId should be number." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "seasonId should be number." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "seasonId is unknown." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "seasonId is unknown." + } + } + Response 401 (application/json) -{ - "error": { - "name": "Unauthorized", - "value": 401, - "description": "The request is understood, but it has been refused or access is not allowed.", - "details": "Authorized access only." - } -} + { + "error": { + "name": "Unauthorized", + "value": 401, + "description": "The request is understood, but it has been refused or access is not allowed.", + "details": "Authorized access only." + } + } + Response 403 (application/json) -{ - "error": { - "name": "Forbidden", - "value": 403, - "description": "The request is understood, but it has been refused or access is not allowed.", - "details": "Admin access only." - } -} + { + "error": { + "name": "Forbidden", + "value": 403, + "description": "The request is understood, but it has been refused or access is not allowed.", + "details": "Admin access only." + } + } ## Modify Contest [/data/srm/contests/{id}] ### Modify Contest [PUT] -+ Parameters - + id (required, number, `123456`) ... The id of the contest to be modified. - + name (required, string, `Name`) ... The new contest name. - + contestId (required, number, `123456`) ... The new contest id. - + startDate (string, `2014-06-01 09:00`) ... The new contest start date. - + endDate (string, `2014-06-01 09:00`) ... The new contest end date. - + status (string, has length 1, `A`) ... The new contest status. - + groupId (number, `1`) ... The new group id. - + adText (string, max length 250, `Ad Text`) ... The new ad text. - + adStart (string, `2014-06-01 09:00`) ... The new ad start. - + adEnd (string, `2014-06-01 09:00`) ... The new ad end. - + adTask (string, max length 30 ,`Ad Task`) ... The new ad task. - + adCommand (string, max length 30, `Ad Command`) ... The new ad command. - + activateMenu (number, `0`) ... The new activate menu flag. - + seasonId (number, `123456`) ... The new season id. ++ Attributes + + id: `123456` (required, number) ... The id of the contest to be modified. + + name: `Name` (required, string) ... The new contest name. + + contestId: `123456` (required, number) ... The new contest id. + + startDate: `2014-06-01 09:00` (string) ... The new contest start date. + + endDate: `2014-06-01 09:00` (string) ... The new contest end date. + + status: `A` (string) ... The new contest status, has length 1. + + groupId: `1` (number) ... The new group id. + + adText: `Ad Text` (string) ... The new ad text, max length 250. + + adStart: `2014-06-01 09:00` (string) ... The new ad start. + + adEnd: `2014-06-01 09:00` (string) ... The new ad end. + + adTask: `Ad Task` (string) ... The new ad task, max length 30. + + adCommand: `Ad Command` (string) ... The new ad command, max length 30. + + activateMenu: `0` (number) ... The new activate menu flag. + + seasonId: `123456` (number) ... The new season id. + ++ Request Modify Contest (application/json) + Response 200 (application/json) -{"success": true} + {"success": true} + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "id should be number." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "id should be number." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "id is unknown." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "id is unknown." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "contestId should be number." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "contestId should be number." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "name should be string." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "name should be string." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "Length of name must not exceed 50 characters." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "Length of name must not exceed 50 characters." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "name contains unescaped quotes." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "name contains unescaped quotes." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "startDate is not a valid date." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "startDate is not a valid date." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "endDate is not a valid date." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "endDate is not a valid date." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "startDate does not precede endDate." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "startDate does not precede endDate." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "status should be string." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "status should be string." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "status must be of length 1" - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "status must be of length 1" + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "status unknown." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "status unknown." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "groupId should be number." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "groupId should be number." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "groupId is unknown." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "groupId is unknown." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "adText should be string." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "adText should be string." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "Length of adText must not exceed 250 characters." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "Length of adText must not exceed 250 characters." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "adText contains unescaped quotes." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "adText contains unescaped quotes." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "adStart is not a valid date." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "adStart is not a valid date." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "adEnd is not a valid date." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "adEnd is not a valid date." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "adStart does not precede adEnd." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "adStart does not precede adEnd." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "adTask should be string." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "adTask should be string." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "Length of adTask must not exceed 30 characters." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "Length of adTask must not exceed 30 characters." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "adTask contains unescaped quotes." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "adTask contains unescaped quotes." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "adCommand should be string." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "adCommand should be string." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "Length of adCommand must not exceed 30 characters." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "Length of adCommand must not exceed 30 characters." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "adCommand contains unescaped quotes." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "adCommand contains unescaped quotes." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "activateMenu should be number." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "activateMenu should be number." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "seasonId should be number." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "seasonId should be number." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "seasonId is unknown." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "seasonId is unknown." + } + } + Response 401 (application/json) -{ - "error": { - "name": "Unauthorized", - "value": 401, - "description": "The request is understood, but it has been refused or access is not allowed.", - "details": "Authorized access only." - } -} + { + "error": { + "name": "Unauthorized", + "value": 401, + "description": "The request is understood, but it has been refused or access is not allowed.", + "details": "Authorized access only." + } + } + Response 403 (application/json) -{ - "error": { - "name": "Forbidden", - "value": 403, - "description": "The request is understood, but it has been refused or access is not allowed.", - "details": "Admin access only." - } -} + { + "error": { + "name": "Forbidden", + "value": 403, + "description": "The request is understood, but it has been refused or access is not allowed.", + "details": "Admin access only." + } + } -## Set Survey API [/data/srm/rounds/:roundId/survey] +## Set Survey API [/data/srm/rounds/{roundId}/survey] ### Set Survey API [POST] @@ -12223,101 +12153,102 @@ Managing SRM Contests APIs + Headers - Authorization : Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZHwxMzI0NTYiLCJleHAiOjEzOTI4MTc4ODQsImF1ZCI6InRvcGNvZGVyIiwiaWF0IjoxMzkyNzU3ODg0fQ.7X2IKkiyyI1ExSM5GNpdhJ8fGGK5-oAjzccX6YL_BKY + Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZHwxMzI0NTYiLCJleHAiOjEzOTI4MTc4ODQsImF1ZCI6InRvcGNvZGVyIiwiaWF0IjoxMzkyNzU3ODg0fQ.7X2IKkiyyI1ExSM5GNpdhJ8fGGK5-oAjzccX6YL_BKY + Response 200 (application/json) -{ - "success": true -} + { + "success": true + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "roundId should be number." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "roundId should be number." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "roundId should be Integer." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "roundId should be Integer." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "roundId should be positive." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "roundId should be positive." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "roundId should be less or equal to 2147483647." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "roundId should be less or equal to 2147483647." + } + } + Response 401 (application/json) -{ - "error": { - "name": "Unauthorized", - "value": 401, - "description": "The request is understood, but it has been refused or access is not allowed.", - "details": "Authorized information needed." - } -} + { + "error": { + "name": "Unauthorized", + "value": 401, + "description": "The request is understood, but it has been refused or access is not allowed.", + "details": "Authorized information needed." + } + } + Response 403 (application/json) -{ - "error": { - "name": "Forbidden", - "value": 403, - "description": "The request is understood, but it has been refused or access is not allowed.", - "details": "Admin access only." - } -} + { + "error": { + "name": "Forbidden", + "value": 403, + "description": "The request is understood, but it has been refused or access is not allowed.", + "details": "Admin access only." + } + } + Response 500 (application/json) -{ - "error": { - "name":"Internal Server Error", - "value":"500", - "description":"Unknown server error. Please contact support." + { + "error": { + "name":"Internal Server Error", + "value":"500", + "description":"Unknown server error. Please contact support." + } } -} + Response 503 (application/json) -{ - "error": { - "name":"Service Unavailable", - "value":"503", - "description":"Servers are up but overloaded. Try again later." + + { + "error": { + "name":"Service Unavailable", + "value":"503", + "description":"Servers are up but overloaded. Try again later." + } } -} -## Get Round Questions API [/data/srm/rounds/:roundId/questions] +## Get Round Questions API [/data/srm/rounds/{roundId}/questions] ### Get Round Questions API [GET] @@ -12328,704 +12259,709 @@ Managing SRM Contests APIs + Headers - Authorization : Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZHwxMzI0NTYiLCJleHAiOjEzOTI4MTc4ODQsImF1ZCI6InRvcGNvZGVyIiwiaWF0IjoxMzkyNzU3ODg0fQ.7X2IKkiyyI1ExSM5GNpdhJ8fGGK5-oAjzccX6YL_BKY + Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZHwxMzI0NTYiLCJleHAiOjEzOTI4MTc4ODQsImF1ZCI6InRvcGNvZGVyIiwiaWF0IjoxMzkyNzU3ODg0fQ.7X2IKkiyyI1ExSM5GNpdhJ8fGGK5-oAjzccX6YL_BKY + Response 200 (application/json) -{ - "questions": [ { - "id": 1000032, - "keyword": "keyword1", - "status": { - "id": 1, - "description": "ACTIVE" - }, - "style": { - "id": 1, - "description": "Single Choice" - }, - "text": "text2", - "type": { - "id": 1, - "description": "SRM Survey" - }, - "isRequired": true + "questions": [ + { + "id": 1000032, + "keyword": "keyword1", + "status": { + "id": 1, + "description": "ACTIVE" + }, + "style": { + "id": 1, + "description": "Single Choice" + }, + "text": "text2", + "type": { + "id": 1, + "description": "SRM Survey" + }, + "isRequired": true + } + ] } - ] -} + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "roundId should be number." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "roundId should be number." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "roundId should be Integer." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "roundId should be Integer." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "roundId should be positive." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "roundId should be positive." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "roundId should be less or equal to 2147483647." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "roundId should be less or equal to 2147483647." + } + } + Response 401 (application/json) -{ - "error": { - "name": "Unauthorized", - "value": 401, - "description": "The request is understood, but it has been refused or access is not allowed.", - "details": "Authorized information needed." - } -} + { + "error": { + "name": "Unauthorized", + "value": 401, + "description": "The request is understood, but it has been refused or access is not allowed.", + "details": "Authorized information needed." + } + } + Response 403 (application/json) -{ - "error": { - "name": "Forbidden", - "value": 403, - "description": "The request is understood, but it has been refused or access is not allowed.", - "details": "Admin access only." - } -} + { + "error": { + "name": "Forbidden", + "value": 403, + "description": "The request is understood, but it has been refused or access is not allowed.", + "details": "Admin access only." + } + } + Response 500 (application/json) -{ - "error": { - "name":"Internal Server Error", - "value":"500", - "description":"Unknown server error. Please contact support." + { + "error": { + "name":"Internal Server Error", + "value":"500", + "description":"Unknown server error. Please contact support." + } } -} + Response 503 (application/json) -{ - "error": { - "name":"Service Unavailable", - "value":"503", - "description":"Servers are up but overloaded. Try again later." - } -} -## Add Round Question API [/data/srm/rounds/:roundId/questions] + { + "error": { + "name":"Service Unavailable", + "value":"503", + "description":"Servers are up but overloaded. Try again later." + } + } ### Add Round Question API [POST] + Parameters - + roundId (required, number, `13672`) ... The id of the round to set. - + text (required, text, `text1`) ... The text parameter. - + styleId (required, number, 1) ... The id of the style to set. - + typeId (required, number, 1) ... The id of the type to set. - + statusId (required, number, 1) ... The id of the status to set. - + keyword (optional, text, `keyword1`) ... The keyword parameter. - + isRequired (optional, boolean, true) ... The required flag. + + roundId (required, number, `13672`) ... The id of the round to set. -+ Request ++ Attributes + + text: `text1` (required, string) ... The text parameter. + + styleId: `1` (required, number) ... The id of the style to set. + + typeId: `1` (required, number) ... The id of the type to set. + + statusId: `1` (required, number) ... The id of the status to set. + + keyword: `keyword1` (optional, string) ... The keyword parameter. + + isRequired: `true` (optional, boolean) ... The required flag. + ++ Request Add Round Question API (application/json) + Headers - Authorization : Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZHwxMzI0NTYiLCJleHAiOjEzOTI4MTc4ODQsImF1ZCI6InRvcGNvZGVyIiwiaWF0IjoxMzkyNzU3ODg0fQ.7X2IKkiyyI1ExSM5GNpdhJ8fGGK5-oAjzccX6YL_BKY + Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZHwxMzI0NTYiLCJleHAiOjEzOTI4MTc4ODQsImF1ZCI6InRvcGNvZGVyIiwiaWF0IjoxMzkyNzU3ODg0fQ.7X2IKkiyyI1ExSM5GNpdhJ8fGGK5-oAjzccX6YL_BKY + Response 200 (application/json) -{ - "success": true -} + { + "success": true + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "roundId should be number." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "roundId should be number." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "roundId should be Integer." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "roundId should be Integer." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "roundId should be positive." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "roundId should be positive." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "roundId should be less or equal to 2147483647." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "roundId should be less or equal to 2147483647." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "text should be string.." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "text should be string.." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "text exceeds 2048 characters." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "text exceeds 2048 characters." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "keyword should be string." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "keyword should be string." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "keyword exceeds 64 characters." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "keyword exceeds 64 characters." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "The isRequired should be boolean type." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "The isRequired should be boolean type." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "statusId should be number." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "statusId should be number." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "statusId should be Integer." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "statusId should be Integer." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "statusId should be greater or equal to 0." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "statusId should be greater or equal to 0." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "The statusId does not exist in database." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "The statusId does not exist in database." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "typeId should be number." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "typeId should be number." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "typeId should be Integer." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "typeId should be Integer." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "typeId should be greater or equal to 0." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "typeId should be greater or equal to 0." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "The typeId does not exist in database." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "The typeId does not exist in database." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "styleId should be number." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "styleId should be number." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "styleId should be Integer." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "styleId should be Integer." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "styleId should be greater or equal to 0." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "styleId should be greater or equal to 0." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "The styleId does not exist in database." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "The styleId does not exist in database." + } + } + Response 401 (application/json) -{ - "error": { - "name": "Unauthorized", - "value": 401, - "description": "The request is understood, but it has been refused or access is not allowed.", - "details": "Authorized information needed." - } -} + { + "error": { + "name": "Unauthorized", + "value": 401, + "description": "The request is understood, but it has been refused or access is not allowed.", + "details": "Authorized information needed." + } + } + Response 403 (application/json) -{ - "error": { - "name": "Forbidden", - "value": 403, - "description": "The request is understood, but it has been refused or access is not allowed.", - "details": "Admin access only." - } -} + { + "error": { + "name": "Forbidden", + "value": 403, + "description": "The request is understood, but it has been refused or access is not allowed.", + "details": "Admin access only." + } + } + Response 500 (application/json) -{ - "error": { - "name":"Internal Server Error", - "value":"500", - "description":"Unknown server error. Please contact support." + { + "error": { + "name":"Internal Server Error", + "value":"500", + "description":"Unknown server error. Please contact support." + } } -} + Response 503 (application/json) -{ - "error": { - "name":"Service Unavailable", - "value":"503", - "description":"Servers are up but overloaded. Try again later." + + { + "error": { + "name":"Service Unavailable", + "value":"503", + "description":"Servers are up but overloaded. Try again later." + } } -} -## Modify Round Question API [/data/srm/rounds/:questionId/questions] +## Modify Round Question API [/data/srm/rounds/{questionId}/questions] ### Modify Round Question API [PUT] + Parameters - + questionId (required, number, `1000001`) ... The id of the question to set. - + text (required, text, `text1`) ... The text parameter. - + styleId (required, number, 1) ... The id of the style to set. - + typeId (required, number, 1) ... The id of the type to set. - + statusId (required, number, 1) ... The id of the status to set. - + keyword (optional, text, `keyword1`) ... The keyword parameter. + + questionId (required, number, `1000001`) ... The id of the question to set. -+ Request ++ Attributes + + text: `text1` (required, string) ... The text parameter. + + styleId: `1` (required, number) ... The id of the style to set. + + typeId: `1` (required, number) ... The id of the type to set. + + statusId: `1` (required, number) ... The id of the status to set. + + keyword: `keyword1` (optional, string) ... The keyword parameter. + ++ Request Modify Round Question API (application/json) + Headers - Authorization : Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZHwxMzI0NTYiLCJleHAiOjEzOTI4MTc4ODQsImF1ZCI6InRvcGNvZGVyIiwiaWF0IjoxMzkyNzU3ODg0fQ.7X2IKkiyyI1ExSM5GNpdhJ8fGGK5-oAjzccX6YL_BKY + Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZHwxMzI0NTYiLCJleHAiOjEzOTI4MTc4ODQsImF1ZCI6InRvcGNvZGVyIiwiaWF0IjoxMzkyNzU3ODg0fQ.7X2IKkiyyI1ExSM5GNpdhJ8fGGK5-oAjzccX6YL_BKY + Response 200 (application/json) -{ - "success": true -} + { + "success": true + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "questionId should be number." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "questionId should be number." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "questionId should be Integer." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "questionId should be Integer." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "questionId should be positive." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "questionId should be positive." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "questionId should be less or equal to 2147483647." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "questionId should be less or equal to 2147483647." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "text should be string.." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "text should be string.." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "text exceeds 2048 characters." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "text exceeds 2048 characters." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "keyword should be string." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "keyword should be string." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "keyword exceeds 64 characters." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "keyword exceeds 64 characters." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "statusId should be number." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "statusId should be number." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "statusId should be Integer." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "statusId should be Integer." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "statusId should be greater or equal to 0." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "statusId should be greater or equal to 0." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "The statusId does not exist in database." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "The statusId does not exist in database." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "typeId should be number." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "typeId should be number." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "typeId should be Integer." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "typeId should be Integer." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "typeId should be greater or equal to 0." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "typeId should be greater or equal to 0." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "The typeId does not exist in database." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "The typeId does not exist in database." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "styleId should be number." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "styleId should be number." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "styleId should be Integer." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "styleId should be Integer." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "styleId should be greater or equal to 0." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "styleId should be greater or equal to 0." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "The styleId does not exist in database." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "The styleId does not exist in database." + } + } + Response 401 (application/json) -{ - "error": { - "name": "Unauthorized", - "value": 401, - "description": "The request is understood, but it has been refused or access is not allowed.", - "details": "Authorized information needed." - } -} + { + "error": { + "name": "Unauthorized", + "value": 401, + "description": "The request is understood, but it has been refused or access is not allowed.", + "details": "Authorized information needed." + } + } + Response 403 (application/json) -{ - "error": { - "name": "Forbidden", - "value": 403, - "description": "The request is understood, but it has been refused or access is not allowed.", - "details": "Admin access only." - } -} + { + "error": { + "name": "Forbidden", + "value": 403, + "description": "The request is understood, but it has been refused or access is not allowed.", + "details": "Admin access only." + } + } + Response 500 (application/json) -{ - "error": { - "name":"Internal Server Error", - "value":"500", - "description":"Unknown server error. Please contact support." + { + "error": { + "name":"Internal Server Error", + "value":"500", + "description":"Unknown server error. Please contact support." + } } -} + Response 503 (application/json) -{ - "error": { - "name":"Service Unavailable", - "value":"503", - "description":"Servers are up but overloaded. Try again later." + + { + "error": { + "name":"Service Unavailable", + "value":"503", + "description":"Servers are up but overloaded. Try again later." + } } -} -## Delete Round Question API [/data/srm/rounds/:questionId/question] +## Delete Round Question API [/data/srm/rounds/{questionId}/question] ### Delete Round Question API [DELETE] @@ -13036,385 +12972,390 @@ Managing SRM Contests APIs + Headers - Authorization : Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZHwxMzI0NTYiLCJleHAiOjEzOTI4MTc4ODQsImF1ZCI6InRvcGNvZGVyIiwiaWF0IjoxMzkyNzU3ODg0fQ.7X2IKkiyyI1ExSM5GNpdhJ8fGGK5-oAjzccX6YL_BKY + Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZHwxMzI0NTYiLCJleHAiOjEzOTI4MTc4ODQsImF1ZCI6InRvcGNvZGVyIiwiaWF0IjoxMzkyNzU3ODg0fQ.7X2IKkiyyI1ExSM5GNpdhJ8fGGK5-oAjzccX6YL_BKY + Response 200 (application/json) -{ - "success": true -} + { + "success": true + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "questionId should be number." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "questionId should be number." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "questionId should be Integer." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "questionId should be Integer." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "questionId should be positive." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "questionId should be positive." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "questionId should be less or equal to 2147483647." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "questionId should be less or equal to 2147483647." + } + } + Response 401 (application/json) -{ - "error": { - "name": "Unauthorized", - "value": 401, - "description": "The request is understood, but it has been refused or access is not allowed.", - "details": "Authorized information needed." - } -} + { + "error": { + "name": "Unauthorized", + "value": 401, + "description": "The request is understood, but it has been refused or access is not allowed.", + "details": "Authorized information needed." + } + } + Response 403 (application/json) -{ - "error": { - "name": "Forbidden", - "value": 403, - "description": "The request is understood, but it has been refused or access is not allowed.", - "details": "Admin access only." - } -} + { + "error": { + "name": "Forbidden", + "value": 403, + "description": "The request is understood, but it has been refused or access is not allowed.", + "details": "Admin access only." + } + } + Response 500 (application/json) -{ - "error": { - "name":"Internal Server Error", - "value":"500", - "description":"Unknown server error. Please contact support." + { + "error": { + "name":"Internal Server Error", + "value":"500", + "description":"Unknown server error. Please contact support." + } } -} + Response 503 (application/json) -{ - "error": { - "name":"Service Unavailable", - "value":"503", - "description":"Servers are up but overloaded. Try again later." + + { + "error": { + "name":"Service Unavailable", + "value":"503", + "description":"Servers are up but overloaded. Try again later." + } } -} -## Get Round Question Answers API [/data/srm/rounds/:questionId/answers] +## Get Round Question Answers API [/data/srm/rounds/{questionId}/answers] ### Get Round Question Answers API [GET] + Parameters - + questionId (required, number, `13672`) ... The id of the question to get. + + questionId (required, number, `13672`) ... The id of the question to get. + Request + Headers - Authorization : Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZHwxMzI0NTYiLCJleHAiOjEzOTI4MTc4ODQsImF1ZCI6InRvcGNvZGVyIiwiaWF0IjoxMzkyNzU3ODg0fQ.7X2IKkiyyI1ExSM5GNpdhJ8fGGK5-oAjzccX6YL_BKY + Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZHwxMzI0NTYiLCJleHAiOjEzOTI4MTc4ODQsImF1ZCI6InRvcGNvZGVyIiwiaWF0IjoxMzkyNzU3ODg0fQ.7X2IKkiyyI1ExSM5GNpdhJ8fGGK5-oAjzccX6YL_BKY + Response 200 (application/json) -{ - "answers": [ { - "id": 1000033, - "text": "text2", - "sortOrder": 1, - "correct": true + "answers": [ + { + "id": 1000033, + "text": "text2", + "sortOrder": 1, + "correct": true + } + ] } - ] -} + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "questionId should be number." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "questionId should be number." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "questionId should be Integer." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "questionId should be Integer." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "questionId should be positive." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "questionId should be positive." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "questionId should be less or equal to 2147483647." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "questionId should be less or equal to 2147483647." + } + } + Response 401 (application/json) -{ - "error": { - "name": "Unauthorized", - "value": 401, - "description": "The request is understood, but it has been refused or access is not allowed.", - "details": "Authorized information needed." - } -} + { + "error": { + "name": "Unauthorized", + "value": 401, + "description": "The request is understood, but it has been refused or access is not allowed.", + "details": "Authorized information needed." + } + } + Response 403 (application/json) -{ - "error": { - "name": "Forbidden", - "value": 403, - "description": "The request is understood, but it has been refused or access is not allowed.", - "details": "Admin access only." - } -} + { + "error": { + "name": "Forbidden", + "value": 403, + "description": "The request is understood, but it has been refused or access is not allowed.", + "details": "Admin access only." + } + } + Response 500 (application/json) -{ - "error": { - "name":"Internal Server Error", - "value":"500", - "description":"Unknown server error. Please contact support." + { + "error": { + "name":"Internal Server Error", + "value":"500", + "description":"Unknown server error. Please contact support." + } } -} + Response 503 (application/json) -{ - "error": { - "name":"Service Unavailable", - "value":"503", - "description":"Servers are up but overloaded. Try again later." + + { + "error": { + "name":"Service Unavailable", + "value":"503", + "description":"Servers are up but overloaded. Try again later." + } } -} -## Add Round Question Answer API [/data/srm/questions/:questionId/answers] +## Add Round Question Answer API [/data/srm/questions/{questionId}/answers] ### Add Round Question Answer API [POST] + Parameters - + questionId (required, number, `1000001`) ... The id of the question to set. - + text (required, text, `text1`) ... The text parameter. - + sortOrder (optional, number, 1) ... The sort order to set. - + correct (optional, boolean, true) ... The correct parameter. + + questionId (required, number, `1000001`) ... The id of the question to set. -+ Request ++ Attributes + + text: `text1` (required, string) ... The text parameter. + + sortOrder: `1` (optional, number) ... The sort order to set. + + correct: `true` (optional, boolean) ... The correct parameter. + ++ Request Add Round Question Answer API (application/json) + Headers - Authorization : Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZHwxMzI0NTYiLCJleHAiOjEzOTI4MTc4ODQsImF1ZCI6InRvcGNvZGVyIiwiaWF0IjoxMzkyNzU3ODg0fQ.7X2IKkiyyI1ExSM5GNpdhJ8fGGK5-oAjzccX6YL_BKY + Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZHwxMzI0NTYiLCJleHAiOjEzOTI4MTc4ODQsImF1ZCI6InRvcGNvZGVyIiwiaWF0IjoxMzkyNzU3ODg0fQ.7X2IKkiyyI1ExSM5GNpdhJ8fGGK5-oAjzccX6YL_BKY + Response 200 (application/json) -{ - "success": true -} + { + "success": true + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "questionId should be number." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "questionId should be number." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "questionId should be Integer." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "questionId should be Integer." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "questionId should be positive." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "questionId should be positive." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "questionId should be less or equal to 2147483647." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "questionId should be less or equal to 2147483647." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "text should be string.." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "text should be string.." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "text exceeds 2048 characters." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "text exceeds 2048 characters." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "sortOrder should be number." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "sortOrder should be number." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "sortOrder should be Integer." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "sortOrder should be Integer." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "sortOrder should be positive." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "sortOrder should be positive." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "The correct should be boolean type." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "The correct should be boolean type." + } + } + Response 401 (application/json) -{ - "error": { - "name": "Unauthorized", - "value": 401, - "description": "The request is understood, but it has been refused or access is not allowed.", - "details": "Authorized information needed." - } -} + { + "error": { + "name": "Unauthorized", + "value": 401, + "description": "The request is understood, but it has been refused or access is not allowed.", + "details": "Authorized information needed." + } + } + Response 403 (application/json) -{ - "error": { - "name": "Forbidden", - "value": 403, - "description": "The request is understood, but it has been refused or access is not allowed.", - "details": "Admin access only." - } -} + { + "error": { + "name": "Forbidden", + "value": 403, + "description": "The request is understood, but it has been refused or access is not allowed.", + "details": "Admin access only." + } + } + Response 500 (application/json) -{ - "error": { - "name":"Internal Server Error", - "value":"500", - "description":"Unknown server error. Please contact support." + { + "error": { + "name":"Internal Server Error", + "value":"500", + "description":"Unknown server error. Please contact support." + } } -} + Response 503 (application/json) -{ - "error": { - "name":"Service Unavailable", - "value":"503", - "description":"Servers are up but overloaded. Try again later." + + { + "error": { + "name":"Service Unavailable", + "value":"503", + "description":"Servers are up but overloaded. Try again later." + } } -} @@ -13426,487 +13367,490 @@ Managing SRM Contests APIs + Headers - Authorization : Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZHwxMzI0NTYiLCJleHAiOjEzOTI4MTc4ODQsImF1ZCI6InRvcGNvZGVyIiwiaWF0IjoxMzkyNzU3ODg0fQ.7X2IKkiyyI1ExSM5GNpdhJ8fGGK5-oAjzccX6YL_BKY + Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZHwxMzI0NTYiLCJleHAiOjEzOTI4MTc4ODQsImF1ZCI6InRvcGNvZGVyIiwiaWF0IjoxMzkyNzU3ODg0fQ.7X2IKkiyyI1ExSM5GNpdhJ8fGGK5-oAjzccX6YL_BKY + Response 200 (application/json) -{ - "problems": [ - { - "id": 10194, - "name": "BlackAndWhiteGame", - "type": { - "id": 3, - "description": "Long" - }, - "status": { - "id": 90, - "description": "Used" - } - }, { - "id": 10195, - "name": "TestProblem", - "type": { - "id": 1, - "description": "Single" - }, - "status": { - "id": 90, - "description": "Used" - } + "problems": [ + { + "id": 10194, + "name": "BlackAndWhiteGame", + "type": { + "id": 3, + "description": "Long" + }, + "status": { + "id": 90, + "description": "Used" + } + }, + { + "id": 10195, + "name": "TestProblem", + "type": { + "id": 1, + "description": "Single" + }, + "status": { + "id": 90, + "description": "Used" + } + } + ] } - ] -} + Response 401 (application/json) -{ - "error": { - "name": "Unauthorized", - "value": 401, - "description": "The request is understood, but it has been refused or access is not allowed.", - "details": "Authorized information needed." - } -} + { + "error": { + "name": "Unauthorized", + "value": 401, + "description": "The request is understood, but it has been refused or access is not allowed.", + "details": "Authorized information needed." + } + } + Response 403 (application/json) -{ - "error": { - "name": "Forbidden", - "value": 403, - "description": "The request is understood, but it has been refused or access is not allowed.", - "details": "Admin access only." - } -} + { + "error": { + "name": "Forbidden", + "value": 403, + "description": "The request is understood, but it has been refused or access is not allowed.", + "details": "Admin access only." + } + } + Response 500 (application/json) -{ - "error": { - "name":"Internal Server Error", - "value":"500", - "description":"Unknown server error. Please contact support." + { + "error": { + "name":"Internal Server Error", + "value":"500", + "description":"Unknown server error. Please contact support." + } } -} + Response 503 (application/json) -{ - "error": { - "name":"Service Unavailable", - "value":"503", - "description":"Servers are up but overloaded. Try again later." + + { + "error": { + "name":"Service Unavailable", + "value":"503", + "description":"Servers are up but overloaded. Try again later." + } } -} -## List Round Problems API [/data/srm/rounds/:roundId/problems] +## List Round Problems API [/data/srm/rounds/{roundId}/problems] ### List Round Problems API [GET] + Parameters - + roundId (required, number, `13672`) ... The id of the round to get. + + roundId (required, number, `13672`) ... The id of the round to get. + Request + Headers - Authorization : Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZHwxMzI0NTYiLCJleHAiOjEzOTI4MTc4ODQsImF1ZCI6InRvcGNvZGVyIiwiaWF0IjoxMzkyNzU3ODg0fQ.7X2IKkiyyI1ExSM5GNpdhJ8fGGK5-oAjzccX6YL_BKY + Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZHwxMzI0NTYiLCJleHAiOjEzOTI4MTc4ODQsImF1ZCI6InRvcGNvZGVyIiwiaWF0IjoxMzkyNzU3ODg0fQ.7X2IKkiyyI1ExSM5GNpdhJ8fGGK5-oAjzccX6YL_BKY + Response 200 (application/json) -{ - "assignedProblems": [ - { - "division": { - "id": 1, - "desc": "Division-I" - }, - "problemData": { - "id": 10194, - "name": "BlackAndWhiteGame", - "type": { - "id": 3, - "description": "Long" - }, - "status": { - "id": 90, - "description": "Used" - } - } - }, { - "division": { - "id": 2, - "desc": "Division-II" - }, - "problemData": { - "id": 10195, - "name": "TestProblem", - "type": { - "id": 1, - "description": "Single" + "assignedProblems": [ + { + "division": { + "id": 1, + "desc": "Division-I" + }, + "problemData": { + "id": 10194, + "name": "BlackAndWhiteGame", + "type": { + "id": 3, + "description": "Long" + }, + "status": { + "id": 90, + "description": "Used" + } + } }, - "status": { - "id": 90, - "description": "Used" + { + "division": { + "id": 2, + "desc": "Division-II" + }, + "problemData": { + "id": 10195, + "name": "TestProblem", + "type": { + "id": 1, + "description": "Single" + }, + "status": { + "id": 90, + "description": "Used" + } + } } - } + ] } - ] -} + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "roundId should be number." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "roundId should be number." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "roundId should be Integer." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "roundId should be Integer." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "roundId should be positive." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "roundId should be positive." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "roundId should be less or equal to 2147483647." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "roundId should be less or equal to 2147483647." + } + } + Response 401 (application/json) -{ - "error": { - "name": "Unauthorized", - "value": 401, - "description": "The request is understood, but it has been refused or access is not allowed.", - "details": "Authorized information needed." - } -} + { + "error": { + "name": "Unauthorized", + "value": 401, + "description": "The request is understood, but it has been refused or access is not allowed.", + "details": "Authorized information needed." + } + } + Response 403 (application/json) -{ - "error": { - "name": "Forbidden", - "value": 403, - "description": "The request is understood, but it has been refused or access is not allowed.", - "details": "Admin access only." - } -} + { + "error": { + "name": "Forbidden", + "value": 403, + "description": "The request is understood, but it has been refused or access is not allowed.", + "details": "Admin access only." + } + } + Response 500 (application/json) -{ - "error": { - "name":"Internal Server Error", - "value":"500", - "description":"Unknown server error. Please contact support." + { + "error": { + "name":"Internal Server Error", + "value":"500", + "description":"Unknown server error. Please contact support." + } } -} + Response 503 (application/json) -{ - "error": { - "name":"Service Unavailable", - "value":"503", - "description":"Servers are up but overloaded. Try again later." + + { + "error": { + "name":"Service Unavailable", + "value":"503", + "description":"Servers are up but overloaded. Try again later." + } } -} -## List Round Problem Components API [/data/srm/rounds/:roundId/components] +## List Round Problem Components API [/data/srm/rounds/{roundId}/components{?problemId}{?divisionId}] ### List Round Problem Components API [GET] + Parameters - + roundId (required, number, `13672`) ... The id of the round to get. - + problemId (optional, number, `10194`) ... The id of the problem to get. - + divisionId (optional, number, `2020`) ... The id of the division to get. + + roundId (required, number, `13672`) ... The id of the round to get. + + problemId (optional, number, `10194`) ... The id of the problem to get. + + divisionId (optional, number, `2020`) ... The id of the division to get. + Request + Headers - Authorization : Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZHwxMzI0NTYiLCJleHAiOjEzOTI4MTc4ODQsImF1ZCI6InRvcGNvZGVyIiwiaWF0IjoxMzkyNzU3ODg0fQ.7X2IKkiyyI1ExSM5GNpdhJ8fGGK5-oAjzccX6YL_BKY + Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZHwxMzI0NTYiLCJleHAiOjEzOTI4MTc4ODQsImF1ZCI6InRvcGNvZGVyIiwiaWF0IjoxMzkyNzU3ODg0fQ.7X2IKkiyyI1ExSM5GNpdhJ8fGGK5-oAjzccX6YL_BKY + Response 200 (application/json) -{ - "components": [ { - "difficulty": { - "id": 1, - "desc": "Level One" - }, - "division": { - "id": 1, - "desc": "Division-I" - }, - "openOrder": 0, - "pointValue": 500, - "componentData": { - "id": 2020, - "problemId": 10194, - "className": "BlackAndWhiteGame", - "methodName": "displayTestCase", - "resultType": "String", - "paramTypes": [ - "String" - ], - "type": { - "id": 2, - "description": "Supporting Component" - } - }, - "submitOrder": 0 - }, - { - "difficulty": { - "id": 1, - "desc": "Level One" - }, - "division": { - "id": 2, - "desc": "Division-II" - }, - "openOrder": 0, - "pointValue": 250, - "componentData": { - "id": 2021, - "problemId": 10195, - "className": "TestProblem", - "methodName": "sum", - "resultType": "int", - "paramTypes": [ - "int", - "int" - ], - "type": { - "id": 1, - "description": "Main Component" + "components": [ + { + "difficulty": { + "id": 1, + "desc": "Level One" + }, + "division": { + "id": 1, + "desc": "Division-I" + }, + "openOrder": 0, + "pointValue": 500, + "componentData": { + "id": 2020, + "problemId": 10194, + "className": "BlackAndWhiteGame", + "methodName": "displayTestCase", + "resultType": "String", + "paramTypes": [ + "String" + ], + "type": { + "id": 2, + "description": "Supporting Component" + } + }, + "submitOrder": 0 + }, + { + "difficulty": { + "id": 1, + "desc": "Level One" + }, + "division": { + "id": 2, + "desc": "Division-II" + }, + "openOrder": 0, + "pointValue": 250, + "componentData": { + "id": 2021, + "problemId": 10195, + "className": "TestProblem", + "methodName": "sum", + "resultType": "int", + "paramTypes": [ + "int", + "int" + ], + "type": { + "id": 1, + "description": "Main Component" + } + }, + "submitOrder": 0 } - }, - "submitOrder": 0 + ] } - ] -} + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "roundId should be number." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "roundId should be number." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "roundId should be Integer." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "roundId should be Integer." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "roundId should be positive." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "roundId should be positive." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "roundId should be less or equal to 2147483647." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "roundId should be less or equal to 2147483647." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "problemId should be number." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "problemId should be number." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "problemId should be Integer." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "problemId should be Integer." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "problemId should be positive." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "problemId should be positive." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "problemId should be less or equal to 2147483647." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "problemId should be less or equal to 2147483647." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "divisionId should be number." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "divisionId should be number." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "divisionId should be Integer." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "divisionId should be Integer." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "divisionId should be positive." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "divisionId should be positive." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "divisionId should be less or equal to 2147483647." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "divisionId should be less or equal to 2147483647." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "Both problemId and divisionId should be provided if you provided one of them." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "Both problemId and divisionId should be provided if you provided one of them." + } + } + Response 401 (application/json) -{ - "error": { - "name": "Unauthorized", - "value": 401, - "description": "The request is understood, but it has been refused or access is not allowed.", - "details": "Authorized information needed." - } -} + { + "error": { + "name": "Unauthorized", + "value": 401, + "description": "The request is understood, but it has been refused or access is not allowed.", + "details": "Authorized information needed." + } + } + Response 403 (application/json) -{ - "error": { - "name": "Forbidden", - "value": 403, - "description": "The request is understood, but it has been refused or access is not allowed.", - "details": "Admin access only." - } -} + { + "error": { + "name": "Forbidden", + "value": 403, + "description": "The request is understood, but it has been refused or access is not allowed.", + "details": "Admin access only." + } + } + Response 500 (application/json) -{ - "error": { - "name":"Internal Server Error", - "value":"500", - "description":"Unknown server error. Please contact support." + { + "error": { + "name":"Internal Server Error", + "value":"500", + "description":"Unknown server error. Please contact support." + } } -} + Response 503 (application/json) -{ - "error": { - "name":"Service Unavailable", - "value":"503", - "description":"Servers are up but overloaded. Try again later." + + { + "error": { + "name":"Service Unavailable", + "value":"503", + "description":"Servers are up but overloaded. Try again later." + } } -} # Group SRM Round Configuration APIs Managing SRM Round Configuration APIs @@ -13916,164 +13860,167 @@ Managing SRM Round Configuration APIs ### Set Round Room Assignment [POST] + Parameters - + roundId (required, number, `123456`) ... The round id for the room to be assigned - + isByDivision (number, `1`) ... The isByDivision flag - + isByRegion (number, `1`) ... The isByRegion flag - + isFinal (number, `1`) ... The isFinal flag - + type (number, `1`) ... The algorithm seeding - + seasonId (number, `10`) ... The number of coders per room - + p (number, `1.1`) ... The p value + + roundId (required, number, `123456`) ... The round id for the room to be assigned + ++ Attributes + + isByDivision: `1` (number) ... The isByDivision flag + + isByRegion: `1` (number) ... The isByRegion flag + + isFinal: `1` (number) ... The isFinal flag + + type: `1` (number) ... The algorithm seeding + + seasonId: `10` (number) ... The number of coders per room + + p: `1.1` (number) ... The p value ++ Request Set Round Room Assignment (application/json) + Response 200 (application/json) -{ - success: true -} + { + success: true + } + Response 400 (application/json) -{ error: - { name: 'Bad Request', - value: 400, - description: 'The request was invalid. An accompanying message will explain why.', - details: 'roundId should be number.' } } + { error: + { name: 'Bad Request', + value: 400, + description: 'The request was invalid. An accompanying message will explain why.', + details: 'roundId should be number.' } } + Response 400 (application/json) -{ error: - { name: 'Bad Request', - value: 400, - description: 'The request was invalid. An accompanying message will explain why.', - details: 'roundId should be positive.' } } + { error: + { name: 'Bad Request', + value: 400, + description: 'The request was invalid. An accompanying message will explain why.', + details: 'roundId should be positive.' } } + Response 400 (application/json) -{ error: - { name: 'Bad Request', - value: 400, - description: 'The request was invalid. An accompanying message will explain why.', - details: 'roundId does not have a round room assignment.' } } + { error: + { name: 'Bad Request', + value: 400, + description: 'The request was invalid. An accompanying message will explain why.', + details: 'roundId does not have a round room assignment.' } } + Response 400 (application/json) -{ error: - { name: 'Bad Request', - value: 400, - description: 'The request was invalid. An accompanying message will explain why.', - details: 'roundId should be less or equal to 999999999.' } } + { error: + { name: 'Bad Request', + value: 400, + description: 'The request was invalid. An accompanying message will explain why.', + details: 'roundId should be less or equal to 999999999.' } } + Response 400 (application/json) -{ error: - { name: 'Bad Request', - value: 400, - description: 'The request was invalid. An accompanying message will explain why.', - details: 'codersPerRoom should be number.' } } + { error: + { name: 'Bad Request', + value: 400, + description: 'The request was invalid. An accompanying message will explain why.', + details: 'codersPerRoom should be number.' } } + Response 400 (application/json) -{ error: - { name: 'Bad Request', - value: 400, - description: 'The request was invalid. An accompanying message will explain why.', - details: 'codersPerRoom should be positive.' } } + { error: + { name: 'Bad Request', + value: 400, + description: 'The request was invalid. An accompanying message will explain why.', + details: 'codersPerRoom should be positive.' } } + Response 400 (application/json) -{ error: - { name: 'Bad Request', - value: 400, - description: 'The request was invalid. An accompanying message will explain why.', - details: 'codersPerRoom should be less or equal to 9999.' } } + { error: + { name: 'Bad Request', + value: 400, + description: 'The request was invalid. An accompanying message will explain why.', + details: 'codersPerRoom should be less or equal to 9999.' } } + 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 number.' } } + { error: + { name: 'Bad Request', + value: 400, + description: 'The request was invalid. An accompanying message will explain why.', + details: 'type should be number.' } } + 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 positive.' } } + { error: + { name: 'Bad Request', + value: 400, + description: 'The request was invalid. An accompanying message will explain why.', + details: 'type should be positive.' } } + 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 1,2,3,4,5,6,7,8,9,10.' } } + { error: + { name: 'Bad Request', + value: 400, + description: 'The request was invalid. An accompanying message will explain why.', + details: 'type should be an element of 1,2,3,4,5,6,7,8,9,10.' } } + Response 400 (application/json) -{ error: - { name: 'Bad Request', - value: 400, - description: 'The request was invalid. An accompanying message will explain why.', - details: 'isByDivision should be an element of 0,1.' } } + { error: + { name: 'Bad Request', + value: 400, + description: 'The request was invalid. An accompanying message will explain why.', + details: 'isByDivision should be an element of 0,1.' } } + Response 400 (application/json) -{ error: - { name: 'Bad Request', - value: 400, - description: 'The request was invalid. An accompanying message will explain why.', - details: 'isByRegion should be an element of 0,1.' } } + { error: + { name: 'Bad Request', + value: 400, + description: 'The request was invalid. An accompanying message will explain why.', + details: 'isByRegion should be an element of 0,1.' } } + Response 400 (application/json) -{ error: - { name: 'Bad Request', - value: 400, - description: 'The request was invalid. An accompanying message will explain why.', - details: 'isFinal should be an element of 0,1.' } } + { error: + { name: 'Bad Request', + value: 400, + description: 'The request was invalid. An accompanying message will explain why.', + details: 'isFinal should be an element of 0,1.' } } + Response 400 (application/json) -{ error: - { name: 'Bad Request', - value: 400, - description: 'The request was invalid. An accompanying message will explain why.', - details: 'p must be a floating point number.' } } + { error: + { name: 'Bad Request', + value: 400, + description: 'The request was invalid. An accompanying message will explain why.', + details: 'p must be a floating point number.' } } + Response 400 (application/json) -{ error: - { name: 'Bad Request', - value: 400, - description: 'The request was invalid. An accompanying message will explain why.', - details: 'Precision of p must not exceed (10,2).' } } + { error: + { name: 'Bad Request', + value: 400, + description: 'The request was invalid. An accompanying message will explain why.', + details: 'Precision of p must not exceed (10,2).' } } + Response 401 (application/json) -{ error: - { name: 'Unauthorized', - value: 401, - description: 'Authentication credentials were missing or incorrect.', - details: 'Authorized access only.' } } + { error: + { name: 'Unauthorized', + value: 401, + description: 'Authentication credentials were missing or incorrect.', + details: 'Authorized access only.' } } + Response 403 (application/json) -{ error: - { name: 'Forbidden', - value: 403, - description: 'The request is understood, but it has been refused or access is not allowed.', - details: 'Admin access only.' } } + { error: + { name: 'Forbidden', + value: 403, + description: 'The request is understood, but it has been refused or access is not allowed.', + details: 'Admin access only.' } } + Response 500 (application/json) @@ -14096,90 +14043,94 @@ Managing SRM Round Configuration APIs ### Set Round Room Language [POST] + Parameters - + roundId (required, number, `123456`) ... The round id - + languages (required, Array, [1, 3]) ... The array of language ids to be assigened to the room + + roundId (required, number, `123456`) ... The round id + ++ Attributes + + languages, `[1, 3]` (required, array) ... The array of language ids to be assigened to the room + ++ Request Set Round Room Language (application/json) + Response 200 (application/json) -{ - success: true -} + { + success: true + } + Response 400 (application/json) -{ error: - { name: 'Bad Request', - value: 400, - description: 'The request was invalid. An accompanying message will explain why.', - details: 'roundId should be number.' } } + { error: + { name: 'Bad Request', + value: 400, + description: 'The request was invalid. An accompanying message will explain why.', + details: 'roundId should be number.' } } + Response 400 (application/json) -{ error: - { name: 'Bad Request', - value: 400, - description: 'The request was invalid. An accompanying message will explain why.', - details: 'roundId should be positive.' } } + { error: + { name: 'Bad Request', + value: 400, + description: 'The request was invalid. An accompanying message will explain why.', + details: 'roundId should be positive.' } } + Response 400 (application/json) -{ error: - { name: 'Bad Request', - value: 400, - description: 'The request was invalid. An accompanying message will explain why.', - details: 'roundId unknown.' } } + { error: + { name: 'Bad Request', + value: 400, + description: 'The request was invalid. An accompanying message will explain why.', + details: 'roundId unknown.' } } + Response 400 (application/json) -{ error: - { name: 'Bad Request', - value: 400, - description: 'The request was invalid. An accompanying message will explain why.', - details: 'roundId should be less or equal to 999999999.' } } + { error: + { name: 'Bad Request', + value: 400, + description: 'The request was invalid. An accompanying message will explain why.', + details: 'roundId should be less or equal to 999999999.' } } + Response 400 (application/json) -{ error: - { name: 'Bad Request', - value: 400, - description: 'The request was invalid. An accompanying message will explain why.', - details: 'languages must be an array.' } } + { error: + { name: 'Bad Request', + value: 400, + description: 'The request was invalid. An accompanying message will explain why.', + details: 'languages must be an array.' } } + Response 400 (application/json) -{ error: - { name: 'Bad Request', - value: 400, - description: 'The request was invalid. An accompanying message will explain why.', - details: 'language should be an element of 1,3,4,5,6,7.' } } + { error: + { name: 'Bad Request', + value: 400, + description: 'The request was invalid. An accompanying message will explain why.', + details: 'language should be an element of 1,3,4,5,6,7.' } } + Response 400 (application/json) -{ error: - { name: 'Bad Request', - value: 400, - description: 'The request was invalid. An accompanying message will explain why.', - details: 'Array size exceeds number of known languages.' } } + { error: + { name: 'Bad Request', + value: 400, + description: 'The request was invalid. An accompanying message will explain why.', + details: 'Array size exceeds number of known languages.' } } + Response 401 (application/json) -{ error: - { name: 'Unauthorized', - value: 401, - description: 'Authentication credentials were missing or incorrect.', - details: 'Authorized access only.' } } + { error: + { name: 'Unauthorized', + value: 401, + description: 'Authentication credentials were missing or incorrect.', + details: 'Authorized access only.' } } + Response 403 (application/json) -{ error: - { name: 'Forbidden', - value: 403, - description: 'The request is understood, but it has been refused or access is not allowed.', - details: 'Admin access only.' } } + { error: + { name: 'Forbidden', + value: 403, + description: 'The request is understood, but it has been refused or access is not allowed.', + details: 'Admin access only.' } } + Response 500 (application/json) @@ -14203,145 +14154,148 @@ Managing SRM Round Configuration APIs ### Set Round Events [POST] + Parameters - + roundId (required, number, `123456`) ... The round id - + eventId (required, number, `123456`) ... The event id - + eventName (string, max length 50, `Event `) ... The name of the event - + registrationUrl (string, max length 255, `http://www.topcoder.com`) ... The registration url for the event + + roundId (required, number, `123456`) ... The round id + ++ Attributes + + eventId: `123456` (required, number) ... The event id + + eventName: `Event ` (string) ... The name of the event, max length 50 + + registrationUrl: `http://www.topcoder.com` (string) ... The registration url for the event, max length 255 ++ Request Set Round Events (application/json) + Response 400 (application/json) -{ error: - { name: 'Bad Request', - value: 400, - description: 'The request was invalid. An accompanying message will explain why.', - details: 'roundId should be number.' } } + { error: + { name: 'Bad Request', + value: 400, + description: 'The request was invalid. An accompanying message will explain why.', + details: 'roundId should be number.' } } + Response 400 (application/json) -{ error: - { name: 'Bad Request', - value: 400, - description: 'The request was invalid. An accompanying message will explain why.', - details: 'roundId should be positive.' } } + { error: + { name: 'Bad Request', + value: 400, + description: 'The request was invalid. An accompanying message will explain why.', + details: 'roundId should be positive.' } } + Response 400 (application/json) -{ error: - { name: 'Bad Request', - value: 400, - description: 'The request was invalid. An accompanying message will explain why.', - details: 'roundId unknown.' } } + { error: + { name: 'Bad Request', + value: 400, + description: 'The request was invalid. An accompanying message will explain why.', + details: 'roundId unknown.' } } + Response 400 (application/json) -{ error: - { name: 'Bad Request', - value: 400, - description: 'The request was invalid. An accompanying message will explain why.', - details: 'roundId should be less or equal to 999999999.' } } + { error: + { name: 'Bad Request', + value: 400, + description: 'The request was invalid. An accompanying message will explain why.', + details: 'roundId should be less or equal to 999999999.' } } + Response 400 (application/json) -{ error: - { name: 'Bad Request', - value: 400, - description: 'The request was invalid. An accompanying message will explain why.', - details: 'eventId should be number.' } } + { error: + { name: 'Bad Request', + value: 400, + description: 'The request was invalid. An accompanying message will explain why.', + details: 'eventId should be number.' } } + Response 400 (application/json) -{ error: - { name: 'Bad Request', - value: 400, - description: 'The request was invalid. An accompanying message will explain why.', - details: 'eventId should be positive.' } } + { error: + { name: 'Bad Request', + value: 400, + description: 'The request was invalid. An accompanying message will explain why.', + details: 'eventId should be positive.' } } + Response 400 (application/json) -{ error: - { name: 'Bad Request', - value: 400, - description: 'The request was invalid. An accompanying message will explain why.', - details: 'eventId should be less or equal to 999999999.' } } + { error: + { name: 'Bad Request', + value: 400, + description: 'The request was invalid. An accompanying message will explain why.', + details: 'eventId should be less or equal to 999999999.' } } + Response 400 (application/json) -{ error: - { name: 'Bad Request', - value: 400, - description: 'The request was invalid. An accompanying message will explain why.', - details: 'eventName should be string.' } } + { error: + { name: 'Bad Request', + value: 400, + description: 'The request was invalid. An accompanying message will explain why.', + details: 'eventName should be string.' } } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "eventName contains unescaped quotes." - } } + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "eventName contains unescaped quotes." + } } + Response 400 (application/json) -{ error: - { name: 'Bad Request', - value: 400, - description: 'The request was invalid. An accompanying message will explain why.', - details: 'Length of eventName should be less or equal to 50.' } } + { error: + { name: 'Bad Request', + value: 400, + description: 'The request was invalid. An accompanying message will explain why.', + details: 'Length of eventName should be less or equal to 50.' } } + Response 400 (application/json) -{ error: - { name: 'Bad Request', - value: 400, - description: 'The request was invalid. An accompanying message will explain why.', - details: 'registrationUrl should be string.' } } + { error: + { name: 'Bad Request', + value: 400, + description: 'The request was invalid. An accompanying message will explain why.', + details: 'registrationUrl should be string.' } } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "registrationUrl contains unescaped quotes." - } } + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "registrationUrl contains unescaped quotes." + } } + Response 400 (application/json) -{ error: - { name: 'Bad Request', - value: 400, - description: 'The request was invalid. An accompanying message will explain why.', - details: 'Length of registrationUrl should be less or equal to 255.' } } + { error: + { name: 'Bad Request', + value: 400, + description: 'The request was invalid. An accompanying message will explain why.', + details: 'Length of registrationUrl should be less or equal to 255.' } } + Response 401 (application/json) -{ error: - { name: 'Unauthorized', - value: 401, - description: 'Authentication credentials were missing or incorrect.', - details: 'Authorized access only.' } } + { error: + { name: 'Unauthorized', + value: 401, + description: 'Authentication credentials were missing or incorrect.', + details: 'Authorized access only.' } } + Response 403 (application/json) -{ error: - { name: 'Forbidden', - value: 403, - description: 'The request is understood, but it has been refused or access is not allowed.', - details: 'Admin access only.' } } + { error: + { name: 'Forbidden', + value: 403, + description: 'The request is understood, but it has been refused or access is not allowed.', + details: 'Admin access only.' } } + Response 500 (application/json) @@ -14365,325 +14319,328 @@ Managing SRM Round Configuration APIs ### Set Round Segments [POST] + Parameters - + roundId (required, number, `123456`) ... The round id. - + registrationStart (required, string, `2014-06-01 09:00:00`) ... The registration start time. - + registrationLength (required, number, `10`) ... The registration duration minutes. - + codingStart (required, string, `2014-06-01 13:00:00`) ... The coding start time. - + codingLength (required, number, `100`) ... The coding duration minutes. - + intermissionLength (required, number, `10`) ... The intermission duration minutes. - + challengeLength (required, number, `10`) ... The challenge duration minutes. - + registrationStatus (required, string, `F`) ... The registration status for the round, max length 1. - + codingStatus (required, string, `F`) ... The coding status for the round, max length 1. - + intermissionStatus (required, string, `F`) ... The intermission status for the round, max length 1. - + challengeStatus (required, string, `F`) ... The challenge status for the round, max length 1. - + systemTestStatus (required, string, `F`) ... The system test status for the round, max length 1. - -+ Request + + roundId (required, number, `123456`) ... The round id. + ++ Attributes + + registrationStart: `2014-06-01 09:00:00` (required, string) ... The registration start time. + + registrationLength: `10` (required, number) ... The registration duration minutes. + + codingStart: `2014-06-01 13:00:00` (required, string) ... The coding start time. + + codingLength: `100` (required, number) ... The coding duration minutes. + + intermissionLength: `10` (required, number) ... The intermission duration minutes. + + challengeLength: `10` (required, number) ... The challenge duration minutes. + + registrationStatus: `F` (required, string) ... The registration status for the round, max length 1. + + codingStatus: `F` (required, string) ... The coding status for the round, max length 1. + + intermissionStatus: `F` (required, string) ... The intermission status for the round, max length 1. + + challengeStatus: `F` (required, string) ... The challenge status for the round, max length 1. + + systemTestStatus: `F` (required, string) ... The system test status for the round, max length 1. + ++ Request Set Round Segments (application/json) + Headers - Authorization : Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZHwxMzI0NTYiLCJleHAiOjEzOTI4MTc4ODQsImF1ZCI6InRvcGNvZGVyIiwiaWF0IjoxMzkyNzU3ODg0fQ.7X2IKkiyyI1ExSM5GNpdhJ8fGGK5-oAjzccX6YL_BKY + Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZHwxMzI0NTYiLCJleHAiOjEzOTI4MTc4ODQsImF1ZCI6InRvcGNvZGVyIiwiaWF0IjoxMzkyNzU3ODg0fQ.7X2IKkiyyI1ExSM5GNpdhJ8fGGK5-oAjzccX6YL_BKY + Response 200 (application/json) -{ - "success": true -} + { + "success": true + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "roundId should be number." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "roundId should be number." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "roundId should be Integer." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "roundId should be Integer." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "roundId should be positive." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "roundId should be positive." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "roundId should be less or equal to 2147483647." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "roundId should be less or equal to 2147483647." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "registrationStart should be a valid date.." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "registrationStart should be a valid date.." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "registrationLength should be number.." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "registrationLength should be number.." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "registrationLength should be Integer.." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "registrationLength should be Integer.." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "registrationLength should be positive.." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "registrationLength should be positive.." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "codingStart should be a valid date.." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "codingStart should be a valid date.." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "codingLength should be number.." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "codingLength should be number.." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "codingLength should be Integer.." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "codingLength should be Integer.." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "codingLength should be positive.." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "codingLength should be positive.." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "intermissionLength should be number.." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "intermissionLength should be number.." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "intermissionLength should be Integer.." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "intermissionLength should be Integer.." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "intermissionLength should be positive.." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "intermissionLength should be positive.." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "challengeLength should be number.." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "challengeLength should be number.." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "challengeLength should be Integer.." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "challengeLength should be Integer.." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "challengeLength should be positive.." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "challengeLength should be positive.." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "registrationStatus exceeds 1 characters." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "registrationStatus exceeds 1 characters." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "codingStatus exceeds 1 characters." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "codingStatus exceeds 1 characters." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "intermissionStatus exceeds 1 characters." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "intermissionStatus exceeds 1 characters." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "challengeStatus exceeds 1 characters." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "challengeStatus exceeds 1 characters." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "systemTestStatus exceeds 1 characters." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "systemTestStatus exceeds 1 characters." + } + } + Response 401 (application/json) -{ - "error": { - "name": "Unauthorized", - "value": 401, - "description": "The request is understood, but it has been refused or access is not allowed.", - "details": "Authorized information needed." - } -} + { + "error": { + "name": "Unauthorized", + "value": 401, + "description": "The request is understood, but it has been refused or access is not allowed.", + "details": "Authorized information needed." + } + } + Response 403 (application/json) -{ - "error": { - "name": "Forbidden", - "value": 403, - "description": "The request is understood, but it has been refused or access is not allowed.", - "details": "Admin access only." - } -} + { + "error": { + "name": "Forbidden", + "value": 403, + "description": "The request is understood, but it has been refused or access is not allowed.", + "details": "Admin access only." + } + } + Response 500 (application/json) -{ - "error": { - "name":"Internal Server Error", - "value":"500", - "description":"Unknown server error. Please contact support." + { + "error": { + "name":"Internal Server Error", + "value":"500", + "description":"Unknown server error. Please contact support." + } } -} + Response 503 (application/json) -{ - "error": { - "name":"Service Unavailable", - "value":"503", - "description":"Servers are up but overloaded. Try again later." + + { + "error": { + "name":"Service Unavailable", + "value":"503", + "description":"Servers are up but overloaded. Try again later." + } } -} ## Load Round Access [/data/srm/roundAccess] @@ -14692,49 +14649,49 @@ Managing SRM Round Configuration APIs + Response 200 (application/json) -{ accessibleRounds: - [ { roundId: 13672, - name: 'Test SRM Test SRM Round', - startDate: '2014-07-13 20:22' }, - { roundId: 13673, - name: 'Test MM Test MM Round', - startDate: '2014-07-13 20:22' }, - { roundId: 4010, - name: 'Contest 2 Round 10', - startDate: '2014-07-12 09:05' }, - { roundId: 4009, - name: 'Contest 1 Round 9', - startDate: '2014-07-11 09:05' }, - { roundId: 4007, - name: 'Contest 1 Round 7', - startDate: '2014-07-09 09:05' }, - { roundId: 4006, - name: 'Contest 2 Round 6', - startDate: '2014-07-08 09:05' }, - { roundId: 4002, - name: 'Contest 2 Round 2', - startDate: '2014-07-04 09:05' }, - { roundId: 4001, - name: 'Contest 1 Round 1', - startDate: '2014-07-03 09:05' } ] } + { accessibleRounds: + [ { roundId: 13672, + name: 'Test SRM Test SRM Round', + startDate: '2014-07-13 20:22' }, + { roundId: 13673, + name: 'Test MM Test MM Round', + startDate: '2014-07-13 20:22' }, + { roundId: 4010, + name: 'Contest 2 Round 10', + startDate: '2014-07-12 09:05' }, + { roundId: 4009, + name: 'Contest 1 Round 9', + startDate: '2014-07-11 09:05' }, + { roundId: 4007, + name: 'Contest 1 Round 7', + startDate: '2014-07-09 09:05' }, + { roundId: 4006, + name: 'Contest 2 Round 6', + startDate: '2014-07-08 09:05' }, + { roundId: 4002, + name: 'Contest 2 Round 2', + startDate: '2014-07-04 09:05' }, + { roundId: 4001, + name: 'Contest 1 Round 1', + startDate: '2014-07-03 09:05' } ] } + Response 401 (application/json) -{ error: - { name: 'Unauthorized', - value: 401, - description: 'Authentication credentials were missing or incorrect.', - details: 'Authorized access only.' } } + { error: + { name: 'Unauthorized', + value: 401, + description: 'Authentication credentials were missing or incorrect.', + details: 'Authorized access only.' } } + Response 403 (application/json) -{ error: - { name: 'Forbidden', - value: 403, - description: 'The request is understood, but it has been refused or access is not allowed.', - details: 'Admin access only.' } } + { error: + { name: 'Forbidden', + value: 403, + description: 'The request is understood, but it has been refused or access is not allowed.', + details: 'Admin access only.' } } + Response 500 (application/json) @@ -14755,7 +14712,7 @@ Managing SRM Round Configuration APIs # Group Deprecated APIs -## Search Software Challenges [/develop/challenges?listType={listType}&pageIndex={pageIndex}&pageSize={pageSize}&sortColumn={sortColumn}&sortOrder={sortOrder}&communityId={communityId}&submissionEndFrom={submissionEndFrom}&submissionEndTo={submissionEndTo}] +## Search Software Challenges [/develop/challenges{?listType}{?pageIndex}{?pageSize}{?sortColumn}{?sortOrder}{?communityId}{?submissionEndFrom}{?submissionEndTo}] ### Search Software Challenges [GET] + Parameters @@ -14915,7 +14872,7 @@ Managing SRM Round Configuration APIs } -## Search Studio Challenges [/design/challenges?listType={listType}&pageSize={pageSize}&pageIndex={pageIndex}&sortColumn={sortColumn}&sortOrder={sortOrder}&communityId={communityId}&submissionEndFrom={submissionEndFrom}&submissionEndTo={submissionEndTo}] +## Search Studio Challenges [/design/challenges?{filter}={value}{&listType}{&pageSize}{&pageIndex}{&sortColumn}{&sortOrder}{&communityId}{&submissionEndFrom}{&submissionEndTo}] ### Search Studio Challenges [GET] + Parameters @@ -15041,427 +14998,319 @@ Managing SRM Round Configuration APIs "description":"Servers are up but overloaded. Try again later." } -## Add Round Components API [/data/srm/rounds/:roundId/components] +## Add Round Components API [/data/srm/rounds/{roundId}/components] ### Set Round Components API [POST] + Parameters - + roundId (required, number, `1000001`) ... The id of the round to set. - + components (required, JSON object, a JSON object) ... The components parameter. + + roundId (required, number, `1000001`) ... The id of the round to set. -+ Request ++ Attributes + + components (required, object) ... The components parameter. + ++ Request Set Round Components API (application/json) + Headers - Authorization : Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZHwxMzI0NTYiLCJleHAiOjEzOTI4MTc4ODQsImF1ZCI6InRvcGNvZGVyIiwiaWF0IjoxMzkyNzU3ODg0fQ.7X2IKkiyyI1ExSM5GNpdhJ8fGGK5-oAjzccX6YL_BKY + Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZHwxMzI0NTYiLCJleHAiOjEzOTI4MTc4ODQsImF1ZCI6InRvcGNvZGVyIiwiaWF0IjoxMzkyNzU3ODg0fQ.7X2IKkiyyI1ExSM5GNpdhJ8fGGK5-oAjzccX6YL_BKY + Response 200 (application/json) -{ - "success": true -} + { + "success": true + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "roundId should be number." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "roundId should be number." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "roundId should be Integer." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "roundId should be Integer." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "roundId should be positive." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "roundId should be positive." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "roundId should be less or equal to 2147483647." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "roundId should be less or equal to 2147483647." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "components should be Array." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "components should be Array." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "componentId should not be null or undefined" - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "componentId should not be null or undefined" + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "points should not be null or undefined" - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "points should not be null or undefined" + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "divisionId should not be null or undefined" - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "divisionId should not be null or undefined" + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "difficultyId should not be null or undefined" - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "difficultyId should not be null or undefined" + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "openOrder should not be null or undefined" - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "openOrder should not be null or undefined" + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "submitOrder should not be null or undefined" - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "submitOrder should not be null or undefined" + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "componentId should be positive." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "componentId should be positive." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "points should be greater or equal to 0" - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "points should be greater or equal to 0" + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "divisionId should be number." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "divisionId should be number." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "difficultyId should be positive." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "difficultyId should be positive." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "openOrder should be non-negative." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "openOrder should be non-negative." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "submitOrder should be non-negative." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "submitOrder should be non-negative." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "The componentId does not exist in database." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "The componentId does not exist in database." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "The divisionId does not exist in database." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "The divisionId does not exist in database." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "The difficultyId does not exist in database." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "The difficultyId does not exist in database." + } + } + Response 400 (application/json) -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "The componentId and divisionId group should be unique." - } -} + { + "error": { + "name": "Bad Request", + "value": 400, + "description": "The request was invalid. An accompanying message will explain why.", + "details": "The componentId and divisionId group should be unique." + } + } + Response 401 (application/json) -{ - "error": { - "name": "Unauthorized", - "value": 401, - "description": "The request is understood, but it has been refused or access is not allowed.", - "details": "Authorized information needed." - } -} + { + "error": { + "name": "Unauthorized", + "value": 401, + "description": "The request is understood, but it has been refused or access is not allowed.", + "details": "Authorized information needed." + } + } + Response 403 (application/json) -{ - "error": { - "name": "Forbidden", - "value": 403, - "description": "The request is understood, but it has been refused or access is not allowed.", - "details": "Admin access only." - } -} + { + "error": { + "name": "Forbidden", + "value": 403, + "description": "The request is understood, but it has been refused or access is not allowed.", + "details": "Admin access only." + } + } + Response 500 (application/json) -{ - "error": { - "name":"Internal Server Error", - "value":"500", - "description":"Unknown server error. Please contact support." + { + "error": { + "name":"Internal Server Error", + "value":"500", + "description":"Unknown server error. Please contact support." + } } -} + Response 503 (application/json) -{ - "error": { - "name":"Service Unavailable", - "value":"503", - "description":"Servers are up but overloaded. Try again later." - } -} - -## Set Round Terms API [/data/srm/rounds/:roundId/terms] - -### Set Round Terms API [POST] - -+ Parameters - + roundId (required, number, `1000001`) ... The id of the round to set. - + terms (required, String, 'test terms') ... The terms parameter. - -+ Request - - + Headers - - Authorization : Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZHwxMzI0NTYiLCJleHAiOjEzOTI4MTc4ODQsImF1ZCI6InRvcGNvZGVyIiwiaWF0IjoxMzkyNzU3ODg0fQ.7X2IKkiyyI1ExSM5GNpdhJ8fGGK5-oAjzccX6YL_BKY - -+ Response 200 (application/json) - -{ - "success": true -} - -+ Response 400 (application/json) - -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "roundId should be number." - } -} - -+ Response 400 (application/json) - -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "roundId should be Integer." - } -} - -+ Response 400 (application/json) - -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "roundId should be positive." - } -} - -+ Response 400 (application/json) - -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "roundId should be less or equal to 2147483647." - } -} -+ Response 400 (application/json) - -{ - "error": { - "name": "Bad Request", - "value": 400, - "description": "The request was invalid. An accompanying message will explain why.", - "details": "The round terms should not be empty." - } -} - -+ Response 401 (application/json) - -{ - "error": { - "name": "Unauthorized", - "value": 401, - "description": "The request is understood, but it has been refused or access is not allowed.", - "details": "Authorized information needed." - } -} - -+ Response 403 (application/json) - -{ - "error": { - "name": "Forbidden", - "value": 403, - "description": "The request is understood, but it has been refused or access is not allowed.", - "details": "Admin access only." - } -} - -+ Response 500 (application/json) - -{ - "error": { - "name":"Internal Server Error", - "value":"500", - "description":"Unknown server error. Please contact support." + { + "error": { + "name":"Service Unavailable", + "value":"503", + "description":"Servers are up but overloaded. Try again later." + } } -} -+ Response 503 (application/json) -{ - "error": { - "name":"Service Unavailable", - "value":"503", - "description":"Servers are up but overloaded. Try again later." - } -} # Group Round Question Answers APIs Managing Round Question Answers APIs -## Manage Round Question Answer API [/data/srm/answer/:answerId] +## Manage Round Question Answer API [/data/srm/answer/{answerId}] ### Modify Round Question Answer API [PUT] + Parameters + answerId (required, integer) ... answer ID - + text (required, integer) ... answer text - + sortOrder (required, integer) ... the sorting order + ++ Attributes + + text (required, number) ... answer text + + sortOrder (required, number) ... the sorting order + correct (required, boolean) ... flag indicating whether answer is correct or not. ++ Request Modify Round Question Answer API (application/json) + + Response 200 (application/json) { @@ -15591,12 +15440,10 @@ Managing Round Question Answers APIs "description":"Servers are up but overloaded. Try again later." } -## Delete Round Question Answer API [/data/srm/answer/:answerId] - ### Delete Round Question Answer API [DELETE] + Parameters - + answerId (required, integer) ... deleting answer's id + + answerId (required, number) ... deleting answer's id + Response 200 (application/json) @@ -15660,11 +15507,13 @@ Source Code Image Generation APIs ### Source Code Image Generation API [POST] -+ Parameters ++ Attributes: + code (required, string) ... the code value to convert + lang (required, string) ... the code's language name, it should be one of ["1c","actionscript","apache","applescript","xml","asciidoc","autohotkey","avrasm","axapta","bash","brainfuck","capnproto","clojure","cmake","coffeescript","cpp","cs","css","d","markdown","dart","delphi","diff","django","dos","dust","elixir","ruby","erb","erlang-repl","erlang","fix","fsharp","gcode","gherkin","glsl","go","gradle","groovy","haml","handlebars","haskell","haxe","http","ini","java","javascript","json","lasso","less","lisp","livecodeserver","livescript","lua","makefile","mathematica","matlab","mel","mizar","monkey","nginx","nimrod","nix","nsis","objectivec","ocaml","oxygene","parser3","perl","php","powershell","processing","profile","protobuf","puppet","python","q","r","rib","rsl","ruleslanguage","rust","scala","scheme","scilab","scss","smalltalk","sql","stylus","swift","tcl","tex","thrift","twig","typescript","vala","vbnet","vbscript","vbscript-html","vhdl","vim","x86asm","xl"] + style (optional, string) ... the code's format style, it should be one of ['arta', 'ascetic', 'atelier-dune.dark', 'atelier-dune.light', 'atelier-forest.dark', 'atelier-forest.light', 'atelier-heath.dark', 'atelier-heath.light', 'atelier-lakeside.dark', 'atelier-lakeside.light', 'atelier-seaside.dark', 'atelier-seaside.light', 'brown_paper', 'codepen-embed', 'color-brewer', 'dark', 'default', 'docco', 'far', 'foundation', 'github', 'googlecode', 'hybrid', 'idea', 'ir_black', 'kimbie.dark', 'kimbie.light', 'magula', 'mono-blue', 'monokai', 'monokai_sublime', 'obsidian', 'paraiso.dark', 'paraiso.light', 'pojoaque', 'railscasts', 'rainbow', 'school_book', 'solarized_dark', 'solarized_light', 'sunburst', 'tomorrow-night-blue', 'tomorrow-night-bright', 'tomorrow-night-eighties', 'tomorrow-night', 'tomorrow', 'vs', 'xcode', 'zenburn'] ++ Request Source Code Image Generation API (application/json) + + Response 200 (image/jpeg) { @@ -15716,7 +15565,7 @@ Source Code Image Generation APIs } -## Get Rounds [/data/rounds?pageSize={pageSize}&pageIndex={pageIndex}&sortColumn={sortColumn}&sortOrder={sortOrder}&name={name}&type={type}&status={status}®istrationPhaseStartTimeFrom={registrationPhaseStartTimeFrom}®istrationPhaseStartTimeTo={registrationPhaseStartTimeTo}®istrationPhaseEndTimeFrom={registrationPhaseEndTimeFrom}®istrationPhaseEndTimeTo={registrationPhaseEndTimeTo}&codingPhaseStartTimeFrom={codingPhaseStartTimeFrom}&codingPhaseStartTimeTo={codingPhaseStartTimeTo}&codingPhaseEndTimeFrom={codingPhaseEndTimeFrom}&codingPhaseEndTimeTo={codingPhaseEndTimeTo}&intermissionPhaseStartTimeFrom={intermissionPhaseStartTimeFrom}&intermissionPhaseStartTimeTo={intermissionPhaseStartTimeTo}&intermissionPhaseEndTimeFrom={intermissionPhaseEndTimeFrom}&intermissionPhaseEndTimeTo={intermissionPhaseEndTimeTo}&challengePhaseStartTimeFrom={challengePhaseStartTimeFrom}&challengePhaseStartTimeTo={challengePhaseStartTimeTo}&challengePhaseEndTimeFrom={challengePhaseEndTimeFrom}&challengePhaseEndTimeTo={challengePhaseEndTimeTo}&systemTestPhaseStartTimeFrom={systemTestPhaseStartTimeFrom}&systemTestPhaseStartTimeTo={systemTestPhaseStartTimeTo}&systemTestPhaseEndTimeFrom={systemTestPhaseEndTimeFrom}&systemTestPhaseEndTimeTo={systemTestPhaseEndTimeTo}&roomAssignmentPhaseStartTimeFrom={roomAssignmentPhaseStartTimeFrom}&roomAssignmentPhaseStartTimeTo={roomAssignmentPhaseStartTimeTo}&roomAssignmentPhaseEndTimeFrom={roomAssignmentPhaseEndTimeFrom}&roomAssignmentPhaseEndTimeTo={roomAssignmentPhaseEndTimeTo}&moderatedChatPhaseStartTimeFrom={moderatedChatPhaseStartTimeFrom}&moderatedChatPhaseStartTimeTo={moderatedChatPhaseStartTimeTo}&moderatedChatPhaseEndTimeFrom={moderatedChatPhaseEndTimeFrom}&moderatedChatPhaseEndTimeTo={moderatedChatPhaseEndTimeTo} +## Get Rounds [/data/rounds{?pageSize}{?pageIndex}{?sortColumn}{?sortOrder}{?name}{?type}{?status}{?registrationPhaseStartTimeFrom}{?registrationPhaseStartTimeTo}{?registrationPhaseEndTimeFrom}{?registrationPhaseEndTimeTo}{?codingPhaseStartTimeFrom}{?codingPhaseStartTimeTo}{?codingPhaseEndTimeFrom}{?codingPhaseEndTimeTo}{?intermissionPhaseStartTimeFrom}{?intermissionPhaseStartTimeTo}{?intermissionPhaseEndTimeFrom}{?intermissionPhaseEndTimeTo}{?challengePhaseStartTimeFrom}{?challengePhaseStartTimeTo}{?challengePhaseEndTimeFrom}{?challengePhaseEndTimeTo}{?systemTestPhaseStartTimeFrom}{?systemTestPhaseStartTimeTo}{?systemTestPhaseEndTimeFrom}{?systemTestPhaseEndTimeTo}{?roomAssignmentPhaseStartTimeFrom}{?roomAssignmentPhaseStartTimeTo}{?roomAssignmentPhaseEndTimeFrom}{?roomAssignmentPhaseEndTimeTo}{?moderatedChatPhaseStartTimeFrom}{?moderatedChatPhaseStartTimeTo}{?moderatedChatPhaseEndTimeFrom}{?moderatedChatPhaseEndTimeTo}] ### Get Rounds [GET] + Parameters @@ -15757,8 +15606,10 @@ Source Code Image Generation APIs + moderatedChatPhaseEndTimeTo (optional, string, `2014-01-01%2000:00:00`) The moderatedChatPhaseEndTimeTo filter, can be null. It should be encoded in uri format. The format should be 'YYYY-MM-DD HH:mm:ss'. The from date should not be later than to date in same field. + Request + + Headers - Authorization : Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZHwxMzI0NTYiLCJleHAiOjEzOTI4MTc4ODQsImF1ZCI6InRvcGNvZGVyIiwiaWF0IjoxMzkyNzU3ODg0fQ.7X2IKkiyyI1ExSM5GNpdhJ8fGGK5-oAjzccX6YL_BKY + + Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZHwxMzI0NTYiLCJleHAiOjEzOTI4MTc4ODQsImF1ZCI6InRvcGNvZGVyIiwiaWF0IjoxMzkyNzU3ODg0fQ.7X2IKkiyyI1ExSM5GNpdhJ8fGGK5-oAjzccX6YL_BKY + Response 200 (application/json) @@ -16090,4 +15941,5 @@ Source Code Image Generation APIs "name":"Service Unavailable", "value":"503", "description":"Servers are up but overloaded. Try again later." - } \ No newline at end of file + } + diff --git a/docs/Verification_Guide-Get Terms Details For A User API.doc b/docs/Verification_Guide-Get Terms Details For A User API.doc new file mode 100644 index 000000000..a768209a4 Binary files /dev/null and b/docs/Verification_Guide-Get Terms Details For A User API.doc differ diff --git a/queries/get_terms_for_user b/queries/get_terms_for_user new file mode 100644 index 000000000..eb2137834 --- /dev/null +++ b/queries/get_terms_for_user @@ -0,0 +1,18 @@ +SELECT + types.terms_of_use_type_desc AS terms_type, + agreeability.name AS agreeability_type, + (NOT xref.terms_of_use_id IS NULL) AS agreed, + tou.terms_text AS terms_text, + tou.title AS title, + tou.terms_of_use_id AS terms_of_use_id, + tou.url AS url +FROM ((terms_of_use tou + LEFT JOIN terms_of_use_type types + ON tou.terms_of_use_type_id = types.terms_of_use_type_id + ) LEFT JOIN terms_of_use_agreeability_type_lu agreeability + ON tou.terms_of_use_agreeability_type_id = agreeability.terms_of_use_agreeability_type_id + ) LEFT JOIN (user_terms_of_use_xref xref + INNER JOIN user u + ON xref.user_id = u.user_id + ) ON tou.terms_of_use_id = xref.terms_of_use_id AND xref.user_id = @userId@ +WHERE tou.terms_of_use_id IN (@termsIds@) diff --git a/queries/get_terms_for_user.json b/queries/get_terms_for_user.json new file mode 100644 index 000000000..4706677a6 --- /dev/null +++ b/queries/get_terms_for_user.json @@ -0,0 +1,5 @@ +{ + "name" : "get_terms_for_user", + "db" : "common_oltp", + "sqlfile" : "get_terms_for_user" +} diff --git a/routes.js b/routes.js index e9d94651f..a6a68adeb 100755 --- a/routes.js +++ b/routes.js @@ -1,7 +1,8 @@ /* * Copyright (C) 2013 - 2014 TopCoder Inc., All Rights Reserved. * - * @version 1.68 + * @version 1.69 + * @author TCSCODER, * @author vangavroche, Sky_, muzehyun, kurtrips, Ghost_141, ecnu_haozi, hesibo, LazyChild, isv, flytoj2ee, * @author panoptimum, bugbuka, Easyhard, TCASSEMBLER * @@ -156,6 +157,8 @@ * - Added get user develop challenges api. * Changed in 1.68: * - Added get rounds api. + * Changed in 1.69: + * - Added get terms details for a user api. */ /*jslint node:true, nomen: true */ "use strict"; @@ -318,6 +321,7 @@ exports.routes = { { path: "/:apiVersion/data/technologies", action: "getTechnologies" }, { path: "/:apiVersion/terms/:challengeId(\\d+)", action: "getChallengeTerms"}, { path: "/:apiVersion/terms/detail/:termsOfUseId", action: "getTermsOfUse"}, + { path: "/:apiVersion/terms/for/:userId(\\d+)/:termsOfUseIds((\\d+,)*\\d+)", action: "getTermsForUser" }, { path: "/:apiVersion/data/srm/contests", action: "listSRMContests"}, { path: "/:apiVersion/dataScience/challenges/past", action: "pastDataScienceChallenges"}, { path: "/:apiVersion/dataScience/challenges/active", action: "activeDataScienceChallenges"}, diff --git a/test/postman/Challenge%2030054600.postman_collection.json b/test/postman/Challenge%2030054600.postman_collection.json new file mode 100644 index 000000000..736e1b4f0 --- /dev/null +++ b/test/postman/Challenge%2030054600.postman_collection.json @@ -0,0 +1,176 @@ +{ + "id": "beec52e9-d4fb-5b12-37b2-578ffbca9cef", + "name": "Challenge 30054600", + "description": "", + "order": [ + "771c6958-a396-b47e-cde6-f7214ee2ca6e", + "4278aa54-a5a0-c9f3-a542-4d7d83b58cde", + "277dd556-0870-aee3-875c-c9894d63bda4", + "f5977542-00ea-3184-3d47-b958bb9d25d3", + "33c71bcc-ffce-8254-253d-8640514ae7d2", + "94d38a46-b72a-26ae-20dc-c2304a83f5ca", + "fb213c96-55e0-0a77-f2b6-0186f996e1da", + "97b26905-1c5d-e698-0657-71778793bbca" + ], + "folders": [], + "timestamp": 1467025155666, + "owner": "316251", + "remoteLink": "", + "public": false, + "published": false, + "requests": [ + { + "id": "277dd556-0870-aee3-875c-c9894d63bda4", + "headers": "Authorization: Bearer {{authToken}}\n", + "url": "localhost:8080/api/v2/terms/for/132456/40000001,40000002,40000003,40000004,40000005", + "preRequestScript": null, + "pathVariables": {}, + "method": "GET", + "data": null, + "dataMode": "params", + "version": 2, + "tests": "tests[\"Status code is 403\"] = responseCode.code === 403;\nvar jsonData = JSON.parse(responseBody);\ntests[\"Authentication required\"] = jsonData.error.details === \"This user cannot get these data of other users\";\n", + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1467026165794, + "name": "3. Try to get terms for another user", + "description": "", + "collectionId": "beec52e9-d4fb-5b12-37b2-578ffbca9cef", + "responses": [] + }, + { + "id": "33c71bcc-ffce-8254-253d-8640514ae7d2", + "headers": "Content-Type: application/json\n", + "url": "localhost:8080/api/v2/auth", + "preRequestScript": null, + "pathVariables": {}, + "method": "POST", + "data": [], + "dataMode": "raw", + "version": 2, + "tests": "var authResponse = JSON.parse(responseBody);\npostman.setEnvironmentVariable(\"authToken\", authResponse.token);\ntests[\"Status code is 200\"] = responseCode.code === 200;\nvar jsonData = JSON.parse(responseBody);\ntests[\"A valid token is returned\"] = !!jsonData.token;", + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1467026645589, + "name": "5. Re-authenticate as admin user", + "description": "", + "collectionId": "beec52e9-d4fb-5b12-37b2-578ffbca9cef", + "responses": [], + "rawModeData": "{\n \"username\": \"heffan\", \n \"password\": \"password\"\n}" + }, + { + "id": "4278aa54-a5a0-c9f3-a542-4d7d83b58cde", + "headers": "Content-Type: application/json\n", + "url": "localhost:8080/api/v2/auth", + "preRequestScript": null, + "pathVariables": {}, + "method": "POST", + "data": [], + "dataMode": "raw", + "version": 2, + "tests": "var authResponse = JSON.parse(responseBody);\npostman.setEnvironmentVariable(\"authToken\", authResponse.token);\ntests[\"Status code is 200\"] = responseCode.code === 200;\nvar jsonData = JSON.parse(responseBody);\ntests[\"A valid token is returned\"] = !!jsonData.token;", + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1467025511038, + "name": "2. Log in as ordinary user", + "description": "", + "collectionId": "beec52e9-d4fb-5b12-37b2-578ffbca9cef", + "responses": [], + "rawModeData": "{\n \"username\": \"user\", \n \"password\": \"password\"\n}" + }, + { + "id": "771c6958-a396-b47e-cde6-f7214ee2ca6e", + "headers": "", + "url": "localhost:8080/api/v2/terms/for/132458/40000001,40000002,40000003,40000004,40000005", + "preRequestScript": null, + "pathVariables": {}, + "method": "GET", + "data": null, + "dataMode": "params", + "tests": "tests[\"Status code is 401\"] = responseCode.code === 401;\nvar jsonData = JSON.parse(responseBody);\ntests[\"Authentication required\"] = jsonData.error.details === \"Authentication credential was missing.\";\n", + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1467025367614, + "name": "1. Try to get terms without authorization", + "description": "", + "collectionId": "beec52e9-d4fb-5b12-37b2-578ffbca9cef", + "responses": [] + }, + { + "id": "94d38a46-b72a-26ae-20dc-c2304a83f5ca", + "headers": "Authorization: Bearer {{authToken}}\n", + "url": "localhost:8080/api/v2/terms/for/132458/40000001,40000002,40000003,40000004,40000005", + "preRequestScript": null, + "pathVariables": {}, + "method": "GET", + "data": null, + "dataMode": "params", + "version": 2, + "tests": "tests[\"Status code is 200\"] = responseCode.code === 200;\nvar jsonData = JSON.parse(responseBody);\ntests[\"5 terms returned\"] = jsonData.terms.length === 5;\n\n", + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1467026345553, + "name": "6. Try to get terms for another user again", + "description": "", + "collectionId": "beec52e9-d4fb-5b12-37b2-578ffbca9cef", + "responses": [] + }, + { + "id": "97b26905-1c5d-e698-0657-71778793bbca", + "headers": "Authorization: Bearer {{authToken}}\n", + "url": "localhost:8080/api/v2/terms/for/132458/40000001,40000002,abracadabra,40000004,40000005", + "preRequestScript": null, + "pathVariables": {}, + "method": "GET", + "data": null, + "dataMode": "params", + "version": 2, + "tests": "tests[\"Status code is 400\"] = responseCode.code === 400;\nvar jsonData = JSON.parse(responseBody);\ntests[\"Bad terms of use id\"] = jsonData.error.details === \"Each Terms Of Use ID should be number.\";\n\n\n", + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1467026848102, + "name": "8. Try invalid term of use id", + "description": "", + "collectionId": "beec52e9-d4fb-5b12-37b2-578ffbca9cef", + "responses": [] + }, + { + "id": "f5977542-00ea-3184-3d47-b958bb9d25d3", + "headers": "Authorization: Bearer {{authToken}}\n", + "url": "localhost:8080/api/v2/terms/for/132458/40000001,40000002,40000003,40000004,40000005", + "preRequestScript": null, + "pathVariables": {}, + "method": "GET", + "data": null, + "dataMode": "params", + "version": 2, + "tests": "tests[\"Status code is 200\"] = responseCode.code === 200;\nvar jsonData = JSON.parse(responseBody);\ntests[\"5 terms returned\"] = jsonData.terms.length === 5;\n\n", + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1467026345553, + "name": "4. Try the correct call", + "description": "", + "collectionId": "beec52e9-d4fb-5b12-37b2-578ffbca9cef", + "responses": [] + }, + { + "id": "fb213c96-55e0-0a77-f2b6-0186f996e1da", + "headers": "Authorization: Bearer {{authToken}}\n", + "url": "localhost:8080/api/v2/terms/for/0/40000001,40000002,40000003,40000004,40000005", + "preRequestScript": null, + "pathVariables": {}, + "method": "GET", + "data": null, + "dataMode": "params", + "version": 2, + "tests": "tests[\"Status code is 400\"] = responseCode.code === 400;\nvar jsonData = JSON.parse(responseBody);\ntests[\"Bad user id\"] = jsonData.error.details === \"User ID should be positive.\";\n\n\n", + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1467026726365, + "name": "7. Try invalid user id", + "description": "", + "collectionId": "beec52e9-d4fb-5b12-37b2-578ffbca9cef", + "responses": [] + } + ] +} \ No newline at end of file diff --git a/test/postman/Challenge%2030054600.postman_environment.json b/test/postman/Challenge%2030054600.postman_environment.json new file mode 100644 index 000000000..f955afe63 --- /dev/null +++ b/test/postman/Challenge%2030054600.postman_environment.json @@ -0,0 +1,11 @@ +{ + "id": "491d2a28-94f8-3992-0eca-2e56229d5ecb", + "name": "Challenge 30054600", + "values": [ + ], + "timestamp": 1467026433819, + "synced": false, + "syncedFilename": "", + "team": null, + "isDeleted": false +} \ No newline at end of file diff --git a/test/scripts/bridge.js b/test/scripts/bridge.js new file mode 100644 index 000000000..5662464f9 --- /dev/null +++ b/test/scripts/bridge.js @@ -0,0 +1,116 @@ +/* + * Copyright (C) 2016 TopCoder Inc., All Rights Reserved. + * + * This is the simple service that provides a "bridge" between a + * client and the database server. It accepts SQL queries and executes them. + * + * Added just to solve a deployment problem. Can (and probably should) be removed + * when this problem will be fixed + * + * @author TCSCODER + * @version 1.0 + */ +"use strict"; + +var http = require("http"), + async = require("async"), + Jdbc = require("informix-wrapper"), + path = require("path"), + tcConfig = require(path.dirname(path.dirname(__dirname)) + "/config/tc-config.js").tcConfig; + +var connections = {}; + +var server = http.createServer(function (req, res) { + + if (req.method !== "POST" || req.url !== "/bridge") { + res.writeHead(404, "Not found"); + res.end(); + return; + } + + var header = { "Content-Type": "application/json" }, + body = []; + + req.on("data", function (chunk) { + body.push(chunk); + }).on("end", function () { + body = Buffer.concat(body).toString(); + + var query; + try { + query = JSON.parse(body); + query.sql = new Buffer(query.sql, "base64").toString(); + } catch (x) { + res.writeHead(400, "Bad request", header); + res.end(JSON.stringify(x.toString())); + return; + } + + if (!query.db) { + res.writeHead(400, "Bad request", header); + res.end("'db' parameter is required"); + return; + } + if (!query.sql) { + res.writeHead(400, "Bad request", header); + res.end("'sql' parameter is required"); + return; + } + + try { + async.waterfall([ + function (next) { + var jdbc, prefix, settings; + + if (connections[query.db] && connections[query.db].isConnected()) { + next(null, connections[query.db]); + } else { + jdbc = connections[query.db]; + + if (!jdbc) { + prefix = tcConfig.databaseMapping[query.db]; + if (!prefix) { + res.writeHead(400, "Bad request", header); + res.end(query.db + "- unknown database"); + return; + } + settings = { + user: process.env[prefix + "_USER"], + host: process.env[prefix + "_HOST"], + port: parseInt(process.env[prefix + "_PORT"], 10), + password: process.env[prefix + "_PASSWORD"], + database: query.db, + server: process.env[prefix + "_NAME"], + minpool: parseInt(process.env.MINPOOL, 10) || 1, + maxpool: parseInt(process.env.MAXPOOL, 10) || 60, + maxsize: parseInt(process.env.MAXSIZE, 10) || 0, + idleTimeout: parseInt(process.env.IDLETIMEOUT, 10) || 3600, + timeout: parseInt(process.env.TIMEOUT, 10) || 30000 + }; + jdbc = connections[query.db] = new Jdbc(settings, console.log).initialize(); + } + jdbc.connect(function (err) { + next(err, jdbc); + }); + } + }, + function (connection, next) { + connection.query(query.sql, next).execute(); + } + ], function (err, rows) { + res.writeHead(200, header); + if (err) { + res.end(JSON.stringify({exception: err.toString()})); + } else { + res.end(JSON.stringify({results: rows})); + } + }); + } catch (x) { + res.writeHead(200, header); + res.end(JSON.stringify({exception: x.toString()})); + } + }); + +}); + +server.listen(8082); diff --git a/test/scripts/getTermsForUser/cleanData.js b/test/scripts/getTermsForUser/cleanData.js new file mode 100644 index 000000000..3f604f1ff --- /dev/null +++ b/test/scripts/getTermsForUser/cleanData.js @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2016 TopCoder Inc., All Rights Reserved. + * + * + * This is the script to clean the test data created by insertData.js + * + * @author TCSCODER + * @version 1.0 + */ +"use strict"; + +var path = require("path"); +var helper = require("../../helpers/testHelper"); +var SQL_DIR = path.dirname(path.dirname(__dirname)) + "/sqls/termsForUser/"; +var async = require("async"); + +helper.runSqlFile(SQL_DIR + "common_oltp__clean", "common_oltp", function (err) { + if (err) { + throw err; + } + console.log("DONE"); + process.exit(); +}); + diff --git a/test/scripts/getTermsForUser/insertData.js b/test/scripts/getTermsForUser/insertData.js new file mode 100644 index 000000000..3d0415615 --- /dev/null +++ b/test/scripts/getTermsForUser/insertData.js @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2016 TopCoder Inc., All Rights Reserved. + * + * + * This script insers some test data + * to test /terms/for/{userId}/{termsOfUseIds} service in Postman + * + * @author TCSCODER + * @version 1.0 + */ +"use strict"; + +var path = require("path"); +var helper = require("../../helpers/testHelper"); +var SQL_DIR = path.dirname(path.dirname(__dirname)) + "/sqls/termsForUser/"; +var async = require("async"); + +async.waterfall([ + function (cb) { + helper.runSqlFile(SQL_DIR + "common_oltp__clean", "common_oltp", cb); + }, + function (cb) { + helper.runSqlFile(SQL_DIR + "common_oltp__insert_test_data", "common_oltp", cb); + }, + function (cb) { + async.each([ 1, 2, 3, 4, 5 ], function (n, cb) { + helper.updateTextColumn("update terms_of_use set terms_text = ? where terms_of_use_id = ?", + "common_oltp", + [{ + type: "text", + value: "This is the Node API Sample Term Of Use " + n + "." + }, { + type: "int", + value: 40000000 + n + }], + cb); + }, cb); + } +], function (err) { + if (err) { + throw err; + } + console.log("DONE"); + process.exit(); +}); + diff --git a/test/sqls/termsForUser/common_oltp__clean b/test/sqls/termsForUser/common_oltp__clean new file mode 100644 index 000000000..fe66b5026 --- /dev/null +++ b/test/sqls/termsForUser/common_oltp__clean @@ -0,0 +1,2 @@ +delete from user_terms_of_use_xref where terms_of_use_id >= 40000001 and terms_of_use_id <= 40000005; +delete from terms_of_use where terms_of_use_id >= 40000001 and terms_of_use_id <= 40000005; diff --git a/test/sqls/termsForUser/common_oltp__insert_test_data b/test/sqls/termsForUser/common_oltp__insert_test_data new file mode 100644 index 000000000..a5e4637f8 --- /dev/null +++ b/test/sqls/termsForUser/common_oltp__insert_test_data @@ -0,0 +1,13 @@ +INSERT into terms_of_use (terms_of_use_id, terms_of_use_type_id, title, url, terms_of_use_agreeability_type_id) +VALUES (40000001, 3, 'NodeJS API Sample Term Of Use 1', 'http://topcoder.com/tou40000001.txt', 3); +INSERT into terms_of_use (terms_of_use_id, terms_of_use_type_id, title, url, terms_of_use_agreeability_type_id) +VALUES (40000002, 4, 'NodeJS API Sample Term Of Use 2', 'http://topcoder.com/tou40000002.txt', 3); +INSERT into terms_of_use (terms_of_use_id, terms_of_use_type_id, title, url, terms_of_use_agreeability_type_id) +VALUES (40000003, 8, 'NodeJS API Sample Term Of Use 3', 'http://topcoder.com/tou40000003.txt', 3); +INSERT into terms_of_use (terms_of_use_id, terms_of_use_type_id, title, url, terms_of_use_agreeability_type_id) +VALUES (40000004, 2, 'NodeJS API Sample Term Of Use 4', 'http://topcoder.com/tou40000004.txt', 2); +INSERT into terms_of_use (terms_of_use_id, terms_of_use_type_id, title, url, terms_of_use_agreeability_type_id) +VALUES (40000005, 5, 'NodeJS API Sample Term Of Use 5', 'http://topcoder.com/tou40000005.txt', 2); + +INSERT into user_terms_of_use_xref(user_id, terms_of_use_id) VALUES (132458, 40000001); +INSERT into user_terms_of_use_xref(user_id, terms_of_use_id) VALUES (132458, 40000002); diff --git a/test/test.termsOfUse.js b/test/test.termsOfUse.js index 8cbec092c..df029b3f4 100644 --- a/test/test.termsOfUse.js +++ b/test/test.termsOfUse.js @@ -1,7 +1,7 @@ /* * Copyright (C) 2014 TopCoder Inc., All Rights Reserved. * - * @version 1.2 + * @version 1.3 * @author TCSASSEMBLER, muzehyun * * changes in 1.1: @@ -9,6 +9,9 @@ * * changes in 1.2: * add tests for retrieving docusign template id + * + * changes in 1.3 + * add tests for getting terms details for an user */ "use strict"; /*global describe, it, before, beforeEach, after, afterEach */ @@ -21,6 +24,7 @@ var fs = require('fs'); var request = require('supertest'); var assert = require('chai').assert; var async = require("async"); +var _ = require("underscore"); var testHelper = require('./helpers/testHelper'); var SQL_DIR = __dirname + "/sqls/termsOfUse/"; @@ -45,7 +49,6 @@ describe('Terms Of Use API', function () { user12 = 'facebook|fb400012', user13 = 'facebook|fb400013', user14 = 'facebook|fb400014', - user17 = 'facebook|fb400017', user18 = 'facebook|fb400018'; /** @@ -382,6 +385,140 @@ describe('Terms Of Use API', function () { }); }); + describe('Get Terms Details For A User API', function () { + var SQL_DIR = __dirname + '/sqls/termsForUser/', + heffan = 'ad|132456', + user = 'ad|132458', + heffanAuthHeader = testHelper.generateAuthHeader({ sub: heffan }), + userAuthHeader = testHelper.generateAuthHeader({ sub: user }), + goodUser = '132458', + badUser = '0', + goodTerms = '40000001,40000002,40000003,40000004,40000005', + badTerms = 'abra,cadabra'; + + /** + * Clear database + * @param {Function} done the callback + */ + function clearDb(done) { + testHelper.runSqlFile(SQL_DIR + 'common_oltp__clean', 'common_oltp', done); + } + + /** + * This function is run before all tests. + * Generate tests data. + * @param {Function} done the callback + */ + before(function (done) { + async.waterfall([ + clearDb, + function (cb) { + testHelper.runSqlFile(SQL_DIR + 'common_oltp__insert_test_data', 'common_oltp', cb); + } + ], done); + }); + + /** + * This function is run after all tests. + * Clean up all data. + * @param {Function} done the callback + */ + after(function (done) { + clearDb(done); + }); + + /** + * Create request and return it + * @param {String} userId - the id of the user to get data for + * @param {String} termsOfUseIds - the comma separated list of terms of use ids + * @param {String} authHeader - the Authorization header + * @param {Number} statusCode - the expected status code + * @return {Object} request + */ + function createRequest(userId, termsOfUseIds, authHeader, statusCode) { + var req = request(API_ENDPOINT) + .get('/v2/terms/for/' + userId + '/' + termsOfUseIds) + .set('Accept', 'application/json'); + if (authHeader) { + req = req.set('Authorization', authHeader); + } + return req.expect('Content-Type', /json/).expect(statusCode); + } + + /** + * Assert error request + * @param {String} userId - the id of the user to get data for + * @param {String} termsOfUseIds - the comma separated list of terms of use ids + * @param {String} authHeader - the Authorization header + * @param {Number} statusCode - the expected status code + * @param {String} errorDetail - the expected error detail + * @param {Function} done the callback function + */ + function assertError(userId, termsOfUseIds, authHeader, statusCode, errorDetail, done) { + createRequest(userId, termsOfUseIds, authHeader, statusCode).end(function (err, res) { + if (err) { + done(err); + return; + } + assert.equal(res.body.error.details, errorDetail, 'Invalid error detail'); + done(); + }); + } + + /** + * Test the result returned by the correct query + * @param {Object} err - the error + * @param {Object} res - result returned by the request + * @param {Function} done - the callback function + */ + function checkGoodResult(err, res, done) { + if (err) { + done(err); + return; + } + assert.property(res.body, 'terms', 'response should contain "terms"'); + assert.isArray(res.body.terms, 'terms should be an array'); + assert.equal(res.body.terms.length, 5, 'terms should contain 5 items'); + _.each(res.body.terms, function (item) { + assert.property(item, 'agreed', 'each terms item should contain "agreed"'); + assert.property(item, 'termsOfUseId', 'each terms item should contain "termsOfUseId"'); + var shouldBeAgreed = item.termsOfUseId === 40000001 || item.termsOfUseId === 40000002; + assert.equal(!!item.agreed, shouldBeAgreed, + 'agreed should be true for 40000001 and 40000002, and only for them'); + }); + done(); + } + + + it('should not allow unauthorized request', function (done) { + assertError(goodUser, goodTerms, null, 401, 'Authentication credential was missing.', done); + }); + + it('should not let ordinary user get terms for another user', function (done) { + assertError('132456', goodTerms, userAuthHeader, 403, 'This user cannot get these data of other users', done); + }); + + it('should return the correct result for the correct user and terms', function (done) { + createRequest(goodUser, goodTerms, userAuthHeader, 200).end(function (err, res) { + checkGoodResult(err, res, done); + }); + }); + + it('should allow an admin to get terms for another user', function (done) { + createRequest(goodUser, goodTerms, heffanAuthHeader, 200).end(function (err, res) { + checkGoodResult(err, res, done); + }); + }); + + it('should return error on invalid user id', function (done) { + assertError(badUser, goodTerms, heffanAuthHeader, 400, 'User ID should be positive.', done); + }); + + it('should return error on invalid terms ids', function (done) { + assertError(goodUser, badTerms, userAuthHeader, 400, 'Each Terms Of Use ID should be number.', done); + }); + }); + describe('Agree Terms Of Use API', function () { var SQL_DIR = __dirname + '/sqls/agreeTermsOfUse/', heffan = "ad|132456",