Skip to main content

Authentication

All API requests require authentication using an access token. You can obtain an access token by registering as a developer or through the authentication endpoints.
curl -X GET "https://api.zochil.io/user/profile" \
  -H "access-token: your_access_token_here" \
  -H "device-id: your_device_id_here"

Make Your First Request

Let’s start by fetching your user profile:
curl -X GET "https://api.zochil.io/user/profile" \
  -H "access-token: YOUR_ACCESS_TOKEN" \
  -H "device-id: YOUR_DEVICE_ID" \
  -H "Content-Type: application/json"

Response Format

All API responses follow a consistent structure:
{
  "success": true,
  "data": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "email": "[email protected]",
    "name": "John Doe",
    "created_at": "2023-01-01T00:00:00Z"
  },
  "message": "Profile retrieved successfully"
}

Error Handling

When something goes wrong, you’ll receive an error response:
{
  "success": false,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Invalid access token"
  }
}

Next Steps