Prerequisites
Before sending requests, ensure you have:- Completed the Workspace Setup
- An active Postman environment with an API key configured
- The SCANOSS API collection imported into Postman
Understanding Request Structure
All SCANOSS API requests follow a consistent structure.Request Components
- Method: HTTP verb (GET, POST, etc.)
- URL: Base URL + endpoint path + query parameters
- Headers: Authentication and content type
- Body: Request payload (for POST requests)
Example Request Structure
Vulnerability API Requests
Get Component CPEs
Retrieve Common Platform Enumeration (CPE) identifiers for a component. Create the Request:- In the Vulnerability API folder, add a new request.
- Name it “Get Component CPEs”.
-
Configure:
- Method: GET
- URL:
{{base_url}}{{vulnerability_path}}/cpes/component - Query Params:
purl:pkg:github/scanoss/enginerequirement:>=5.0.0
- Click Send.
Get Component Vulnerabilities
Retrieve known vulnerabilities for a component. Create the Request:- Add a new request: “Get Component Vulnerabilities”.
-
Configure:
- Method: GET
- URL:
{{base_url}}{{vulnerability_path}}/component - Query Params:
purl:pkg:npm/express@4.17.1requirement:>=4.17.0
- Click Send.
Get Component Vulnerabilities (Batch)
Query multiple components in a single request. Create the Request:- Add a new request: “Get Component Vulnerabilities (Batch)”.
- Configure:
- Method: POST
- URL:
{{base_url}}{{vulnerability_path}}/components - Headers: Ensure
Content-Type: application/jsonis set. - Body (raw JSON):
- Click Send.
Cryptography API Requests
Get Component Algorithms
Retrieve cryptographic algorithms used by a component. Create the Request:- In the Cryptography API folder, add a new request: “Get Component Algorithms”.
-
Configure:
- Method: GET
- URL:
{{base_url}}{{cryptography_path}}/algorithms/component - Query Params:
purl:pkg:github/scanoss/enginerequirement:>=5.0.0
- Click Send.
Get Algorithms in Version Range
Retrieve cryptographic algorithms across a range of component versions. Create the Request:- Add a new request: “Get Component Algorithms in Range”.
-
Configure:
- Method: GET
- URL:
{{base_url}}{{cryptography_path}}/algorithms/range/component - Query Params:
purl:pkg:github/scanoss/enginerequirement:>=1.0.0
- Click Send.
Get Cryptographic Hints
Retrieve cryptographic libraries and protocols identified within a component. Create the Request:- Add a new request: “Get Component Hints”.
-
Configure:
- Method: GET
- URL:
{{base_url}}{{cryptography_path}}/hints/component - Query Params:
purl:pkg:github/scanoss/enginerequirement:>=5.0.0
- Click Send.
Component Search Requests
Search Components
Find components by name or attributes. Create the Request:- In the Component Search folder, add a new request: “Search Components”.
-
Configure:
- Method: GET
- URL:
{{base_url}}{{components_path}}/search - Query Params:
query:expresstype:npmlimit:10
- Click Send.
Get Component Details
Retrieve detailed information about a specific component. Create the Request:- Add a new request: “Get Component Details”.
-
Configure:
- Method: GET
- URL:
{{base_url}}{{components_path}}/details - Query Params:
purl:pkg:npm/express@4.18.2
- Click Send.
Reviewing Responses
Response Tabs
Postman provides several tabs for analysing responses.Body Tab
Displays the response content in various formats:- Pretty: Formatted JSON with syntax highlighting
- Raw: Unformatted response text
- Preview: HTML rendering (for HTML responses)
Cookies Tab
Shows cookies set by the server, if any.Headers Tab
Displays response headers:Content-Type: Response formatX-RateLimit-Limit: Total requests permitted per hourX-RateLimit-Remaining: Requests remaining in the current windowX-RateLimit-Reset: Time at which the rate limit resets
Test Results Tab
Shows the results of test scripts. See the Testing section for details.Response Status Codes
| Code | Meaning | Description |
|---|---|---|
| 200 | OK | Request successful |
| 400 | Bad Request | Invalid request format |
| 401 | Unauthorised | Invalid or missing API key |
| 404 | Not Found | Endpoint not found |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Server-side error |
Analysing Response Data
Using Pretty Print
- Ensure Pretty is selected in the Body tab.
- JSON is automatically formatted and syntax-highlighted.
- Click the collapse/expand icons to navigate nested structures.
Searching Response Data
- Press
Ctrl+F(Windows/Linux) orCmd+F(macOS). - Enter a search term.
- Navigate results using the up/down arrows.
Copying Response Data
- Copy entire response: Click the copy icon in the top-right corner.
- Copy a specific value: Click the value to copy it to the clipboard.
Using Variables in Requests
Dynamic Query Parameters
Use Postman environment variables to make query parameters reusable: Query Params:purl:{{component_purl}}requirement:{{version_requirement}}
component_purl:pkg:npm/express@4.18.2version_requirement:>=4.0.0
Path Variables
For dynamic URL segments: URL:{{base_url}}/v2/vulnerabilities/component/:component_id
Path Variables tab:
component_id:express-4.18.2
Note: Ensure the path variable name in the URL (:component_id) matches the key defined in the Path Variables tab exactly, as the match is case-sensitive.
Adding Tests to Requests
Validate responses automatically using Postman test scripts.Basic Test Examples
Open the Tests tab for the relevant request and add the following scripts as required.Test 1: Verify Status Code
Test 2: Verify Response Time
Test 3: Verify Response Structure
Test 4: Verify Component Data
Test 5: Extract and Save Data
Running Tests
- Add test scripts to the Tests tab.
- Click Send.
- View results in the Test Results tab.
- Green checkmarks indicate passing tests; red crosses indicate failures.
Saving Requests as Examples
Save responses for documentation and future reference:- After receiving a response, click Save Response.
- Choose Save as example.
- Provide a descriptive name (e.g.,
"Successful Response — Express 4.18.2"). - The saved example will appear in the right-hand sidebar.
- Use saved examples for documentation and to compare against future responses.
Creating Multiple Examples
Save responses for different scenarios to provide comprehensive coverage:- Success: A normal, successful response
- Not Found: Component not found error
- Invalid PURL: Malformed PURL error
- No Vulnerabilities: Component with no associated vulnerabilities
Using Pre-request Scripts
Automate tasks that must run before a request is sent.Example: Generate Timestamp
Example: Construct PURL Dynamically
Collection Runner
Run multiple requests sequentially to test complete API workflows.Running a Collection
- Click the Collection Runner button (top right) or press
Ctrl+Alt+R. - Select your collection or folder.
- Choose the target environment.
- Click Run SCANOSS API.
- Review the results, which show the outcome of each request in sequence.
Use Cases
- End-to-end workflow testing: Validate the full API workflow in a single run.
- Regression testing: Confirm that existing endpoints continue to behave as expected.
- Performance testing: Measure and compare response times across endpoints.
- Multi-endpoint data retrieval: Retrieve data from multiple endpoints in a single automated run.
Debugging Requests
Postman Console
Use the Postman Console to inspect the full details of a request and its response:- Click the Console icon (bottom left) or press
Ctrl+Alt+C. - The Console displays:
- Complete request headers
- Request body
- Response headers
- Response body
- Log output from pre-request and test scripts
Common Issues and Solutions
”Could not send request” Error
Cause: Network or proxy configuration issue. Solution:- Verify your internet connection.
- Disable any active VPN.
- Review proxy settings: File → Settings → Proxy.
Variables Not Resolving
Cause: No environment selected, or the variable is not defined in the active environment. Solution:- Ensure an environment is selected from the top-right dropdown.
- Confirm the variable exists in the active environment.
- Verify the variable name matches exactly — names are case-sensitive.
401 Unauthorised
Cause: Invalid or missing API key. Solution:- Verify the API key value in the active environment.
- Confirm the
X-Api-Keyheader is present and being sent with the request. - Check that the authorisation header is configured correctly at the request or collection level.
Best Practices
- Use environment variables: Never hardcode API keys in request configurations.
- Add tests: Validate all responses automatically using test scripts.
- Save examples: Document successful and error response scenarios.
- Organise requests: Use folders and consistent naming conventions.
- Add descriptions: Document the purpose and expected behaviour of each request.
- Use pre-request scripts: Automate repetitive setup tasks.
- Monitor performance: Track response times using test assertions.
- Version control: Export and back up collections regularly.
Next Steps
Now that you can send requests and review results:- Complete the collection: Add all SCANOSS API endpoints.
- Write comprehensive tests: Cover both success and error response scenarios.
- Automate multi-request workflows: Use the Collection Runner to run sequences of requests.
- Generate documentation: Use Postman’s built-in documentation export.
- Export and share collections: Share collections with your team for consistent API testing.