Test APIs By Postman

In this step, we will test operation of the APIs using Postman tool.

Test the listing API

  1. Click + to add a new tab
  • Select GET method
  • Replace {id} with abcd1234
  • Click Send

TestListAPI

  1. The responses result is all the information of the user’s files with the id abcd1234

TestListAPI

Test the writing API

  1. Similarly create a new tab
  • Select POST method
  • Enter URL of the writing API that recorded from the previous step
  • In Body pattern, select raw
  • Copy the below text block:
{
      "user_id": "abcd1234",
      "file": "flowers.png",
      "folder": "",
      "identityId": "123456cvbn",
      "modified": "21-03-2023",
      "size": "32KB",
      "type": "png",
      "tag": "image"
}
  • Click Send

TestListAPI

  1. Wait a moment, see the responses returned

TestListAPI

  1. Open the console of DynamoDB, select Explore items and select the Documents table to check the results:

TestListAPI

Test the deleting API

  1. Add a new tab to call the delete API
  • Select DELETE method
  • Enter URL of the deleting API that recorded from the previous step, replace {id} with abcd1234
  • In the Params section, enter file for the key and flowers.png for the value
  • Click Send

TestListAPI

  1. Check the responses result:

TestListAPI

  1. Back to the Documents table, click the Refresh button to see the results

TestListAPI