changed 2 years ago
Linked with GitHub

CA-team:

/singin

  • method : post
  • Protected: true
  • Request Body:
 {
    "email" : String,
    "password" : String
 }
  • Response :
    • Success response:

      ​​​​​​​​{
      ​​​​​​​​    "error" :flase,
      ​​​​​​​​    "status": 200,
      ​​​​​​​​      "data":{
      ​​​​​​​​        "message" : "signed in successfully",
      ​​​​​​​​          "data":{
      ​​​​​​​​                "id": "string",
      ​​​​​​​​                "email": "string",
      ​​​​​​​​                "username": "string",
      ​​​​​​​​                "roleId": "string",
      ​​​​​​​​                "cohortId": "string",
      ​​​​​​​​                "avatar": "string"
      ​​​​​​​​                }  
      ​​​​​​​​        }
      ​​​​​​}
      
    • Errors response:

      • validation error:
      ​​​​​​​​  {
      ​​​​​​​​    "error" :true,
      ​​​​​​​​     "status": "422",
      ​​​​​​​​     "data": {
      ​​​​​​​​        "message": "Validation error",
      ​​​​​​​​        "errors": []
      ​​​​​​​​ }
      ​​​​​​​​}
      ​​​​​
      
      • Unauthorized error:
      ​​​​​​​​  {
      ​​​​​​​​    "error" :true,
      ​​​​​​​​    "status": "401",
      ​​​​​​​​    "data": {
      ​​​​​​​​        "message": "Invalid credentials provided"
      ​​​​​​​​    }
      ​​​​​​}
      
      • Bad Request error:
      ​​​​​​​​​ {
      ​​​​​​​​​   "error" :true,
      ​​​​​​​​​   "status": "400",
      ​​​​​​​​​   "data": {
      ​​​​​​​​​       "message": "Invalid request syntax or missing parameters"
      ​​​​​​​​​     }
      ​​​​​​}
      

/profile/:id

  • Method: GET
  • Protected: true
  • Response:
    • Success response:
      • Status code: 200
      • Response JSON:
        ​​​​​​​​​​​​{
        ​​​​​​​​​​​​    "error": boolean,
        ​​​​​​​​​​​​    "message": "Profile Successfully",
        ​​​​​​​​​​​​    "data": [
        ​​​​​​​​​​​​        {
        ​​​​​​​​​​​​            "id": int,
        ​​​​​​​​​​​​            "email": String,
        ​​​​​​​​​​​​            "username": String,
        ​​​​​​​​​​​​            "roleId": String,
        ​​​​​​​​​​​​            "cohortId": String,
        ​​​​​​​​​​​​            "avatar": String
        ​​​​​​​​​​​​        }
        ​​​​​​​​​​​​    ]
        ​​​​​​​​​​​​}
        
    • Errors response:
      • Status code:
        • Unauthorized: 401
        • Server error: 500
      • Response JSON:
        ​​​​​​​​​​​​{
        ​​​​​​​​​​​​    "error": true,
        ​​​​​​​​​​​​    "message": "error message",
        ​​​​​​​​​​​​    "data": null
        ​​​​​​​​​​​​}
        

/posts/:id

  • Method: GET
  • Protected: true
  • Response:
    • Success response:
      • Status code: 200
      • Response JSON:
        ​​​​​​​​​​​​{
        ​​​​​​​​​​​​    "error": false,
        ​​​​​​​​​​​​    "message": "Success",
        ​​​​​​​​​​​​    "data": [
        ​​​​​​​​​​​​        {
        ​​​​​​​​​​​​            "post_id":int,
        ​​​​​​​​​​​​            "post_content":string,
        ​​​​​​​​​​​​            "user_id":int
        ​​​​​​​​​​​​        }
        ​​​​​​​​​​​​    ]
        ​​​​​​​​​​​​}
        
    • Errors response:
      • Status code:
        • Unauthorized: 401
        • Not found: 404
        • Server error: 500
      • Response JSON:
        ​​​​​​​​​​​​{
        ​​​​​​​​​​​​    "error": true,
        ​​​​​​​​​​​​    "message": "error message",
        ​​​​​​​​​​​​    "data": null
        ​​​​​​​​​​​​}
        

