API Testing & Integration
Primus SaaS Platform provides two primary ways to test APIs "then and there":
- Swagger UI (OpenAPI): For quick, individual endpoint testing.
- Postman Collection: For complex integration scenarios (e.g., Auth -> API).
1. Swagger UI (Quick Test)
The Swagger Playground is built directly into the application. It allows you to explore endpoints and execute requests directly from your browser.
- Local URL: http://localhost:5265/swagger
- Production URL: (Your Domain)
/swagger
How to use
- Open the URL above.
- Click Authorize (top right) to enter your Bearer token if testing protected endpoints.
- Expand an endpoint (e.g.,
GET /api/logs) and click Try it out.
2. Postman Collection (Scenarios)
For real-world integration testing, we provide a pre-configured Postman Collection. This handles authentication flows automatically.
Setup
- Located in your repository at:
sdk/POSTMAN_COLLECTION.json. - Import this file into Postman (File > Import).
Features
- Automatic Auth: The "Login" request automatically saves the token to a variable (
{{local_token}}). - Health Checks: Verify system status immediately.
- Environment Support: Switch easily between Local and Azure AD environments.
Example Workflow
- Run Local Auth > Login (Get Token).
- Result: Token is saved automatically.
- Run Debug > Health Check.
- Result: 200 OK.
- Run any other protected endpoint (it will use the saved token).