Your first API call
Let's start by making a simple API call to verify your connection and credentials. We'll retrieve your available sites, which is the easiest way to test the API.
Step 1: Get your access token
First, request an OAuth 2.0 access token using your API credentials. Replace YOUR_PUBLIC_KEY, YOUR_PRIVATE_KEY, and YOUR_DOMAIN_URL with your actual values:
Bash
Sample response:
JSON
Step 2: Make your first API call
Now use the access token to fetch your sites:
Bash
Sample response:
JSON
Success!
If you received a response similar to the above, congratulations! You've successfully connected to the Mambo API. The response shows your available sites - you'll use the url field (like "acmeinc") in subsequent API calls.
Common errors
- 401 Unauthorized: Your access token has expired or is invalid. Request a new token and retry.
- 403 Forbidden: Your API keys don't have permission for this endpoint. Verify your keys in the administration panel.
- Invalid credentials: Double-check that your public and private keys are correctly entered in the Basic Authentication header.
Next steps
Now that you're connected, let's create your first user and track their activities!