sogood99 / anyApp-backend

Backend for anyApp.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

anyApp-backend

Backend for anyApp.

API Specifications

Admin:

Access

Method GET
URL /admin/

Recieves the webpage for django admin.

User:

Create

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.

Login

Method POST
URL /api/user/login/
Request
username String
password String
Response
token String

Backend uses obtain_auth_token.

Profile

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?
Request
userId Int
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.

Tweet:

Tweet

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.

Like

Method POST
URL /api/tweet/like/
Header
Authorization Token String?
Request
likeTweetId String
Response
liked Boolean

User attempts to like sth => liked = true, if like already exists then => taking back the like, which means liked = false.

About

Backend for anyApp.


Languages

Language:Python 98.6%Language:Makefile 1.4%