Skip to content

Latest commit

 

History

History
783 lines (768 loc) · 12.5 KB

routes.md

File metadata and controls

783 lines (768 loc) · 12.5 KB

Authentication

POST /authentication/register

Request

{
    "username": "String",
    "email": "String",
    "password": "String",
    "name": "String"
}

Response

{
    "username": "String",
    "email": "String",
    "name": "String",
    "created_at": "Date",
    "updated_at": "Date",
    "deleted_at": "Date"
}

POST /authentication/login

Request

{
    "username": "String",
    "password": "String",
}

Response

{
    "token_id": "Number",
    "user_id": "Number",
    "token_value": "String",
    "created_at": "Date",
    "updated_at": "Date",
    "deleted_at": "Date"
}

GET /authentication/me

Request

Response

{
    "user_id": "Number",
    "username": "String",
    "email": "String",
    "name": "String",
    "created_at": "Date",
    "updated_at": "Date",
    "deleted_at": "Date"
}

User

GET /users/:id

Request

Response

{
    "user_id":"Number",
    "username":"String",
    "email":"String",
    "name":"String",
    "friends":{
        "username":"String",
        "name":"String",
        "email":"String"
    },
    "wanted_list":[
        {
            "content_name":"String",
            "owner_name":"String",
            "status":"String",
            "my_rate":"Number",
            "created_at":"Date"
        }
    ],
    "comments":[
        {
            "id":"int",
            "discussion_id":"int",
            "parent_comment_id":"int",
            "text":"String",
            "is_spoiler":"bool",
            "created_at":"Date",
            "updated_at":"Date",
            "deleted_at":"Date"
        }
    ],
    "created_at":"Date",
    "updated_at":"Date",
    "deleted_at":"Date"
}

PUT /users/:id

Request

{
    "updatable-key": "value"
}

Response

{
    "user_id": "Number",
    "username": "String",
    "email": "String",
    "name": "String",
    "created_at": "Date",
    "updated_at": "Date",
    "deleted_at": "Date"
}

DELETE /users/:id

Request

Response

{
    "message": "User `DELETE`d successfully!"
}

Contents

POST /contents/

Request

{
    "name":"String",
    "type":"String",
    "description":"String",
    "image":"String",
}

Response

{
    "id":"Number",
    "user_id":"Number",
    "image":"String",
    "name":"String",
    "type":"String",
    "description":"String",
    "views":"Number",
    "rate":"Number",
    "created_at":"Date",
    "updated_at":"Date",
    "deleted_at":"Date"
}

GET /contents/:id

Request

Response

{
    "id":"Number",
    "user_id":"Number",
    "image":"String",
    "name":"String",
    "type":"String",
    "description":"String",
    "views":"Number",
    "rate":"Number",
    "my_score": "Number",
    "wanted_status":"String",
    "created_at":"Date",
    "updated_at":"Date",
    "deleted_at":"Date"
}

PUT /contents/:id

Request

{
    "updatable-key": "value"
}

Response

{
    "id":"Number",
    "user_id":"Number",
    "image":"String",
    "name":"String",
    "type":"String",
    "description":"String",
    "views":"Number",
    "rate":"Number",
    "created_at":"Date",
    "updated_at":"Date",
    "deleted_at":"Date"
}

DELETE /contents/:id

Request

Response

{
    "message": "User `DELETE`d successfully!"
}

Comments

POST /comments/

Request

{
    "content_review_id":"Number",
    "discussion_id":"Number",
    "parent_comment_id":"Number",
    "text":"String",
    "is_spoiler":"Bool",
    "created_at":"Date",
    "updated_at":"Date",
    "deleted_at":"Date"
}

Response

{
    "id":"Number",
    "user_id":"Number",
    "content_review_id":"Number",
    "discussion_id":"Number",
    "parent_comment_id":"Number",
    "text":"String",
    "is_spoiler":"Bool",
    "created_at":"Date",
    "updated_at":"Date",
    "deleted_at":"Date"
}

PUT /comments/:id

Request

{
    "updatable-key": "value"
}

Response