/comments/:id

  • Method: GET
  • Protected: true
  • Response:
    • Success response:
      • Status code: 200
      • Response JSON:
        ​​​​​​​​​​​​{
        ​​​​​​​​​​​​    "error": false,
        ​​​​​​​​​​​​    "message": "Profile Successfully",
        ​​​​​​​​​​​​    "data": [
        ​​​​​​​​​​​​        {
        ​​​​​​​​​​​​            "user_id":int,
        ​​​​​​​​​​​​            "comment_id":int,
        ​​​​​​​​​​​​            "post_id":int,
        ​​​​​​​​​​​​            "comment_content":string,
        ​​​​​​​​​​​​            "cohort_id":int
        ​​​​​​​​​​​​        }
        ​​​​​​​​​​​​    ]
        ​​​​​​​​​​​​}
        
    • Errors response:
      • Status code:
        • Not found: 404
        • Server error: 500
      • Response JSON:
        ​​​​​​​​​​​​{
        ​​​​​​​​​​​​    "error": true,
        ​​​​​​​​​​​​    "message": "error message",
        ​​​​​​​​​​​​    "data": null
        ​​​​​​​​​​​​}
        

/users

  • method :post
  • Protected: true
  • Request Body:
 {
    "email": String,
    "userName": String,
    "role": string,
    "cohort": string
 }
  • Response :
    • Success response:

      ​​​​​​​​{
      ​​​​​​​​    "error" :flase,
      ​​​​​​​​    "status": 200,
      ​​​​​​​​      "data":{
      ​​​​​​​​        "message" : "User has been added successfully",
      ​​​​​​​​        "user": {
      ​​​​​​​​              "email": "karam@11.com",
      ​​​​​​​​              "userName": "KaramZ",
      ​​​​​​​​              "role": "CA-Team",
      ​​​​​​​​              "cohort": "G11"
      ​​​​​​​​           }
      ​​​​​​​​      }
      ​​​​​​}
      
      ​​​​​​​​        
      ​​​​​​​​    
      
    • Errors response:

      • validation error:
      ​​​​​​​​  {
      ​​​​​​​​    "error" :true,
      ​​​​​​​​     "status": "422",
      ​​​​​​​​     "data": {
      ​​​​​​​​        "message": "Validation error",
      ​​​​​​​​        "errors": []
      ​​​​​​​​ }
      ​​​​​​​​}
      ​​​​​
      
      • Unauthorized error:
      ​​​​​​​​  {
      ​​​​​​​​    "error" :true,
      ​​​​​​​​    "status": "401",
      ​​​​​​​​    "data": {
      ​​​​​​​​        "message": "Invalid credentials provided"
      ​​​​​​​​    }
      ​​​​​​}
      
      • Bad Request error:
      ​​​​​​​​​ {
      ​​​​​​​​​   "error" :true,
      ​​​​​​​​​   "status": "400",
      ​​​​​​​​​   "data": {
      ​​​​​​​​​       "message": "Invalid request syntax or missing parameters"
      ​​​​​​​​​     }
      ​​​​​​}
      

/cohorts

  • method :post
  • Protected: true
  • Request Body:
 {
    "name": String,
    "thumbnail": file,
    "created_at": date,
    "start_at": date,
    "end_at": date    
 }
  • Response :
    • Success response:

      ​​​​​​​​{
      ​​​​​​​​    "error" :flase,
      ​​​​​​​​    "status": 200,
      ​​​​​​​​      "data":{
      ​​​​​​​​        "message" : "User has been added successfully",
      ​​​​​​​​        "cohort": {
      ​​​​​​​​              "id": string,
      ​​​​​​​​              "cohortName": string,
      ​​​​​​​​              "thumbnail": file,   
      ​​​​​​​​              "created_at": date,
      ​​​​​​​​              "start_at": date,
      ​​​​​​​​               "end_at": date   
      ​​​​​​​​           }
      ​​​​​​​​      }
      ​​​​​​}
      
      ​​​​​​​​        
      ​​​​​​​​    
      
    • Errors response:

      • validation error:
      ​​​​​​​​  {
      ​​​​​​​​    "error" :true,
      ​​​​​​​​     "status": "422",
      ​​​​​​​​     "data": {
      ​​​​​​​​        "message": "Validation error",
      ​​​​​​​​        "errors": []
      ​​​​​​​​ }
      ​​​​​​​​}
      ​​​​​
      
      • Unauthorized error:
      ​​​​​​​​  {
      ​​​​​​​​    "error" :true,
      ​​​​​​​​    "status": "401",
      ​​​​​​​​    "data": {
      ​​​​​​​​        "message": "Invalid credentials provided"
      ​​​​​​​​    }
      ​​​​​​}
      
      • Bad Request error:
      ​​​​​​​​​ {
      ​​​​​​​​​   "error" :true,
      ​​​​​​​​​   "status": "400",
      ​​​​​​​​​   "data": {
      ​​​​​​​​​       "message": "Invalid request syntax or missing parameters"
      ​​​​​​​​​     }
      ​​​​​​}
      

