cURL
curl --request GET \ --url https://api.example.com/api/content/admin/all
{ "content": [ { "_id": "<string>", "title": "<string>", "description": "<string>", "type": "<string>", "category": "<string>", "price": 123, "fileUrl": "<string>", "filePublicId": "<string>", "thumbnailUrl": "<string>", "thumbnailPublicId": "<string>", "duration": 123, "fileSize": 123, "status": "<string>", "tags": [ {} ], "createdBy": { "_id": "<string>", "name": "<string>", "email": "<string>" }, "createdAt": "<string>", "updatedAt": "<string>" } ], "totalPages": 123, "currentPage": 123, "totalContent": 123 }
Retrieve all content including drafts (admin only)
Authorization: Bearer <admin_access_token>
"draft"
"published"
"pdf"
"video"
"audio"
curl -X GET "https://api.vaniykempire.com/api/content/admin/all?page=1&limit=10" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
curl -X GET "https://api.vaniykempire.com/api/content/admin/all?status=draft&page=1&limit=20" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
const response = await fetch( 'https://api.vaniykempire.com/api/content/admin/all?page=1&limit=10', { headers: { 'Authorization': `Bearer ${adminAccessToken}` } } ); const data = await response.json(); console.log(`Total content: ${data.totalContent}`); console.log(`Content items:`, data.content);
import requests response = requests.get( 'https://api.vaniykempire.com/api/content/admin/all', headers={'Authorization': f'Bearer {admin_access_token}'}, params={ 'page': 1, 'limit': 10, 'status': 'draft' } ) data = response.json() print(f"Total content: {data['totalContent']}")
Show content item properties
Show createdBy properties
{ "content": [ { "_id": "65f7b3c8e1234567890abcde", "title": "Advanced JavaScript Course", "description": "Learn modern JavaScript", "type": "video", "category": "programming", "price": 49.99, "fileUrl": "https://res.cloudinary.com/demo/video/upload/v1234567890/content/video.mp4", "filePublicId": "content/video", "thumbnailUrl": "https://res.cloudinary.com/demo/image/upload/v1234567890/thumbnails/thumb.jpg", "thumbnailPublicId": "thumbnails/thumb", "duration": 3600, "fileSize": 524288000, "status": "published", "tags": ["javascript", "programming", "web-development"], "createdBy": { "_id": "65f7b3c8e1234567890abc00", "name": "Admin User", "email": "[email protected]" }, "createdAt": "2024-03-15T10:30:00.000Z", "updatedAt": "2024-03-15T10:30:00.000Z" } ], "totalPages": 5, "currentPage": 1, "totalContent": 47 }
{ "error": "Invalid token" }
{ "error": "Admin access required" }
{ "error": "Internal server error message" }
fileUrl
filePublicId
/api/content
status