Skip to content

Example API Calls

Can edited this page Dec 29, 2023 · 3 revisions

NOTES :

  • In order to replicate requests, one may take a JWT token by calling login endpoint with his/her register info. All of these endpoints can be found in the API documentation and Swagger.
  • All requests can be called without JWT token yet the caller will be treated as a guest user.
  • Postman collection : final milestone collection.postman_collection.json

Get Homepage Posts

Params :

  • sortBy
  • sortDirection

If sortBy and sortDirection is not given by the developer, they will be assigned to creation date and descending as default respectively

Headers :

  • Besides default headers, Authorization header need to be added to request in order to process sign in info of the user. Bearer JWT Token needs to be provided in authorization header. (If authorization token is not provided, request will be processed as if it is called by a guest user)
image

Example Response :

[
  {
    "id": "string",
    "title": "string",
    "postContent": "string",
    "postImage": "string",
    "poster": {
      "id": "string",
      "createdAt": "2023-12-29T18:39:08.804Z",
      "isDeleted": true,
      "username": "string",
      "password": "string",
      "email": "string",
      "role": "BASIC",
      "isVerified": true,
      "verified": true
    },
    "achievement": {
      "id": "string",
      "createdAt": "2023-12-29T18:39:08.804Z",
      "isDeleted": true,
      "title": "string",
      "description": "string",
      "icon": "string",
      "type": "GAME",
      "game": "string"
    },
    "character": {
      "id": "string",
      "createdAt": "2023-12-29T18:39:08.804Z",
      "isDeleted": true,
      "name": "string",
      "icon": "string",
      "description": "string",
      "games": [
        "string"
      ],
      "type": "string",
      "gender": "string",
      "race": "string",
      "status": "string",
      "occupation": "string",
      "birthDate": "string",
      "voiceActor": "string",
      "height": "string",
      "age": "string",
      "customFields": {
        "additionalProp1": "string",
        "additionalProp2": "string",
        "additionalProp3": "string"
      }
    },
    "userVote": "UPVOTE",
    "forum": "string",
    "type": "GAME",
    "typeId": "string",
    "typeName": "string",
    "lastEditedAt": "2023-12-29T18:39:08.804Z",
    "tags": [
      {
        "id": "string",
        "createdAt": "2023-12-29T18:39:08.804Z",
        "isDeleted": true,
        "name": "string",
        "tagType": "GROUP",
        "color": "string"
      }
    ],
    "inappropriate": true,
    "locked": true,
    "overallVote": 0,
    "voteCount": 0,
    "createdAt": "2023-12-29T18:39:08.804Z",
    "isDeleted": true,
    "isPromoted": true
  }
]

Get Characters of a Game

Params :

  • gameId

Headers :

  • Guest user and signed in user are being treated same in terms of this request, hence authorization header is not required. Image below is an example header for signed in user.
image

Example Response :

[
  {
    "id": "string",
    "createdAt": "2023-12-29T19:06:54.010Z",
    "isDeleted": true,
    "name": "string",
    "icon": "string",
    "description": "string",
    "games": [
      "string"
    ],
    "type": "string",
    "gender": "string",
    "race": "string",
    "status": "string",
    "occupation": "string",
    "birthDate": "string",
    "voiceActor": "string",
    "height": "string",
    "age": "string",
    "customFields": {
      "additionalProp1": "string",
      "additionalProp2": "string",
      "additionalProp3": "string"
    }
  }
]

Get Profile

Params :

  • userId

Headers :

  • Besides default headers, Authorization header need to be added to request in order to process sign in info of the user. Bearer JWT Token needs to be provided in authorization header. (If authorization token is not provided, request will be resulted in an error since user will be not found hence the profile.)
image

Example Response :

