Authentication
The ReceiveIt API uses API key authentication. All requests must include your API key in the header.
API Key
Your API key is available in your dashboard. It must be included in all HTTP requests.
Authorization: Bearer YOUR_API_KEY
Content-Type: application/jsonFree Plan
1000
req/day
Pro Plan
10000
req/day
Enterprise Plan
∞
Unlimited
API Endpoints
POST
/api/v1/pagesCreate an Upload Page
Create a new custom upload page
Paramètres
{
"name": "My upload page",
"description": "Page description",
"logo_url": "https://example.com/logo.png",
"primary_color": "#3B82F6",
"secondary_color": "#8B5CF6",
"welcome_message": "Welcome to our upload page",
"max_file_size": 10485760,
"allowed_extensions": ["jpg", "png", "pdf"],
"expires_at": "2024-12-31T23:59:59Z"
}Réponse
{
"success": true,
"data": {
"id": "page_123456",
"name": "My upload page",
"url": "https://receiveit.io/upload/abc123",
"created_at": "2024-01-15T10:30:00Z",
"status": "active"
}
}GET
/api/v1/pagesList Pages
Retrieve the list of all your upload pages
Paramètres de requête
?page=1&limit=20&status=active&search=nameRéponse
{
"success": true,
"data": {
"pages": [
{
"id": "page_123456",
"name": "My upload page",
"url": "https://receiveit.io/upload/abc123",
"status": "active",
"file_count": 15,
"created_at": "2024-01-15T10:30:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 45
}
}
}GET
/api/v1/pages/{page_id}/filesRetrieve Files
List all files received on a page
Paramètres de requête
?page=1&limit=50&sort=created_at&order=descRéponse
{
"success": true,
"data": {
"files": [
{
"id": "file_789012",
"name": "document.pdf",
"size": 2048576,
"type": "application/pdf",
"url": "https://receiveit.io/files/abc123",
"uploaded_at": "2024-01-15T14:30:00Z",
"uploader_ip": "192.168.1.1"
}
],
"pagination": {
"page": 1,
"limit": 50,
"total": 125
}
}
}Webhooks
Receive real-time notifications when files are uploaded to your pages.
file.uploaded
Triggered when a file is uploaded
file.downloaded
Triggered when a file is downloaded
file.deleted
Triggered when a file is deleted
Payload Example
{
"event": "file.uploaded",
"timestamp": "2024-01-15T14:30:00Z",
"data": {
"file_id": "file_789012",
"page_id": "page_123456",
"filename": "document.pdf",
"size": 2048576,
"type": "application/pdf"
},
"signature": "sha256=abc123..."
}Code Examples
const axios = require('axios');
const API_KEY = 'your_api_key_here';
const BASE_URL = 'https://api.receiveit.io/v1';
// Create an upload page
async function createPage() {
try {
const response = await axios.post(`${BASE_URL}/pages`, {
name: 'My upload page',
description: 'Page to receive files',
primary_color: '#3B82F6'
}, {
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json'
}
});
console.log('Page created:', response.data);
return response.data;
} catch (error) {
console.error('Error:', error.response.data);
}
}
// List files
async function getFiles(pageId) {
try {
const response = await axios.get(`${BASE_URL}/pages/${pageId}/files`, {
headers: {
'Authorization': `Bearer ${API_KEY}`
}
});
console.log('Files:', response.data);
return response.data;
} catch (error) {
console.error('Error:', error.response.data);
}
}Support and Resources
Need help integrating the API? We are here to assist you.
Explorez nos autres solutions
Découvrez comment ReceiveIt peut s'adapter à vos besoins