Postman
Postman is a popular tool for exploring and testing APIs. The BookFlow OpenAPI spec imports cleanly into Postman and gives you a full request collection in 60 seconds.
Setup
- Open Postman. Click "Import" in the top left.
- Choose "Link" and paste the OpenAPI URL once it ships (currently
https://booking-api.netwit.ca/api/openapi.yamlis not yet served — see OpenAPI). Until then, import a manually-authored Postman collection or use curl examples from the per-audience reference pages. - Click "Continue" then "Import". Postman creates a collection with one request per endpoint.
- Open the collection. Click the variables tab.
- Set the
baseUrlvariable:https://booking-api.netwit.ca(orhttp://localhost:8787for dev). - Send a
POST /api/auth/loginrequest with your email + password. The response will include adata.token. - Copy that token into the
tokenvariable in Postman. - Now all the other requests in the collection will use it via Bearer auth.
Try a public endpoint (no auth)
GET /api/public/demo-salon-1785076211558918289 works without a token. Useful for getting started.
Try an owner endpoint (with token)
GET /api/businesses/me returns the current business. Make sure your token variable is set.
Save as a collection
Once you have the collection working, click "Save" and give it a name like "BookFlow (prod)". Share it with your team by clicking "Share" → "Get public link".
Environments
Postman lets you have multiple environments (prod, staging, dev). Create them in the left sidebar and set the variables for each.
Pre-request scripts
For endpoints that need a fresh token (e.g. after the 24h expiry), add a pre-request script at the folder level:
// Auto-refresh token if missing
if (!pm.environment.get("token")) {
pm.sendRequest({
url: pm.environment.get("baseUrl") + "/api/auth/login",
method: "POST",
header: { "content-type": "application/json" },
body: {
mode: "raw",
raw: JSON.stringify({
email: pm.environment.get("email"),
password: pm.environment.get("password"),
}),
},
}, (err, res) => {
pm.environment.set("token", res.json().data.token);
});
}Tests
Add a test to every request to assert the response. Example for GET /api/businesses/me:
pm.test("returns 200", () => pm.response.to.have.status(200));
pm.test("has a tenant id", () => {
const json = pm.response.json();
pm.expect(json.data.id).to.be.a("string");
});Email hello@netwit.ca or call +1-604-206-8169. NetWit responds in 1 business day.