This example demonstrates connecting Gmail (OAuth 2.0) and sending an email using the gmail_send_email feature.

1) Connect (OAuth)

Start the OAuth flow. You’ll receive a redirect_url to send the user to Google.
curl -X POST "https://api.incredible.one/v1/integrations/gmail/connect" \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": "user_123",
    "callback_url": "https://your.app/oauth/callback"
  }'
Expected response:
{
  "redirect_url": "https://accounts.google.com/o/oauth2/auth?...",
  "instructions": "Please visit the redirect URL to complete authentication"
}
Complete the browser flow. After your callback_url receives the redirect, the connection is established for user_id.

2) Execute feature (send email)

curl -X POST "https://api.incredible.one/v1/integrations/gmail/execute" \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": "user_123",
    "feature_name": "gmail_send_email",
    "inputs": {
      "recipient_email": "recipient@example.com",
      "subject": "Hello from Incredible",
      "body": "This email was sent via the Gmail integration."
    }
  }'
Example success response:
{
  "success": true,
  "result": {"message_id": "abc123", "status": "sent"},
  "integration_id": "gmail",
  "feature_name": "gmail_send_email",
  "user_id": "user_123"
}
Notes:
  • Ensure the user completed OAuth before executing features.
  • Some fields (e.g., attachments) may be required depending on your feature configuration.
View source on GitHub → 6_gmail_integration.py