This guide will help you make your first successful API call to Sabrhub in under 30 minutes.
- Your Sabrhub account username and password
- A tool to make API calls like curl, Postman, or your programming language
- 30 minutes of your time
Sabrhub has three main APIs:
Use this if you want to:
- Connect Webex with phone numbers
- Send messages through Webex
- Manage customer organizations
Use this if you want to:
- Connect Microsoft Teams with messaging
- Manage multiple customer accounts
- Route messages between systems
Use this if you want to:
- Register brands for SMS compliance
- Manage 10DLC campaigns
- Handle brand verification
First, login to get your access token. Replace the username and password with your real ones:
curl -X POST "https://usermanagement.sabrhub.com/v1/auth/login" \
-H "Content-Type: application/json" \
-d '{
"username": "your-email@company.com",
"password": "your-password"
}'You will get a response like this:
{
"username": "your-email@company.com",
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expirationTimeInUTC": "2024-02-29T15:09:14.242875589"
}Copy the accessToken value. You will need it for the next step.
Now use your access token to make an API call. Here are examples for each API:
curl -X GET "https://context-webex.sabrhub.com/api/v1/csp/enterprises/CSP001" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"curl -X GET "https://teams-dev-frontend.sabrhub.com/api/v2/csp" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"curl -X GET "https://contextregister.sabrhub.com/api/v1/api/brands?page=1&size=10" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"If your API call works, you will get data back in JSON format. If something goes wrong, you will get an error message.
{
"data": "your data here",
"status": "success"
}{
"error": "Invalid credentials",
"status": "error"
}Wrong way:
Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...Right way:
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...For testing, always use development URLs first:
- Development: https://usermanagement.sabrhub.com/v1
- Production: https://usermanagement.sabrhub.com/v1
Always include this header for POST requests:
Content-Type: application/jsonAfter you make your first successful API call:
- Read the detailed guides for your chosen API
- Try creating or updating data through the API
- Build error handling into your code
- Test with real data in the development environment
- Switch to production when ready
If you get stuck:
- Check your access token is not expired
- Verify you are using the correct API URL
- Make sure your JSON is properly formatted
- Contact support@sabrhub.com with your error message
Here is a complete example using the Webex API:
curl -X POST "https://usermanagement.sabrhub.com/v1/auth/login" \
-H "Content-Type: application/json" \
-d '{
"username": "test@email.com",
"password": "yourpassword"
}'curl -X POST "https://webex-dev-frontend.sabrhub.com/api/v1/enterprise/CSP001" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Test Company",
"contact": "John Smith",
"number": "+12223334444",
"email": "john@testcompany.com"
}'curl -X GET "https://webex-dev-frontend.sabrhub.com/api/v1/enterprise/getenterprise/E0000090" \
-H "Authorization: Bearer YOUR_TOKEN"Congratulations! You have successfully integrated with Sabrhub APIs.