API clients
Call the BPMS.ai API from Postman, Swagger UI, or another client, generated from the contract.
Every client works from the same OpenAPI contract the platform publishes, so it always matches the API of the server you call. Every request and answer in the contract has an example.
Swagger UI
The quickest way: open <server>/swagger-ui.html in a browser, for example http://127.0.0.1:8080/swagger-ui.html after the Quick start. Sign in with POST /api/v1/auth/login, then choose Authorize and paste the token.
Postman
Postman imports the API directly from the installation you call, so the collection always matches that server.
-
Create an environment. Create an environment named BPMS with the variables in the table below and select it. Set
baseUrlto your server, without a trailing slash, andusername; putpasswordonly in the current value. -
Import the API. Choose Import, then Link, and enter the address of the contract the installation serves,
<baseUrl>/v3/api-docs, for examplehttps://bpms.bpms.work/v3/api-docs. Import it as a Postman collection. -
Authenticate the collection. In the collection, open Authorization, choose Bearer Token, and enter
{{token}}. Check that the requests start with{{baseUrl}}. -
Sign in. Open
POST /api/v1/auth/login, set the body to{"username": "{{username}}", "password": "{{password}}"}, and add this post-response script, which stores the token:pm.environment.set("token", pm.response.json().token); -
Call the API. Send
GET /api/v1/access/roles. A session lasts 9 hours by default; sign in again when calls start answering401.
When the installation is updated, delete the collection and import it again from the same link: the environment keeps the URL, the credentials, and the token.
| Variable | Value |
|---|---|
baseUrl | The address of your server, for example http://127.0.0.1:8080. |
username | The user to sign in with. |
password | That user's password. Secret: current value only. |
token | The session token, set by the sign-in script. Secret: current value only. |
Clients without an account
| Client | How |
|---|---|
| Bruno | Import <baseUrl>/v3/api-docs as an OpenAPI collection. Bruno keeps collections as local files. |
| Insomnia | Use its local Scratch Pad and import <baseUrl>/v3/api-docs. |
curl | Follow Authentication. |
Keep credentials out
- Never put a real password or token in a request, a collection variable, or the initial value of an environment variable; use
{{password}}and{{token}}. Signed in, Postman syncs collections to its own cloud. - Never share an exported collection or environment that holds real values.
- If a token leaks, sign out with it,
POST /api/v1/auth/logout: the session closes and the token stops working.