January 30th, 2025 by Audrey Marcum
Written by Vishal Deshapande and Manasa A at MVerve
APIs (Application Programming Interfaces) are the unseen force that connects modern software applications, ensuring they function smoothly across platforms, devices, and systems. From mobile apps to cloud services, APIs power everything behind the scenes. But to keep them reliable, secure, and efficient, API testing is critical.
This article will explore why API testing matters, highlight its challenges, and provide a step-by-step walkthrough using Postman to access APIs with SpiraPlan, Inflectra’s robust agile lifecycle management (ALM) tool. By the end, you’ll have a clearer understanding of how to test APIs effectively and integrate testing into your broader development workflow.
Why API Testing is Non-Negotiable
APIs are responsible for enabling systems to talk to each other—retrieving data, processing transactions, or updating information seamlessly. However, poorly tested APIs can lead to:
- Unreliable Systems: Data may not sync, features may break, and user experiences suffer.
- Security Risks: Vulnerabilities in APIs can expose sensitive data.
- Performance Bottlenecks: Slow or overloaded APIs degrade performance, causing downtime or frustration.
To avoid these pitfalls, API testing verifies that:
- APIs return the correct responses for valid and invalid inputs.
- They can handle real-world traffic conditions.
- Security measures like authentication and encryption are in place.
- Errors are handled gracefully, without crashing systems.
With APIs playing such a pivotal role in software development, testing them isn’t just a best practice—it’s a necessity.
Tools of the Trade: Postman and SpiraPlan
Postman is one of the most widely used tools for API testing, providing an intuitive interface to send requests, inspect responses, and automate tests. Whether you’re testing a REST API or SOAP endpoints, Postman makes it straightforward to verify API behavior.
When integrated with SpiraPlan, Postman’s capabilities are enhanced. SpiraPlan allows teams to track API testing efforts alongside development tasks, providing traceability, centralized test management, and insights into test results.
A Step-by-Step Walkthrough: Accessing SpiraPlan’s REST API with Postman
When testing APIs, tools like Postman simplify the process of sending requests, inspecting responses, and automating tests. For teams using SpiraPlan, the REST API unlocks programmatic access to workspaces, requirements, and other artifacts—allowing for more efficient workflows and automation.
This section provides a practical walkthrough on how to interact with SpiraPlan’s REST API using Postman. We’ll cover how to navigate workspaces, retrieve data, and perform essential CRUD (Create, Read, Update, Delete) operations using the GET, POST, PUT, and DELETE methods, to streamline your API testing process.
Navigating SpiraPlan: UI vs. REST API
SpiraPlan allows you to interact with its workspaces and artifacts in two ways:
- Through the User Interface (UI): Ideal for quick navigation to workspaces, requirements, and other project elements.
- Programmatically via the REST API: Provides automation capabilities, scalability, and integration with tools like Postman for more streamlined testing.
Below, we’ll demonstrate both approaches, starting with accessing workspaces and progressing to CRUD operations using Postman.
Accessing Workspaces in SpiraPlan Using the User Interface
- Log in to SpiraPlan and navigate to the My Page section.
- Select your desired workspace from the list of available projects.
- Example: The workspace “Financial Management System” has a Workspace ID of 33.
- URL to access this workspace: https://companyname.spiraservice.net/33/General.aspx
Accessing Workspaces in SpiraPlan Using the REST API
To access a workspace programmatically, use the Project ID (Workspace ID) in the REST API endpoint.
- General Endpoint Format: https://companyname.spiraservice.net /projects/{Project_id}
- Example for Workspace 33: https://companyname.spiraservice.net/projects/33
Performing CRUD Operations with Postman
Postman makes it easy to test SpiraPlan’s REST API by organizing your requests into collections and automating workflows. Let’s go step-by-step through each operation.
GET Request: Retrieving Data
The GET method retrieves data from SpiraPlan, such as project details or requirements.
Steps in Postman
- Open Postman and create a new request in your collection.
- Set the method to GET.
- Enter the following endpoint, replacing placeholders with actual values: https://companyname.spiraservice.net/services/v7_0/RestService.svc/{workspaceID}/{artifactID}
- Example: To retrieve requirements for Workspace 33, replace {workspaceID} with 33.
- Add the necessary headers:
username: {{username}}
api-key: {{api-key}}
Accept: application/json
- Click Send to execute the request and view the response.
POST Request: Creating New Data
The POST method sends new data to SpiraPlan, such as adding a new requirement.
Steps in Postman
- Create a new request and set the method to POST.
- Use the same endpoint format: https://companyname.spiraservice.net/services/v7_0/RestService.svc/{workspaceID}/{artifactID}
- Add the headers:
username: {{username}}
api-key: {{api-key}}
Accept: application/json
- In the Body tab, select raw and set the format to JSON. Add the payload:
{
"key": "value"
}
- Click Send to send new data to the server.
PUT Request: Update Existing Data
The PUT method updates an existing resource, such as modifying a requirement.
Steps in Postman
- Create a new request and set the method to PUT.
- Use the same endpoint: https://companyname.spiraservice.net/services/v7_0/RestService.svc/{workspaceID}/{artifactID}
- Add headers:
username: {{username}}
api-key: {{api-key}}
Accept: application/json
- In the Body tab, provide the updated data:
{
"key": "updatedValue"
}
- Click Send to apply the changes.
DELETE Request: Removing Data
The DELETE method removes a resource from SpiraPlan, such as deleting a requirement.
Steps in Postman
- Create a new request and set the method to Delete.
- Use the endpoint: https://companyname.spiraservice.net/services/v7_0/RestService.svc/{workspaceID}/{artifactID}
- Add headers:
username: {{username}}
api-key: {{api-key}}
Accept: application/json
- Click Send to remove the resource.
Why Use Postman with SpiraPlan?
By combining Postman’s user-friendly interface with SpiraPlan’s REST API, teams can:
- Automate Repetitive Tasks: Save time by organizing requests into collections and reusing variables.
- Validate API Functionality: Easily test endpoints for accuracy and reliability.
- Improve Collaboration: Share test collections and results with your team.
- Integrate with Broader Workflows: Align API testing efforts with development and project management in SpiraPlan.
Conclusion: Bridging UI Navigation and API Automation
API testing is essential for ensuring that your systems operate smoothly, securely, and efficiently. While SpiraPlan’s user interface offers an intuitive way to navigate workspaces and requirements, leveraging the REST API with Postman provides a powerful method for automating and streamlining your testing efforts.
To see these steps demonstrated in detail, watch the webinar recording "Utilizing SpiraPlan’s REST API", where we demo these concepts in greater detail with live examples and practical use cases.