-
Notifications
You must be signed in to change notification settings - Fork 0
/
Server API.txt
121 lines (86 loc) · 1.78 KB
/
Server API.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
Creating an account:
URL : http://107.170.132.168/createAccount
Header :
Content-Type : application/json
data :
{
"firstname" : "jey",
"lastname" : "Rathnam",
"phonenumber" : 123,
"dob" : "30-01-12",
"password" : "1234",
"username" : "jairathnem"
}
return response:
if valid:
{
"username": "jairathnem"
}
if username taken:
{
"error": "username taken"
}
----------------------------------------------------------------
Logging into an account:
URL : http://107.170.132.168/Login
Header :
Content-Type : application/json
data :
{
"username" : "jairathnem",
"password" : "1234",
"device_name" : "Desktop 1"
}
return response:
if valid:
{
"username": "jairathnem",
"session_id": "szn5bKTVPnKX4Uuq0CBNfgMoeDAOGA9xUj"
}
if username taken:
null - this will be changed to send a proper error message
----------------------------------------------------------------
Add new user game:
URL : http://107.170.132.168/setUserGame
Header :
Content-Type : application/json
Virtu-auth : “-- session returmed from login’--”
data :
{
"game_id" : "1"
}
return response:
if valid:
{
"error": 0
}
----------------------------------------------------------------
Get user games:
URL : http://107.170.132.168/getUserGame
Header :
Content-Type : application/json
Virtu-auth : “-- session returmed from login’--”
return response:
{
"games": [
"xonotic"
]
}
----------------------------------------------------------------
Create game session:
URL : http://107.170.132.168/createGameSession
Header :
Content-Type : application/json
Virtu-auth : “-- session returned from login--”
data :
{
"game_id" : "1"
}
return response:
{
"session start": "2016-07-13 20:35:26.44605220:35:26.446052",
"users": [
"jairathnem",
"jairathnem12"
]
}