-
Notifications
You must be signed in to change notification settings - Fork 0
/
endpoints.txt
90 lines (69 loc) · 1.71 KB
/
endpoints.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
1) register/
inputs field names:
email
password
leetcode_name (can be empty or can be ignored, refers to leetcode username)
response:
{
"status": "success"
} and status 201
{
"error": "please provide both email and password"
} and status code 400
2) login/
inputs field names:
email
password
response:
{
"key": <token>,
"email": <email>
}
{'error': 'Invalid Credentials'} and status code 401
3) register_leetcode/
usage : to register leetcode username to an existing user
Header:
Authorization: token <token>
Eg:-
Authorization : token baf8bb0d58f5420e8d7ec3aec774e4a
inputs field names:
leetcode_name (refers to leetcode username)
output:
{
"status": "success"
}and status code 201
{'error': 'leetcode account for this user already exists'} and status code 400
{'error': 'Please provide leetcode username'} and status code 400
3) getLeetcodeInfo/
usage : to get leetcode leaderboard info
Header:
Authorization : token <token>
output:
{
{
"username": "rimjhimittal",
"name": "Rimjhim Mittal",
"rank": "900,547",
"photo_url": "https://assets.leetcode.com/users/avatars/avatar_1668491883.png",
"number_of_questions": 58,
"last_solved": "10 days ago"
}
}
4) getCodechefInfo/
usage : to get codechef leaderboard info
Header :
Authorization : token <token>
output:
[
{
"serialNumber": 1,
"username": "chandravo",
"name": "Chandravo Bhattacharya",
"rating": 1382,
"global_rank": "65169",
"country_rank": "60159",
"stars": "1 star",
"photo_url": "https://cdn.codechef.com/sites/default/files/uploads/pictures/651508545b2faff91e2beaafdd3a5628.jpg",
"number_of_questions": "45"
}
]