Java / Spring Boot Quickstart
Complete end-to-end guide to send multi-channel notifications from a Java or Spring Boot application — from API key generation to template creation, event triggering, and delivery verification.
1. Sign Up & Get API Key
Register at https://app.hubnest.io. Go to Developer → API Keys → Generate New Key. Copy rawKey (hn_live_...) — shown only once. Add to application.properties: hubnest.api-key=hn_live_xxxxx
2. Create a Subscriber
Create a subscriber to represent a user. Each subscriber maps your user's email and phone to a subscriberId for targeted delivery.
3. Create a Notification Template
Create templates at Developer → Templates → New Template. Or use the REST API — type is the identifier referenced in Workflows, id (UUID) is used in direct sends.
4. Connect a Channel Provider
Go to Developer → Channels → Add Provider at https://app.hubnest.io. Use Demo Email for instant testing, or connect AWS SES, SendGrid, Twilio, MSG91, WhatsApp, FCM, or APNs for production.
5. Add Spring Boot Dependencies
Add RestTemplate or WebClient to your Spring Boot project. RestTemplate is available in spring-boot-starter-web:
6. Create HubNestService.java
Create a Spring service that wraps all HubNest API calls:
7. Direct Send & Bulk Send
Use the direct send API to bypass Rules/Workflows, or the campaign API to fan out to many recipients via Kafka background queue:
8. Verify Delivery in Logs
After calling triggerEvent() or sendDirect(), go to Developer → Logs at https://app.hubnest.io to see delivery status, provider used, latency, and wallet cost per notification. Configure Webhooks at Developer → Webhooks for real-time delivery callbacks.
Next steps
Configure AWS SES IAM keys, verified domains, and sending rate limits.
Connect SendGrid API Keys and verified sender identities.
Connect Twilio Account SID, Auth Token, and phone numbers.
Connect Meta WhatsApp Cloud API access tokens and phone number IDs.