Webhooks & Notifications
Upload-Post allows you to receive real-time notifications about your upload statuses. This is particularly useful for asynchronous uploads or scheduled posts where you don't receive an immediate confirmation of the final publish status in the API response.
Configuration
You can configure notifications in the Upload-Post Dashboard:
You can choose to receive notifications via:
- Webhook: A POST request sent to your server with a JSON payload.
- Telegram: A message sent to a configured Telegram chat.
Configuration via API
You can also configure your notification preferences programmatically using the API.
Endpoint: POST https://app.upload-post.com/api/uploadposts/users/notifications
Authentication: Requires a valid API Key.
Request Body:
{
"channels": {
"webhook": true,
"telegram": false
},
"webhook_url": "https://your-server.com/webhook-endpoint",
"telegram_chat_id": "123456789"
}
Response:
{
"success": true,
"notifications": {
"channels": { "webhook": true, ... },
"webhook_url": "...",
...
}
}
Webhook Payload
When an upload process completes (whether successfully or with a failure), Upload-Post sends a POST request to your configured webhook URL. The request body is a JSON object containing details about the event.
Example Payload
{
"event": "upload_completed",
"user_email": "[email protected]",
"profile_username": "your_profile_username",
"platform": "instagram",
"media_type": "video",
"title": "My Awesome Video",
"caption": "Check this out! #cool",
"result": {
"success": true,
"url": "https://www.instagram.com/p/C1234567890/",
"publish_id": "17987654321098765",
"post_id": "17987654321098765",
"error": null
},
"created_at": "2024-03-15T14:30:00.000000"
}
Field Descriptions
| Field | Type | Description |
|---|---|---|
event | string | The type of event. Currently, upload_completed. |
user_email | string | The email address of the user who initiated the upload. |
profile_username | string | The username of the profile associated with the upload. |
platform | string | The social platform where the post was uploaded (e.g., instagram, youtube, tiktok). |
media_type | string | The type of media uploaded (video, photo, or text). |
title | string | The title provided for the post. |
caption | string | The caption or description of the post. |
result | object | An object containing the outcome of the upload attempt. |
result.success | boolean | true if the upload was successful, false otherwise. |
result.url | string | The direct URL to the published post (if available and successful). |
result.publish_id | string | The ID assigned to the post by the platform. |
result.error | string | A description of the error if the upload failed. |
created_at | string | The timestamp of the event in ISO 8601 format. |
Usage Notes
- Idempotency: While we strive to deliver each notification exactly once, you should handle potential duplicate events based on your own unique identifiers if necessary (though
post_idorpublish_idcan serve this purpose for successful posts). - Security: Ensure your webhook endpoint is secure (HTTPS) and verify the data as needed for your application logic.