Generating A Json Quiz and Applying Api Testing Using Postman Tool
Generating A Json Quiz and Applying Api Testing Using Postman Tool
=====================================================================
Ex.No. : 1 Student Name :
Date : 30.11.2025 Roll No. :
=====================================================================
Aim
To generate a JSON Quiz using the Open Trivia Database (OpenTDB) API and perform
API testing using the Postman tool.
Procedure
Step 1: Open the Open Trivia Database (OpenTDB) website by navigating to the URL:
https://opentdb.com.
1
Category: Choose a category such as Science: Computers or General Knowledge.
Difficulty Level: Select either Easy, Medium, or Hard.
Type of Questions: Choose either Multiple Choice Questions or True or False.
Encoding Option: Select one of the encoding methods:
o Default Encoding
o Base64 Encoding
o Legacy URL Encoding
o URL Encoding (RFC 3986)
Once all options are selected, press the Generate URL button.
Step 4: A new window will appear displaying the API URL. Copy the generated API URL. For
example:
https://opentdb.com/api.php?amount=10&category=18&difficulty=medium&type=multiple
2
Step 5: Open the Postman tool by navigating to https://www.postman.com/product/tools/.
Step 6: Click on the Sign In button and enter your Postman account credentials.
3
Step 7: In the Postman interface, select the Send an API request option and click on New
Request.
4
Step 8: In the new request window:
Select the GET method from the dropdown.
Paste the copied API URL in the request URL field.
Step 9: Click on the Send button to execute the API request.
Step 10: Postman will process the API request and display the response along with the status
code. The following are possible status codes and their meanings:
200 - OK (Successful request execution)
201 - Created (Resource successfully created)
204 - No Content (Successful but no content returned)
400 - Bad Request (Incorrect request format)
401 - Unauthorized (Authentication required)
404 - Not Found (Requested resource not available)
405 - Method Not Allowed (Invalid HTTP method used)
If the response status is 200 OK, it confirms that the API request was executed successfully
without errors.
5
Output
{
"response_code": 0,
"results": [
{
"type": "multiple",
"difficulty": "medium",
"category": "Science: Computers",
"question": "Laserjet and inkjet printers are both examples of what type of printer?",
"correct_answer": "Non-impact printer",
"incorrect_answers": [
"Impact printer",
"Daisywheel printer",
"Dot matrix printer"
]
},
{
"type": "multiple",
"difficulty": "medium",
"category": "Science: Computers",
"question": "On which computer hardware device is the BIOS chip located?",
"correct_answer": "Motherboard",
"incorrect_answers": [
"Hard Disk Drive",
"Central Processing Unit",
"Graphics Processing Unit"
]
},
{
"type": "multiple",
"difficulty": "medium",
6
"category": "Science: Computers",
"question": ".rs is the top-level domain for what country?",
"correct_answer": "Serbia",
"incorrect_answers": [
"Romania",
"Russia",
"Rwanda"
]
},
{
"type": "multiple",
"difficulty": "medium",
"category": "Science: Computers",
"question": "How fast is USB 3.1 Gen 2 theoretically?",
"correct_answer": "10 Gb/s",
"incorrect_answers": [
"5 Gb/s",
"8 Gb/s",
"1 Gb/s"
]
},
{
"type": "multiple",
"difficulty": "medium",
"category": "Science: Computers",
"question": "What does AD stand for in relation to Windows Operating Systems? ",
"correct_answer": "Active Directory",
"incorrect_answers": [
"Alternative Drive",
"Automated Database",
"Active Department"
7
]
},
{
"type": "multiple",
"difficulty": "medium",
"category": "Science: Computers",
"question": "On which day did the World Wide Web go online?",
"correct_answer": "December 20, 1990",
"incorrect_answers": [
"December 17, 1996",
"November 12, 1990",
"November 24, 1995"
]
},
{
"type": "multiple",
"difficulty": "medium",
"category": "Science: Computers",
"question": "Which one of these is not an official development name for a Ubuntu
release?",
"correct_answer": "Mystic Mansion",
"incorrect_answers": [
"Trusty Tahr",
"Utopic Unicorn",
"Wily Werewolf"
]
},
{
"type": "multiple",
"difficulty": "medium",
"category": "Science: Computers",
8
"question": "What was the first Android version specifically optimized for tablets?",
"correct_answer": "Honeycomb",
"incorrect_answers": [
"Eclair",
"Froyo",
"Marshmellow"
]
},
{
"type": "multiple",
"difficulty": "medium",
"category": "Science: Computers",
"question": "What was the first commerically available computer processor?",
"correct_answer": "Intel 4004",
"incorrect_answers": [
"Intel 486SX",
"TMS 1000",
"AMD AM386"
]
},
{
"type": "multiple",
"difficulty": "medium",
"category": "Science: Computers",
"question": "All of the following programs are classified as raster graphics editors
EXCEPT:",
"correct_answer": "Inkscape",
"incorrect_answers": [
"Paint.NET",
"GIMP",
"Adobe Photoshop"
9
]
}
]
}
Result
The JSON Quiz was generated using OpenTDB API, and API testing was successfully
conducted using Postman. The response was validated based on HTTP status codes, confirming
successful request execution.
10