Getting Started
Base URL
All API requests to Marquatica should use the following base URL:
Authentication Methods
The Marquatica API uses two different authentication methods depending on which API you're using. Choose the appropriate method based on the API you're calling.
Method 1: X-API-Token (Legacy APIs)
The Dealer Locator API and Lead Submission API use token-based authentication via the X-API-Token header.
Getting Your Token
Your API token is provided by your Marquatica account administrator. Keep this token secure and never expose it publicly.
Example Request
curl -H "X-API-Token: your_api_token_here" \
"https://api.marquatica.com/dealer-locator?brand=your_brand&postal_code=90210&country=US"
your_api_token_here with your actual API token and your_brand with your brand slug, both provided by your administrator.
Method 2: JWT Bearer Token (Warranty API v1)
The Warranty API (v1) uses JWT Bearer token authentication. This requires a three-step process: login, use the token, and refresh when needed.
Step 1: Login to Get Tokens
First, authenticate with your email and password to receive access and refresh tokens:
curl -X POST https://api.marquatica.com/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]", "password": "yourpassword"}'
The response will contain:
| Field | Description |
|---|---|
access_token |
JWT token for API requests (expires in 1 hour) |
refresh_token |
Token used to obtain a new access token (expires in 30 days) |
Step 2: Use the Access Token
Include the access token in the Authorization header for API requests:
curl -H "Authorization: Bearer <Token>" \
"https://api.marquatica.com/api/v1/warranty"
Step 3: Refresh Your Token
When your access token expires (after 1 hour), use the refresh token to obtain a new one:
curl -X POST https://api.marquatica.com/api/v1/auth/refresh \
-H "Content-Type: application/json" \
-d '{"refresh_token": "<Token>"}'
| Token Type | Expiration |
|---|---|
| Access Token | 1 hour |
| Refresh Token | 30 days |
Your First API Call
Let's walk through a complete example using the Dealer Locator API to find nearby dealers.
The Request
Find dealers near postal code 90210 in the United States for your brand:
curl -H "X-API-Token: your_api_token_here" \
"https://api.marquatica.com/dealer-locator?brand=your_brand&postal_code=90210&country=US"
Expected Response
{
"dealers": [
{
"id": 101,
"dealer_code": "1001-1",
"group_id": 1001,
"unit_id": 1,
"name": "Lakeside Marine Group",
"address": "123 Marina Drive",
"city": "Lakeside",
"state": "CA",
"postal_code": "90210",
"country": "US",
"phone": "(555) 123-4567",
"email": "[email protected]",
"website": "https://www.lakesidemarine.com",
"distance_miles": 3.2,
"match_type": "territory",
"territory_match": true
}
],
"success": true,
"version": "0.2.2"
}
Response trimmed for readability; see Dealer Locator for every field.
Understanding the Response
| Field | Description |
|---|---|
success |
Boolean indicating whether the request was successful |
dealers |
Array of dealer locations. The first entry is the dealer to show; others follow by distance |
dealers[].id |
Unique identifier for the dealer location in the Marquatica system |
dealers[].match_type |
Why the dealer was returned: territory, distance, nearest, group_sibling or fallback |
dealers[].distance_miles |
Distance from the requested postal code to the dealer's location |
What's Next?
Now that you've made your first API call, explore the complete documentation for each API:
- Dealer Locator API - Find dealers by location and brand
- Lead Submission API - Submit new leads for processing
- Warranty API - Manage warranty information
- Errors, Codes & Rate Limits - Error handling and rate limiting information