Skip to main content

API Testing & Integration

Primus SaaS Platform provides two primary ways to test APIs "then and there":

  1. Swagger UI (OpenAPI): For quick, individual endpoint testing.
  2. 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.

How to use

  1. Open the URL above.
  2. Click Authorize (top right) to enter your Bearer token if testing protected endpoints.
  3. 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

  1. Located in your repository at: sdk/POSTMAN_COLLECTION.json.
  2. 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

  1. Run Local Auth > Login (Get Token).
    • Result: Token is saved automatically.
  2. Run Debug > Health Check.
    • Result: 200 OK.
  3. Run any other protected endpoint (it will use the saved token).