API Specification
API Key
Manage and use your API key to access Enjoy Holiday Hub APIs
What is an API Key?
An API Key is a unique identifier used to authenticate requests made to the Enjoy Holiday Hub API.
Each agent account is assigned a unique API key that must be included in every API request.
API Key Authentication
Authenticate requests via HTTP Header or Request ParameterEnjoy Holiday Hub APIs authenticate requests using your unique secret API Key. You can provide your key in either of the following standard formats:
Method 1: Header (Recommended)
Send key in standard HTTP header:
X-API-Key: demo_123456789
Method 2: Body / Query
Send key in JSON payload or query param:
"api_key": "demo_123456789"
Demo Sandbox Key:
Get your production key in Agent Portal
demo_123456789
Where to Get Your API Key
- Login to your Agent Dashboard
- Go to Profile / Settings
- Copy your API Key
How to Use API Key
| Method | How to Pass |
|---|---|
GET | ?api_key=YOUR_API_KEY |
POST | Include in JSON body |
GET Example
GET
/api/b2b/visa/search.php
JSON Response
{
"url": "https://enjoyholidayhub.com/api/b2b/visa/search.php?api_key=YOUR_API_KEY"
}
POST Example
POST
/api/b2b/visa/apply.php
JSON Response
{
"api_key": "YOUR_API_KEY",
"visa_type_id": 1,
"travel_date": "2026-05-10"
}
cURL Example
curl -X POST "https://enjoyholidayhub.com/api/b2b/visa/apply.php" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "X-API-Key: demo_123456789" \
-d '{
"visa_type_id": 1,
"travel_date": "2026-05-10",
"api_key": "demo_123456789"
}'
Response (Success)
SUCCESS
Valid API Key
JSON Response
{
"status": true,
"message": "Valid API Key",
"data": {
"user_id": 101,
"role": "agent",
"status": "active"
}
}
Response (Error)
ERROR / NOTICE
Invalid or inactive API key
JSON Response
{
"status": false,
"message": "Invalid or inactive API key"
}
Security Best Practices
- 🔐 Never expose your API key in frontend code
- 🔒 Always store API keys securely on server
- 🚫 Do not share your API key with others
- 🔄 Regenerate API key if compromised
Rate Limiting
To ensure fair usage, API requests may be limited per minute/hour.
| Limit Type | Value |
|---|---|
Requests per minute | 100 |
Requests per hour | 5000 |
Important Notes
- ⚠️ Missing API key → request will fail
- ❌ Invalid key → access denied
- 📊 All API usage is logged for monitoring