Making Your First API Call with cURL
Prerequisites
Prerequisites
You will need cURL installed (curl --version to check) and an API key from the Developer Portal.
Step 1 — Set Your Environment Variables
Store credentials as shell variables so you don't paste them repeatedly:
export AELIX_API_KEY="your-api-key-here"
export AELIX_BASE_URL="https://api.aelix.digitalapi.ai"
Step 2 — Make a GET Request
Let's call the ATM Locator API to find ATMs near a postcode:
curl -s \
-H "Authorization: Bearer $AELIX_API_KEY" \
-H "Accept: application/json" \
"$AELIX_BASE_URL/v1/atm-locator?postcode=EC2V7AN&radius=500"
A successful response returns a JSON array of ATM locations:
{
"data": [
{
"atm_id": "ATM-001-UK",
"address": "1 Cheapside, London EC2V 7AN",
"latitude": 51.5145,
"longitude": -0.0928,
"accessibility": ["wheelchair", "braille_keypad"],
"currency_available": ["GBP"]
}
],
"total": 3
}
Step 3 — Make a POST Request
To create a resource, use POST with a JSON body:
curl -s -X POST \
-H "Authorization: Bearer $AELIX_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"account_type": "current",
"currency": "GBP",
"nickname": "Main Operating Account"
}' \
"$AELIX_BASE_URL/v1/accounts"
Tips
- Add -i to include response headers in the output
- Use | jq . to pretty-print JSON responses
- Use -v for full request/response debugging