Getting Started
Authentication
How to authenticate API requests with API keys
API Key Authentication
The Cambodia Postal Code API uses API keys for authentication. Keys are managed through the TosKey gateway.
Obtaining an API Key
- Sign in to your dashboard
- Navigate to API Keys
- Click Generate New Key
- Copy the key — it won't be shown again
Using Your API Key
Pass your API key in the x-api-key header:
curl -H "x-api-key: YOUR_API_KEY" \
https://api.cambodiapostalcode.com/v1/provinces?lang=enKey Management
- Regenerate — Creates a new key and invalidates the old one
- Revoke — Permanently disables the key
- Rate limits — Each key has its own rate limit quota
Security
- Never commit API keys to version control
- Use environment variables to store keys
- Rotate keys periodically
- Use separate keys for development and production