{
    "id":"Number",
    "user_id":"Number",
    "content_review_id":"Number",
    "discussion_id":"Number",
    "parent_comment_id":"Number",
    "text":"String",
    "is_spoiler":"Bool",
    "created_at":"Date",
    "updated_at":"Date",
    "deleted_at":"Date"
}

DELETE /comments/:id

Request

Response

{
    "message": "Comment `DELETE`d successfully!"
}

GET /users/:userId/comments

Request

Response

{
    "comments":[
        {
            "id":"Number",
            "content_review_id":"Number",
            "discussion_id":"Number",
            "parent_comment_id":"Number",
            "text":"String",
            "is_spoiler":"Bool",
            "created_at":"Date",
            "updated_at":"Date",
            "deleted_at":"Date"
        }
    ]
}

GET /users/:userId/comments/:id

Request

Response

 {
    "id":"Number",
    "content_review_id":"Number",
    "discussion_id":"Number",
    "parent_comment_id":"Number",
    "text":"String",
    "is_spoiler":"Bool",
    "created_at":"Date",
    "updated_at":"Date",
    "deleted_at":"Date"
}

Wanted List

POST /wanted-list

Request

{
    "content_id":"Number",
    "status":"String",
    "my_score":"Number"
}

Response

{
    "id":"Number",
    "user_id":"Number",
    "content_id":"Number",
    "status":"String",
    "my_score":"Number",
    "created_at":"Date",
    "updated_at":"Date",
    "deleted_at":"Date"
}

GET /wanted-list

Request

Response

{
    "wantedLists": [
        {
            "id":"Number",
            "user_id":"Number",
            "content_id":"Number",
            "status":"String",
            "my_score":"Number",
            "created_at":"Date",
            "updated_at":"Date",
            "deleted_at":"Date"
        }
    ]
}

PUT /wanted-list/:contentId

Request

{
  "updatable-key": "value"
}

Response

{
    "id":"Number",
    "user_id":"Number",
    "content_id":"Number",
    "status":"String",
    "my_score":"Number",
    "created_at":"Date",
    "updated_at":"Date",
    "deleted_at":"Date"
}

DELETE /wanted-list/:contentId

Request

Response

{
    "message": "Content deleted successfully from yours wanted list!",
}

GET /users/:userId/wanted-list

Request

Response

{
    "wanted_lists":[
        {
            "id":"Integer",
            "content_id":"Integer",
            "status":"String",
            "my_score":"Number",
            "created_at":"Date",
            "updated_at":"Date",
            "deleted_at":"Date"
        }
    ]
}

GET /users/:userId/wanted-list

Request

Response

{
    "message": "Comment `DELETE`d successfully!",
}

Reviews

POST /reviews/

Request

{
    "content_id":"Number",
    "text":"String",
    "status":"String",
    "score":"Number",
    "is_spoiler":"Bool",
}

Response

{
    "id":"Number",
    "user_id":"Number",
    "content_id":"Number",
    "text":"String",
    "status":"String",
    "score":"Number",
    "is_spoiler":"Bool",
    "created_at":"Date",
    "updated_at":"Date",
    "deleted_at":"Date"
}

PUT /reviews/:id

Request

{
  "updatable-key": "value"
}

Response

{
    "id":"Number",
    "user_id":"Number",
    "content_id":"Number",
    "text":"String",
    "status":"String",
    "score":"Number",
    "is_spoiler":"Bool",
    "created_at":"Date",
    "updated_at":"Date",
    "deleted_at":"Date"
}

GET /users/:userId/reviews

Request

Response

{
    "wanted_lists":[
        {
            "id":"Integer",
            "content_id":"Integer",
            "status":"String",
            "my_score":"Number",
            "created_at":"Date",
            "updated_at":"Date",
            "deleted_at":"Date"
        }
    ]
}

GET /contents/:contentId/reviews

Request

Response

{
    "reviews":[
        {
            "id":"Number",
            "user_id":"Number",
            "image":"String",
            "name":"String",
            "type":"String",
            "description":"String",
            "views":"Number",
            "rate":"Number",
            "created_at":"Date",
            "updated_at":"Date",
            "deleted_at":"Date"
        }
    ]
}

