Getting Started with the API
Welcome to the Hubble API! This guide will walk you through the steps to make your first successful API call.
1. Obtain Your Credentials
Before you can use the API, you need two key pieces of information:
clientId
andclientSecret
: These are your unique API keys.- IP Whitelisting: For security, we only allow requests from pre-approved IP addresses.
To get your credentials and have your IP address whitelisted, please contact our support team at support@hubble.in with your company details and the server IP address you’ll be making requests from.
2. Understand the Base URLs
We provide two environments for our API:
- Staging:
https://api.dev.myhubble.money
(For testing and development) - Production:
https://api.myhubble.money
(For live applications)
3. Make Your First API Call: Get an Access Token
Once you have your credentials, you can get a temporary access_token
by calling our Login API. This token is used to authenticate all other API requests.
Here is an example using curl
. Replace 'YOUR_CLIENT_ID'
and 'YOUR_CLIENT_SECRET'
with the credentials you received.
curl -X POST \ https://api.dev.myhubble.money/v1/partners/auth/login \ -H 'Content-Type: application/json' \ -d '{ "clientId": "YOUR_CLIENT_ID", "clientSecret": "YOUR_CLIENT_SECRET" }'
Successful Response
A successful request will return a JSON object containing your access token and its validity period in seconds:
{ "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "expiresInSecs": 3600}
4. Using Your Access Token
Now that you have an access token, you must include it in the Authorization
header for all subsequent API calls.
You must also include a unique request ID in the X-REQUEST-ID
header. This helps us track requests and troubleshoot any issues. We recommend using a UUID for this.
Here’s an example of how to fetch a list of available brands:
curl -X GET \ https://api.dev.myhubble.money/v1/partners/brands \ -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ -H 'X-REQUEST-ID: a-unique-uuid-here'
Next Steps
Congratulations! You’ve successfully made your first API call.
Now you can explore the other sections of our API documentation to learn about managing brands, placing orders, and more.