Routes - galamshar/AituForum GitHub Wiki

Struct:

method route need_token

Pagination:
  pageNumber - Number of page.
  pageSize - Size of page.

Ready-made collection of requests for Postman : Download

Auth:

/api/auth

  • POST /sign-in false Request for login, returns token
Form body: 
  login: string,  
  password: string  
  • POST /register false Request for register, returns token
Form body: 
  login: string,  
  password: string  
  • GET /logout true Request for logout, removes token

Account

api/accounts

  • GET /profile true Returns account by account id
Params:  
  accountId : long
  • GET /posts true Returns account posts by account id
Params:  
  accountId : long
  pageNumber : int
  pageSize : int
  • GET /topics true Returns account topics by account id
Params:  
  accountId : long
  pageNumber : int
  pageSize : int

Posts

api/posts

  • GET /count/{authorId} false Returns count of posts by Author Id
  • GET /{postId} true Gets post by its id.
  • GET /by-topic/{topicId} true Gets posts by Topic id.
Params:  
  accountId : long
  pageNumber : int
  pageSize : int
  • POST /{topicId}/post true Create new post by Topic id.
Form body: 
  text: string
  • POST /edit-post true Edit post by Post id.
Form body: 
  postId: long
  newText: string

Topics

api/topics

  • GET /count/{authorId} false Returns count of topics by Author Id
  • GET /posts-count/{topicId} false Returns count of posts in Topic
  • GET /root-topics false Gets root topics.
Params:  
  pageNumber : int
  pageSize : int
  • GET /sub-topics false Gets sub topics of topic.
Params:  
  topicId: long  # Parent topic id
  pageNumber : int
  pageSize : int
  • POST /create-topic true Creates new root topic. (!Only admin role)
Form body: 
  name: string
  description: string
  canOwnPosts: boolean
  rolesAllowedToRead: list #Roles which allowed to read in topic
  rolesAllowedToWrite: list #Roles which allowed to write in topic
  • POST /create-suntopic true Creates new subtopic.
Form body: 
  parentTopicId: long
  name: string
  description: string
  canOwnPosts: boolean
  rolesAllowedToRead: list
  rolesAllowedToWrite: list

Admin (!Only admin methods)

api/admin

  • POST /register true Method that allows admins to manualy create accounts in systems.
Form body: 
  login: string
  password: string
  roles: list