Getting Started
Bruno Setup
Configure Bruno API client for Journey API testing
Bruno is the recommended API client for testing Journey API endpoints.
Installation
brew install brunoRepository Setup
# Clone the Journey API repository
git clone https://github.com/Journey-Rewards/api.git
cd api
# Open Bruno with the collection
bruno open bruno/Collection Structure
bruno/
├── Members (Surface)/
│ ├── Auth/
│ ├── Me/
│ ├── Properties/
│ └── Reservations/
├── Admin/
│ ├── Auth/
│ ├── Members/
│ └── Reservations/
├── Public (Surface)/
│ ├── Properties/
│ └── Reservations/
└── environments/
├── local.bru
├── development.bru
└── production.bruEnvironment Configuration
1. Select Environment
Choose the appropriate environment in Bruno:
- Local:
http://localhost:3000 - Development:
https://api-dev.cf.journey.com/v1 - Production:
https://api-prd.cf.journey.com/v1
2. Get a Members Token (Dev)
The Members API authenticates via Clerk. To get a token in the development environment:
- Open the Members (Surface) → Auth → Login request in Bruno
- Enter a test phone number — use any 555 area code number ending in
01xx, e.g.+15550010100 - Clerk will send an OTP to the number (test numbers are handled automatically in dev)
- Complete the OTP step — Bruno will store the resulting Clerk JWT in
CLERK_TOKEN
555 numbers ending in 01xx (+1555XXX0100 through +1555XXX0199) are Clerk test numbers. No real SMS is sent — the OTP completes automatically in the dev Clerk environment.
3. Set Admin Token (WorkOS)
// In environment variables
WORKOS_TOKEN = "your-workos-jwt-token"Example Requests
Members Profile Request
File: bruno/Members (Surface)/Me/Profile/Get Me.bru
GET {{BASE_URL}}/members/me
Authorization: Bearer {{CLERK_TOKEN}}Admin Member Query
File: bruno/Admin/Members/Query Members.bru
POST {{BASE_URL}}/admin/members/query
Authorization: Bearer {{WORKOS_TOKEN}}
Content-Type: application/json
{
"limit": 10,
"offset": 0,
"filters": {
"status": "active"
}
}Public Property Request
File: bruno/Public (Surface)/Properties/Get Property.bru
GET {{BASE_URL}}/public/properties/{{PROPERTY_ID}}Testing Workflows
1. Member Onboarding Flow
- Run
Members (Surface)/Auth/Validate.bru - Run
Members (Surface)/Me/Update Me.bru - Run
Members (Surface)/Me/Profile/Update Profile.bru
2. Property Search Flow
- Run
Members (Surface)/Properties/Search.bru - Run
Members (Surface)/Properties/Get Property.bru - Run
Members (Surface)/Properties/Availability.bru
3. Admin Operations
- Run
Admin/Auth/WorkOS Callback.bru - Run
Admin/Members/Query.bru - Run
Admin/Members/Gift Points.bru
Assertions and Tests
Bruno supports JavaScript-based assertions:
// In Tests tab
test("Status is 200", () => {
expect(res.status).to.equal(200);
});
test("Member has external ID", () => {
expect(res.body.member.externalId).to.exist;
});
test("Response time under 500ms", () => {
expect(res.responseTime).to.be.below(500);
});Tips
- Use environment variables for sensitive data
- Save responses to variables for chaining requests
- Create folders for organizing test scenarios
- Use pre-request scripts for dynamic data
- Export/import collections for team sharing
Troubleshooting
| Issue | Solution |
|---|---|
| 401 Unauthorized | Check token in environment variables |
| 404 Not Found | Verify endpoint URL and parameters |
| Connection refused | Ensure API server is running |
| CORS errors | Use Bruno instead of browser |