Backend for anyApp.
Recieves the webpage for django admin.
Method |
POST |
URL |
/api/user/create/ |
Request |
|
username |
String |
password |
String |
email |
String |
Response |
|
id |
Int |
username |
String |
email |
String |
token |
String |
Creates a new user, returns primary key and token.
Method |
POST |
URL |
/api/user/login/ |
Request |
|
username |
String |
password |
String |
Backend uses obtain_auth_token.
Method |
GET |
URL |
/api/user/profile/ |
Header |
|
Authorization |
Token String |
Response |
|
id |
Int |
profileName |
String |
createDate |
String |
profileInfo |
String |
Obtains profile information for authenticated user.
Method |
POST |
URL |
/api/user/profile/ |
Header |
|
Authorization |
Token String? |
Response |
|
isSelf |
Boolean |
profileName |
String |
userIconUrl |
String |
userBkgUrl |
String |
createDate |
String |
profileInfo |
String |
Similar to GET, but if there is an auth token, backend will check if it == userId, and return the value to isSelf.
Method |
POST |
URL |
/api/tweet/ |
Header |
|
Authorization |
Token String |
Request |
|
text |
String |
replies |
Int? |
image |
MultipartBody |
video |
MultipartBody |
Response |
|
id |
Int |
text |
String |
imageUrl |
String |
videoUrl |
String |
replies |
Int |
User attempts to tweet out something, if success then respond with tweet data.
Method |
POST |
URL |
/api/tweet/like/ |
Header |
|
Authorization |
Token String? |
Request |
|
likeTweetId |
String |
User attempts to like sth => liked = true, if like already exists then => taking back the like, which means liked = false.