Skip to content
timvm1108 edited this page Mar 28, 2021 · 8 revisions

Welcome to the CMPUT404-project-socialdistribution wiki!

This is the Distributed Social Networking Project for CMPUT 404.

The following API urls are accepted, do with this as you need to.

Register

  • POST api/auth/register will create a user (author_register)

Login

  • POST api/auth/login will handle a user login request (author_login)

This takes {username:password} in the body of the request.

Author

  • GET author/<str:id>/ will retrieve an author given an author ID (author_object)
  • POST author/<str:id>/ will update an author given an author ID (author_object)
  • GET api/authors will return a list of all authors registered with the server (author_list)

Posts (Will return up to 5 comments within Post object and is paginated with a default page size of 50)

  • GET author/<str:author_id>/posts/ will return all posts by a given author ID (posts_object)
  • POST author/<str:author_id>/posts/ will create a new post (posts_object)
  • GET author/<str:author_id>/posts/<str:id>/ will retrieve a post given an author ID and post ID (post_object)
  • POST author/<str:author_id>/posts/<str:id>/ will allow an update to be performed on post data (post_object)
  • DELETE author/<str:author_id>/posts/<str:id>/ will delete allow the author of the post to delete their post (post_object)
  • PUT author/<str:author_id>/posts/<str:id>/ will create a post given an author ID and a post ID (post_object)

Comments

  • GET author/<str:author_id>/posts/<str:post_id>/comments will return all of the comments for a given post ID (comments_object)
  • POST author/<str:author_id>/posts/<str:post_id>/comments will create a comment on a given post ID (comments_object)

Likes

  • GET author/<str:author_id>/post/<str:post_id>/likes will return all likes for a given post ID (likes_post)
  • GET author/<str:author_id>/post/<str:post_id>/comments/<str:comment_id>/likes will return all likes for a given comment ID (likes_comment)

Liked

  • GET author/<str:author_id>/liked will return all objects that an author liked (liked_list)

Querying

  • POST api/query/displayName will return all authors matching the queried display name (display_names)

Followers

  • GET author/<str:author_id>/followers will return a list of followers for a given author ID (followers_list)
  • GET author/<str:author_id>/followers/<str:foreign_id> will check if a follow exists for a given follower ID (followers_object)
  • PUT author/<str:author_id>/followers/<str:foreign_id> will create a follow for a given author ID following another author ID (followers_object)
  • DELETE author/<str:author_id>/followers/<str:foreign_id> will delete a follow for a given author ID following another author ID (followers_object)

Friends

  • GET author/<str:author_id>/friends will get a list of friends for a given author ID (friends_object)

Inbox

  • GET author/<str:author_id>/inbox will get the inbox for a given author ID (inbox_object)
  • POST author/<str:author_id>/inbox will create an item in the inbox of a given author ID (inbox_object)

Clone this wiki locally