{
  "id": "string",
  "user": {
    "id": "string",
    "createdAt": "2023-12-29T18:56:36.373Z",
    "isDeleted": true,
    "username": "string",
    "password": "string",
    "email": "string",
    "role": "BASIC",
    "isVerified": true,
    "verified": true
  },
  "achievements": [
    {
      "id": "string",
      "createdAt": "2023-12-29T18:56:36.373Z",
      "isDeleted": true,
      "title": "string",
      "description": "string",
      "icon": "string",
      "type": "GAME",
      "game": "string"
    }
  ],
  "reviewCount": 0,
  "voteCount": 0,
  "commentCount": 0,
  "postCount": 0,
  "isReviewedYet": true,
  "isVotedYet": true,
  "isCommentedYet": true,
  "isPostedYet": true,
  "isPrivate": true,
  "profilePhoto": "string",
  "games": [
    {
      "id": "string",
      "gameName": "string",
      "gameDescription": "string",
      "gameIcon": "string",
      "overallRating": 0,
      "ratingCount": 0,
      "releaseDate": "2023-12-29T18:56:36.373Z",
      "forum": "string",
      "playerTypes": [
        {
          "id": "string",
          "createdAt": "2023-12-29T18:56:36.373Z",
          "isDeleted": true,
          "name": "string",
          "tagType": "GROUP",
          "color": "string"
        }
      ],
      "genre": [
        {
          "id": "string",
          "createdAt": "2023-12-29T18:56:36.373Z",
          "isDeleted": true,
          "name": "string",
          "tagType": "GROUP",
          "color": "string"
        }
      ],
      "production": {
        "id": "string",
        "createdAt": "2023-12-29T18:56:36.373Z",
        "isDeleted": true,
        "name": "string",
        "tagType": "GROUP",
        "color": "string"
      },
      "duration": {
        "id": "string",
        "createdAt": "2023-12-29T18:56:36.373Z",
        "isDeleted": true,
        "name": "string",
        "tagType": "GROUP",
        "color": "string"
      },
      "platforms": [
        {
          "id": "string",
          "createdAt": "2023-12-29T18:56:36.373Z",
          "isDeleted": true,
          "name": "string",
          "tagType": "GROUP",
          "color": "string"
        }
      ],
      "artStyles": [
        {
          "id": "string",
          "createdAt": "2023-12-29T18:56:36.373Z",
          "isDeleted": true,
          "name": "string",
          "tagType": "GROUP",
          "color": "string"
        }
      ],
      "developer": {
        "id": "string",
        "createdAt": "2023-12-29T18:56:36.373Z",
        "isDeleted": true,
        "name": "string",
        "tagType": "GROUP",
        "color": "string"
      },
      "otherTags": [
        {
          "id": "string",
          "createdAt": "2023-12-29T18:56:36.373Z",
          "isDeleted": true,
          "name": "string",
          "tagType": "GROUP",
          "color": "string"
        }
      ],
      "minSystemReq": "string",
      "createdAt": "2023-12-29T18:56:36.373Z",
      "isDeleted": true
    }
  ],
  "reviews": [
    {
      "id": "string",
      "createdAt": "2023-12-29T18:56:36.373Z",
      "isDeleted": true,
      "reviewDescription": "string",
      "rating": 0,
      "gameId": "string",
      "reviewedBy": "string",
      "overallVote": 0,
      "voteCount": 0,
      "reportNum": 0
    }
  ],
  "groups": [
    {
      "id": "string",
      "createdAt": "2023-12-29T18:56:36.373Z",
      "isDeleted": true,
      "title": "string",
      "description": "string",
      "membershipPolicy": "PUBLIC",
      "tags": [
        "string"
      ],
      "gameId": "string",
      "forumId": "string",
      "groupIcon": "string",
      "quota": 0,
      "moderators": [
        "string"
      ],
      "members": [
        "string"
      ],
      "bannedMembers": [
        "string"
      ],
      "avatarOnly": true
    }
  ],
  "steamProfile": "string",
  "epicGamesProfile": "string",
  "xboxProfile": "string"
}


💻 Meeting Notes

Cmpe 352
Cmpe 451

📝 Requirements


🪧 Diagrams


📬 Deliverables

Cmpe 352
Cmpe 451

🎇 General Contributions

Cmpe 352 Contributions

Milestone 1
Final Milestone

Cmpe 451 Contributions

Milestone 1
Milestone 2
Final Milestone

📕 Mock Up


🕵️ User Scenario



📝 RAM


📚 Research


📑 Templates


📱 Practice App

API Documentation for Practice App
Clone this wiki locally