This guide covers the practical implementation of the Axero REST API, including Bearer token authentication, performance optimization, and security best practices. Whether you're migrating from legacy API keys or building new integrations, this documentation provides the essential knowledge for successful API implementation.
The Axero REST API uses Bearer tokens for secure authentication. These cryptographically signed tokens offer enhanced security compared to traditional API keys and adhere to industry standards.
After you create your Bearer token, include it in the Authorization header of all API requests:
Authorization
π Request Format
GET /api/users/me Host: yoursite.axero.com Authorization: Bearer YOUR_BEARER_TOKEN_HERE Content-Type: application/json
The primary change involves updating the authorization header format in all your API requests:
β Legacy Format
rest-api-key: YOUR_LEGACY_KEY_HERE
β New Bearer Token Format
Authorization: Bearer YOUR_BEARER_TOKEN_HERE
Here are practical examples showing how to implement Bearer token authentication in different programming languages and tools:
π cURL Example:
curl -X GET "https://yoursite.axero.com/api/users/me" \ -H "Authorization: Bearer YOUR_BEARER_TOKEN_HERE" \ -H "Content-Type: application/json"
π¨ JavaScript Example:
fetch('https://yoursite.axero.com/api/users/me', { method: 'GET', headers: { 'Authorization': 'Bearer YOUR_BEARER_TOKEN_HERE', 'Content-Type': 'application/json' } }) .then(response => { if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } return response.json(); }) .then(data => console.log(data)) .catch(error => console.error('API Error:', error));
π Python Example:
import requests headers = { 'Authorization': 'Bearer YOUR_BEARER_TOKEN_HERE', 'Content-Type': 'application/json' } try: response = requests.get('https://yoursite.axero.com/api/users/me', headers=headers) response.raise_for_status() # Raises an HTTPError for bad responses data = response.json() print(data) except requests.exceptions.RequestException as e: print(f"API Error: {e}")
When building widgets or content pages for your Axero site:
Security Risk: API keys and bearer tokens embedded in client-side code are discoverable by end users and create significant security vulnerabilities. Anyone can view page source, inspect network requests, or use browser developer tools to extract these credentials.
For widgets, content pages, and client-side JavaScript within your Axero site:
Example: API calls from JavaScript widgets automatically inherit the logged-in user's permissions without requiring explicit authentication.
For server-to-server integrations, external applications, and third-party systems:
Authorization: Bearer {token}
Example: External applications connecting to your Axero API must authenticate with Bearer tokens to access data on behalf of specific users.
Axero does not enforce hard rate limits on the REST API by default. However, to ensure consistent performance, reliability, and a seamless experience for all users, we recommend adhering to the best practices outlined below. These guidelines are intended to support high-performance, scalable integrations while preserving the responsiveness of your Axero environment. Please note that Axero may implement temporary rate restrictions if excessive API usage affects overall site performance.
200
401
403
429
500
The Axero REST API is organized into several categories, each providing specific functionality for different aspects of your community platform. Each category includes comprehensive endpoints for creating, reading, updating, and managing data:
Comprehensive user management capabilities for creating, updating, and managing user accounts and roles.
Powerful content management tools for creating, retrieving, and managing all types of content within your community.
Complete space management functionality for organizing your community into departments, teams, or project areas.
Real-time messaging capabilities for integrating chat functionality with external systems and workflows.
Engagement tools for managing comments and discussions across all content types in your community.
Security and access control tools for managing user permissions and role-based access throughout your community.
Employee recognition and gamification tools for building engagement and celebrating achievements.
Comprehensive analytics and reporting capabilities for understanding community engagement and content performance.
If you need assistance, open a support case and include the following information:
GET /api/users/me
is requesting access to a wiki that you have locked: https://my.axerosolutions.com/spaces/5/axero-documentation/wiki/view/108975/using-the-rest-api
Your session has expired. You are being logged out.