API Endpoints Reference
Complete reference documentation for all IriSync API endpoints
Overview
The IriSync API is organized around REST principles. All API endpoints accept form-encoded request bodies, return JSON-encoded responses, and use standard HTTP response codes, authentication, and verbs.
Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.
User Endpoints
Manage users, profiles, and authentication
Available Endpoints
Example Requests
Get User by ID
// Get a user by ID
fetch('https://api.irisync.com/api/users/123', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));List Users
// List all users with pagination
fetch('https://api.irisync.com/api/users?page=1&limit=25', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));Content Endpoints
Manage content, posts, and media
Available Endpoints
- GETDetails
/api/content/postsList all posts
- GETDetails
/api/content/posts/{id}Get a specific post
- POSTDetails
/api/content/postsCreate a new post
- PUTDetails
/api/content/posts/{id}Update a post
- DELETEDetails
/api/content/posts/{id}Delete a post
- GETDetails
/api/content/mediaList all media
- POSTDetails
/api/content/mediaUpload media
Example Requests
Get Content by ID
// Get content by ID
fetch('https://api.irisync.com/api/content/posts/456', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));Create Content
// Create new content
fetch('https://api.irisync.com/api/content/posts', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
title: 'New Post Title',
content: 'This is the content of the post',
status: 'draft',
tags: ['news', 'announcement']
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));Analytics Endpoints
Retrieve analytics and reporting data
Available Endpoints
Example Requests
Get Analytics Statistics
// Get analytics statistics
fetch('https://api.irisync.com/api/analytics/stats?from=2023-01-01&to=2023-01-31', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));Response Format
All API responses are returned in JSON format. Successful responses typically include:
{
"success": true,
"data": { ... }, // The requested resource or result
"meta": {
"pagination": { // Only included for list endpoints
"total": 100,
"count": 25,
"perPage": 25,
"currentPage": 1,
"totalPages": 4
}
}
}Error responses include:
{
"success": false,
"error": {
"code": "resource_not_found",
"message": "The requested resource was not found",
"status": 404,
"details": { ... } // Additional context, if available
}
}Pagination
List endpoints support pagination through the following query parameters:
pagePage number (starting from 1)
limitNumber of items per page (default: 25, max: 100)
Example request with pagination:
GET /api/content/posts?page=2&limit=50
Rate Limiting
The IriSync API implements rate limiting to ensure fair usage and API stability. Rate limits are based on:
- Authentication method
OAuth tokens have higher limits than API keys
- Subscription tier
Higher tiers have higher rate limits
- Endpoint type
Read endpoints have higher limits than write endpoints
Rate limit headers are included in all API responses:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 995
X-RateLimit-Reset: 1620000000
Next Steps
Explore these resources to learn more about specific API functionality: