-
Notifications
You must be signed in to change notification settings - Fork 3
v0 TeamRU API
anitejb edited this page Sep 5, 2020
·
1 revision
All endpoints have the following situations
Situation | Value | HTTP Code | Type |
---|---|---|---|
lcs Validate endpoint failed | Invalid request |
404 | text/plain |
This feature is disabled in the config file | Feature is disabled |
501 | text/plain |
This Value of the feature in the config file is neither 0 nor 1 | Wrong Feature value |
502 | text/plain |
User email, token or both were not passed to the endpoint | Missing email or token |
408 | text/plain |
Invalid Json/schema | Invalid Json |
505 | text/plain |
Method: GET, POST
GET is used to return a profile while POST is used to create and update a profile.
When updating a profile, you should send the old values in addition to the new ones.
Data: JSON
Example JSON for POST:
{
"user_email": "test1@gmail.com",
"token": "fvbnlfjnvfjnvf",
"skills": "java, python, flask",
"prizes": "prize1, prize2, prize2"
}
Example JSON for GET:
{
"user_email": "test1@gmail.com",
"token": "fvbnlfjnvfjnvf"
}
GET Returns:
Situation | Value | HTTP Code | Type |
---|---|---|---|
User doesn't have a teamBuilder profile | User Not found |
401 | text/plain |
Profile returned | {"_id": "john@gmail.com", "skills": ["java", "python", "flask"], "prizes": ["prize1", "prize2"], "hasateam": false, "name": "John", "potentialteams": ["team1", "team2"} |
200 | Application/JSON |
POST Returns:
Situation | Value | HTTP Code | Type |
---|---|---|---|
Skills not found | Required info not found |
400 | text/plain |
Profile updated successfully | Successful update |
200 | text/plain |
Profile created successfully | Profile created |
201 | text/plain |
Method: POST
Data: JSON
Example JSON:
{
"user_email": "test1@gmail.com",
"token": "fvbnlfjnvfjnvf",
"name": "team1",
"desc": "hi, we are a team of two and plan on creating an android app. We are looking for someone who knows java or kotlin",
"skills": "java, kotlin",
"prizes": "prize1, prize2"
}
Returns:
Situation | Value | HTTP Code | Type |
---|---|---|---|
Missing required information | Required info not found |
400 | text/plain |
User doesn't have a teamBuilder profile | Invalid user |
403 | text/plain |
Team with the same name already exists | Invalid name |
401 | text/plain |
User can't start a team while they are in one already | User in a team |
402 | text/plain |
Team created successfully | Success |
200 | text/plain |
Method: POST
Data: JSON
Example JSON:
{
"user_email": "test1@gmail.com",
"token": "fvbnlfjnvfjnvf"
}
Returns:
Situation | Value | HTTP Code | Type |
---|---|---|---|
User not in a team | User doesn't have a team |
400 | text/plain |
User left team successfully | Success |
200 | text/plain |
Method: POST
Data: JSON
Example JSON:
{
"user_email": "test1@gmail.com",
"token": "fvbnlfjnvfjnvf",
"email": "john@gmail.com",
}
Returns:
Situation | Value | HTTP Code | Type |
---|---|---|---|
Email is missing | Required info not found |
400 | text/plain |
lcs auth endpoint failed | auth endpoint failed |
401 | text/plain |
lcs read endpoint failed | Partner doesn't have a hackru account |
402 | text/plain |
User doesn't have a team | User not in a team |
405 | text/plain |
Team is either marked complete by hackers or has four members | Team complete |
403 | text/plain |
Partner in another team | Partner in a team |
406 | text/plain |
Hacker added successfully | Success |
200 | text/plain |
This endpoint reverses the status of the team in the database and returns the new status when the request is successful. It returns True if the team was marked incomplete but now marked complete, and False if the team was marked complete and now it is incomplete.
Method: POST
Data: JSON
Example JSON:
{
"user_email": "test1@gmail.com",
"token": "fvbnlfjnvfjnvf"
}
Returns:
Situation | Value | HTTP Code | Type |
---|---|---|---|
User doesn't have a team | User not in a team |
401 | text/plain |
Team marked complete/incomplete successfully | True or False |
200 | text/plain |
Method: GET
Data: JSON
Example JSON:
{
"user_email": "test1@gmail.com",
"token": "fvbnlfjnvfjnvf",
"filter": "java",
}
Returns:
Situation | Value | HTTP Code | Type |
---|---|---|---|
No teams match up the filter | No open teams |
400 | text/plain |
profiles of open teams successfully returned | [ { "_id": "team3", "complete": false, "desc": "hi, we are a team of two and plan on creating a web app. we are looking for someone who knows python and flask","members": ["test1@gmail.com", "test2@gmail.com"], "partnerskills": ["python", "flask"], "prizes": ["prize9", "prize8" ], "interested", ["john@gmail.com, "kabir@gmail.com"]}, {"_id": "team5", "complete": false, "desc": "looking for somone who knows java and kotlin", "members": ["test4@gmail.com"], "partnerskills": ["java", "kotlin"], "prizes": ["prize4"], "interested", ["k@gmail.com, "ahm@gmail.com"]} ] |
200 | Application/JSON |
Method: GET
Data: JSON
Example JSON:
{
"user_email": "test1@gmail.com",
"token": "fvbnlfjnvfjnvf"
}
Returns:
Situation | Value | HTTP Code | Type |
---|---|---|---|
User not in a team | Team Not found |
400 | text/plain |
Team profile successfully returned | {"_id": "team3", "complete": false, "desc": "hi, we are a team of five and plan on creating a web app. we are looking for someone who knows python and flask", "members": ["test1@gmail.com","test2@gmail.com", "test3@gmail.com"], "names": ["test1 test1", "test2 test2", "test3 test3"], "partnerskills": ["python", "flask"], "prizes": ["prize9", "prize8"], "interested", ["k@gmail.com, "ahm@gmail.com"]} |
200 | Application/JSON |
Method: GET
Data: JSON
Example JSON:
{
"user_email": "test1@gmail.com",
"token": "fvbnlfjnvfjnvf"
}
Returns:
Situation | Value | HTTP Code | Type |
---|---|---|---|
User doesn't have a teamBuilder profile | Invalid user |
403 | text/plain |
User has a team | User in a team |
401 | text/plain |
Couldn't find recommendations | No recommendations found |
400 | text/plain |
Team profiles successfully returned | [ { "_id": "team3", "complete": false, "desc": "hi, we are a team of two and plan on creating a web app. we are looking for someone who knows python and flask","members": ["test1@gmail.com", "test2@gmail.com"], "partnerskills": ["python", "flask"], "prizes": ["prize9", "prize8" ], "interested", ["k@gmail.com, "ahm@gmail.com"]}, {"_id": "team5", "complete": false, "desc": "looking for somone who knows java and kotlin", "members": ["test4@gmail.com"], "partnerskills": ["java", "kotlin"], "prizes": ["prize4"], "interested", ["k@gmail.com, "ahm@gmail.com"]} ] |
200 | Application/JSON |
Method: GET
Data: JSON
Example JSON:
{
"user_email": "test1@gmail.com",
"token": "fvbnlfjnvfjnvf"
}
Returns:
Situation | Value | HTTP Code | Type |
---|---|---|---|
User doesn't have a team | User not in a team |
400 | text/plain |
Team profile is not complete | Profile not complete |
401 | text/plain |
Couldn't find recommendations | No recommendations found |
402 | text/plain |
profiles successfully returned | [{"_id": "test8@gmail.com","hasateam": false,"name": "test1 test1", "potentialteams": [ ""],"prizes": ["prize6", "prize9","prize1"],"skills": ["java","python","frontend" ]},{"_id": "test5@gmail.com", "hasateam": false, "name": "test1 test1", "potentialteams": ["team1", "team2" ], "prizes": ["prize9","prize20","prize7"], "skills": ["web", "html", "css"]} ] |
200 | Application/JSON |
Method: POST
Data: JSON
Example JSON:
{
"user_email": "test1@gmail.com",
"token": "fvbnlfjnvfjnvf",
"name": "team1",
}
Returns:
Situation | Value | HTTP Code | Type |
---|---|---|---|
Team name is missing | Missing inf |
401 | text/plain |
Name provided is not correct | Invalid name |
402 | text/plain |
User has a team | User in a team |
403 | text/plain |
Team is complete | Team complete |
405 | text/plain |
Request is successful | Success |
200 | text/plain |
Method: POST
Data: JSON
Example JSON:
{
"user_email": "test1@gmail.com",
"token": "fvbnlfjnvfjnvf",
"email": "john@gmail.com",
}
Returns:
Situation | Value | HTTP Code | Type |
---|---|---|---|
Hacker email is missing | Missing inf |
401 | text/plain |
Team is complete | Team complete |
402 | text/plain |
Request is successful | Success |
200 | text/plain |