/users/:cohortid

  • Method: GET
  • Protected: true
  • Response:
    • Success response:
      • Status code: 200
      • Response JSON:
        ​​​​​​​​​​​​{
        ​​​​​​​​​​​​    "error": false,
        ​​​​​​​​​​​​    "message": "Profile Successfully",
        ​​​​​​​​​​​​    "data": [
        ​​​​​​​​​​​​        {
        ​​​​​​​​​​​​            "name": String,
        ​​​​​​​​​​​​            "thumbnail": file,
        ​​​​​​​​​​​​            "created_at": date,
        ​​​​​​​​​​​​            "start_at": date,
        ​​​​​​​​​​​​            "end_at": date 
        ​​​​​​​​​​​​        }
        ​​​​​​​​​​​​    ]
        ​​​​​​​​​​​​}
        
    • Errors response:
      • Status code:
        • Not found: 404
        • Server error: 500
      • Response JSON:
        ​​​​​​​​​​​​{
        ​​​​​​​​​​​​    "error": true,
        ​​​​​​​​​​​​    "message": "error message",
        ​​​​​​​​​​​​    "data": null
        ​​​​​​​​​​​​}
        

/users/:user_id

  • Method: GET
  • Protected: true
  • Response:
    • Success response:
      • Status code: 200
      • Response JSON:
        ​​​​​​​​​​​​{
        ​​​​​​​​​​​​    "error": false,
        ​​​​​​​​​​​​    "message": "Profile Successfully",
        ​​​​​​​​​​​​    "data": [
        ​​​​​​​​​​​​        {
        ​​​​​​​​​​​​            "name": String,
        ​​​​​​​​​​​​            "thumbnail": file,
        ​​​​​​​​​​​​            "created_at": date,
        ​​​​​​​​​​​​            "start_at": date,
        ​​​​​​​​​​​​             "end_at": date 
        ​​​​​​​​​​​​        }
        ​​​​​​​​​​​​    ]
        ​​​​​​​​​​​​}
        
    • Errors response:
      • Status code:
        • Unauthorized: 401
        • Server error: 500
      • Response JSON:
        ​​​​​​​​​​​​{
        ​​​​​​​​​​​​    "error": true,
        ​​​​​​​​​​​​    "message": "error message",
        ​​​​​​​​​​​​    "data": null
        ​​​​​​​​​​​​}
        

/notes

  • Method: post
  • Protected: true
  • Response:
    • Success response:
      • Status code: 200
      • Response JSON:
        ​​​​​​​​​​​​{
        ​​​​​​​​​​​​    "error": false,
        ​​​​​​​​​​​​    "message": "Profile Successfully",
        ​​​​​​​​​​​​    "data": [
        ​​​​​​​​​​​​        {   "id":int
        ​​​​​​​​​​​​            "content":string,
        ​​​​​​​​​​​​            "mentor_id":string,
        ​​​​​​​​​​​​            "created_at": date,
        ​​​​​​​​​​​​            "updated_at": date 
        ​​​​​​​​​​​​        }
        ​​​​​​​​​​​​    ]
        ​​​​​​​​​​​​}
        
    • Errors response:
      • Status code:
        • Unauthorized: 401
        • Server error: 500
      • Response JSON:
        ​​​​​​​​​​​​{
        ​​​​​​​​​​​​    "error": true,
        ​​​​​​​​​​​​    "message": "error message",
        ​​​​​​​​​​​​    "data": null
        ​​​​​​​​​​​​}
        
Select a repo