Make Your First Request
This guide walks you through a simple API call to fetch your company information. It takes 5 minutes.
Prerequisites
- A yAppointment account (sign up at https://admin.yappointment.com)
- An API key or OAuth token (from Admin Settings > Integrations > API Keys)
- curl, Node.js, Python, or similar HTTP client
The Request
Call the /api/v1/me endpoint to fetch your company profile.
curl -H "Authorization: Bearer yapp_sk_live_YOUR_KEY" \
https://api.yappointment.com/api/v1/meThe Response
All yAppointment API responses use a consistent envelope format:
{
"status": true,
"data": {
"_id": "507f1f77bcf86cd799439011",
"name": "Acme Salon",
"email": "contact@acmesalon.com",
"phone": "+1234567890",
"address": "123 Main St, New York, NY 10001",
"timezone": "America/New_York",
"currency": "USD",
"createdAt": "2024-01-15T10:30:00Z"
},
"meta": {
"timestamp": 1702650000000,
"version": "v1"
}
}
Response Fields
status— Boolean.trueif successful,falseif errordata— Response payload (varies by endpoint)meta— Metadata (timestamp, API version, pagination info)
Error Handling
If a request fails, the response includes an error code:
{
"status": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid API key"
},
"meta": {
"timestamp": 1702650000000
}
}
Common Status Codes
| Code | Meaning | |------|---------| | 200 | Success | | 400 | Bad Request (missing or invalid parameters) | | 401 | Unauthorized (missing or invalid token) | | 403 | Forbidden (token lacks required scope) | | 404 | Not Found (resource doesn't exist) | | 429 | Too Many Requests (rate limited) | | 500 | Server Error (try again later) |
Next Steps
Now that you've made your first request, explore:
- Sandbox Mode — Test against isolated data
- API Reference — Browse all available endpoints
- Webhooks — Receive real-time booking events
Troubleshooting
Invalid API key error?
- Make sure you copied the full key including the
yapp_sk_live_prefix - Check that the key hasn't been revoked in Admin Settings
CORS error (browser request)?
- Never make API calls directly from browser code
- Use a backend proxy instead
- OAuth tokens should be kept server-side
Rate limit exceeded?
- API requests are limited to 100 per second per key
- Implement exponential backoff retry logic