DELETE /reviews/:id

Request

Response

{
    "message": "Review `DELETE`d successfully!",
}

Communities

POST /communities/

Request

{
    "organizers":[
        "Number"
    ],
    "image":"String",
    "name":"String",
    "content_types":[
        "String"
    ],
    "description":"String",
    "tags":[
        "String"
    ],
    "website":"String",
    "rules":"String",
}

Response

{
    "id":"Number",
    "organizers":[
        "Number"
    ],
    "image":"String",
    "name":"String",
    "content_types":[
        "String"
    ],
    "description":"String",
    "tags":[
        "String"
    ],
    "website":"String",
    "rules":"String",
    "created_at":"Date",
    "updated_at":"Date",
    "deleted_at":"Date"
}

PUT /communities/:id

Request

{
    "updatable-key": "value"
}

Response

{
    "id":"Number",
    "organizers":[
        "Number"
    ],
    "image":"String",
    "name":"String",
    "content_types":[
        "String"
    ],
    "description":"String",
    "tags":[
        "String"
    ],
    "website":"String",
    "rules":"String",
    "created_at":"Date",
    "updated_at":"Date",
    "deleted_at":"Date"
}

GET /communities/:id

Request

Response

{
    "id":"Number",
    "organizers":[
        "Number"
    ],
    "image":"String",
    "name":"String",
    "content_types":[
        "String"
    ],
    "description":"String",
    "tags":[
        "String"
    ],
    "website":"String",
    "rules":"String",
    "created_at":"Date",
    "updated_at":"Date",
    "deleted_at":"Date"
}

DELETE /communities/:id

Request

Response

{
    "message": "Community `DELETE`d successfully!",
}

Discussions

POST /discussions

Request

{
    "user_id":"Number",
    "community_id":"Number",
    "header":"String",
    "text":"String",
    "is_privite":"Bool",
}

Response

{
    "id":"Number",
    "user_id":"Number",
    "community_id":"Number",
    "header":"String",
    "text":"String",
    "is_privite":"Bool",
    "created_at":"Date",
    "updated_at":"Date",
    "deleted_at":"Date"
}

PUT /discussions/:id

Request

{
  "updatable-key": "value"
}

Response

{
    "id":"Number",
    "user_id":"Number",
    "community_id":"Number",
    "header":"String",
    "text":"String",
    "is_privite":"Bool",
    "created_at":"Date",
    "updated_at":"Date",
    "deleted_at":"Date"
}

GET /discussions/:id

Request

Response

{
    "id":"Number",
    "user_id":"Number",
    "community_id":"Number",
    "header":"String",
    "text":"String",
    "is_privite":"Bool",
    "created_at":"Date",
    "updated_at":"Date",
    "deleted_at":"Date"
}

DELETE /discussions/:id

Request

Response

{
    "message": "Discussion deleted successfully!"
}

GET /communities/:communityId/discussions

Request

Response

{
    "discussions":[
        {
            "id":"Number",
            "user_id":"Number",
            "header":"String",
            "text":"String",
            "is_privite":"Bool",
            "created_at":"Date",
            "updated_at":"Date",
            "deleted_at":"Date"
        }
    ]
}

Messages

Post /messages

Request

{
    "to": "Number",
    "text": "String"
}

Response

{
    "status": "String",
    "timestamp": "Date"
}

GET /messages

Request

{
    "to": "Number"
}

Response

{
    "messages": [
        {
            "from": "Number",
            "to": "Number",
            "text": "String",
            "created_at": "Date"
        }
    ]
}

DELETE /messages/:id

Request

Response

{
    "message": "Message deleted successfully!"
}

Images

Post /images

Request

{
    "name": "String",
    "path": "String"
}

Response

{
    "id": "Number",
    "name": "String",
    "path": "String",
    "created_at": "Date",
}

GET /images/:id

Request

Response

{
    "id": "Number",
    "name": "String",
    "path": "String",
    "created_at": "Date",
}

DELETE /images/:id

Request

Response

{
    "message": "Image deleted successfully!"
}