Simple, elegant automation
https://twition.shubhojeet.comRead Notion
Generate Content
Post to Twitter
curl -X POST https://twition.shubhojeet.com/api/automatecurl -X POST "https://twition.shubhojeet.com/api/automate?pageId=your-page-id"{
"success": true,
"message": "Successfully posted 2 tweet(s) from 3 completed task(s)",
"data": {
"tasks": {
"count": 3,
"titles": ["Task 1", "Task 2", "Task 3"]
},
"content": {
"type": "thread",
"tweets": 2
},
"twitter": {
"tweetIds": ["123456789", "987654321"],
"success": true
},
"timing": {
"startTime": "2024-01-15T10:30:00Z",
"endTime": "2024-01-15T10:30:05Z",
"duration": "5000ms"
}
},
"metadata": {
"stage": "completed",
"source": "unified-automation-endpoint",
"version": "1.0.0"
}
}{
"success": true,
"message": "No completed tasks found for today",
"action": "skipped",
"tasks": []
}{
"success": false,
"message": "Automation workflow failed",
"error": {
"message": "Twitter API rate limit exceeded",
"stage": "twitter-posting",
"timestamp": "2024-01-15T10:30:00Z"
},
"debug": {
"startTime": "2024-01-15T10:29:55Z",
"failedAt": "2024-01-15T10:30:00Z",
"stage": "twitter-posting"
}
}curl https://twition.shubhojeet.com/api/automate{
"status": "ready",
"message": "Unified automation endpoint is ready",
"configuration": {
"environment": "valid"
},
"endpoints": {
"trigger": "POST /api/automate",
"health": "GET /api/automate"
},
"timestamp": "2024-01-15T10:30:00Z"
}curl https://twition.shubhojeet.com/api/status?detailed=true{
"status": "healthy",
"service": "twitter-automation",
"timestamp": "2024-01-15T10:30:00Z",
"integrations": {
"notion": {
"status": "healthy",
"connected": true,
"description": "Notion database connection for task retrieval"
},
"twitter": {
"status": "healthy",
"connected": true,
"description": "Twitter API connection for posting tweets"
},
"email": {
"status": "healthy",
"connected": true,
"description": "Email service for error and success notifications"
},
"gemini": {
"status": "configured",
"connected": true,
"description": "Google Gemini AI for content generation"
}
},
"errorHandling": {
"initialized": true,
"globalErrorHandlers": "active",
"emailNotifications": "enabled",
"features": [
"Retry mechanism with exponential backoff",
"Detailed error context and stack traces",
"Stage-based error tracking"
]
},
"overall": {
"status": "healthy",
"allServicesHealthy": true,
"message": "All systems operational with enhanced error handling"
}
}Add a button to your Notion page:
/button in Notionhttps://twition.shubhojeet.com/api/automate?pageId=62821820-ea75-4dca-b0e6-f1bb857c58a2POSTfetch('/api/automate', {
method: 'POST'
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));curl -X POST https://twition.shubhojeet.com/api/automate| Status Code | Error Stage | Description |
|---|---|---|
| 500 | environment-validation | Missing required environment variables |
| 500 | notion-fetch | Failed to connect to Notion API or fetch tasks |
| 500 | gemini-generation | AI content generation failed |
| 500 | twitter-posting | Twitter API error or rate limit exceeded |
| 200 | success | Automation completed successfully |