Appearance
REST API Testing with Boomerang
Let's dive into testing REST APIs using Boomerang. We'll use the Petstore OpenAPI example to demonstrate how to import API specifications, create requests, and validate responses. Whether you're testing your own APIs or integrating with third-party services, this guide will show you how to make the most of Boomerang's REST testing capabilities.
Importing the Petstore API
- Click the "Import" button in the top navigation
- Select "OpenAPI" as the import type
- Enter the Petstore OpenAPI URL:
https://petstore3.swagger.io/api/v3/openapi.json
- Click "Import" to proceed
After import, you'll see a new collection named "Swagger Petstore" in your left sidebar with operations:
Swagger Petstore
├── POST addPet
├── PUT updatePet
├── GET findPetsByStatus
├── GET getPetById
├── DELETE deletePet
├── GET getInventory
├── POST placeOrder
├── POST createUser
└── GET getUserByName
Creating Requests from Operations
To test any endpoint, create a request from the operation:
- Double-click on an operation (e.g., "GET findPetsByStatus")
- Boomerang creates a new request tab with pre-configured: • URL • HTTP method • Query parameters • Headers • Request body schema (for POST/PUT methods)
- The request is automatically saved to your Collections
Testing Pet Endpoints
Finding Pets by Status
- Double-click "GET findPetsByStatus" operation
- A new request is created and saved to Collections with:
URL: https://petstore3.swagger.io/api/v3/pet/findByStatus?status=available Method: GET
- You can modify the status value in either the URL or PARAMS tab
- Click "Send"
You'll receive a response containing pets based on the status value:
json
[
{
"id": 9223372036854776000,
"name": "doggie",
"category": {
"id": 1,
"name": "Dogs"
},
"status": "available"
}
]
Adding a New Pet
- Double-click "POST addPet" operation
- A new request is created and saved with a pre-populated body:json
{ "name": "Fluffy", "category": { "id": 1, "name": "Dogs" }, "photoUrls": ["string"], "tags": [ { "id": 0, "name": "friendly" } ], "status": "available" }
- Click "Send" to create the pet
Working with Authentication
Boomerang currently supports Basic Authentication (Username/Password) through the AUTH tab. For other authentication types:
Use the HEADERS tab to add authentication headers directly:
// Bearer Token Authorization: Bearer your-token-here // API Key api_key: your-api-key-here // Custom Auth Custom-Auth-Header: auth-value
For basic authentication: • Select "Basic Auth" in the AUTH tab • Enter username and password • Boomerang automatically adds the Authorization header
Boomerang's integration with OpenAPI specifications makes API testing straightforward and efficient. The automatic request configuration allows you to focus on testing functionality rather than setup details.