Ask AI

Delivami assistant

Ask Delivami AI

Get instant help with features, workflows, and best practices.

Suggested

AI may produce inaccurate information.

DelivamiDocs

Building Integrations

Create custom integrations with the Delivami API.

Overview

This guide walks you through building custom integrations with Delivami. Connect your favorite tools or build custom workflows.

Integration Types

Webhook-Based

Receive real-time notifications:

  • Delivery status changes
  • Payment events
  • Client activity

API-Based

Poll or query data:

  • List deliveries
  • Create invoices
  • Manage clients

Hybrid

Combine both approaches:

  • Webhooks for real-time events
  • API for on-demand queries

Getting Started

Prerequisites

  • Delivami Pro or Studio plan
  • API key with appropriate permissions
  • Development environment

Step 1: Get API Key

  1. Go to Settings > Integrations > API Keys
  2. Create a new key
  3. Save it securely

Step 2: Test Connection

curl -X GET "https://api.delivami.com/v1/me" \
  -H "Authorization: Bearer YOUR_API_KEY"

If successful, you'll receive your account information.

Common Integration Patterns

Slack Integration

Notify your team when deliveries are approved:

// Webhook handler
app.post('/webhooks/delivami', (req, res) => {
  const event = req.body;
  
  if (event.type === 'delivery.approved') {
    slack.send({
      channel: '#deliveries',
      text: `✅ ${event.data.title} was approved!`
    });
  }
  
  res.sendStatus(200);
});

Google Drive Backup

Sync deliveries to Google Drive:

// Sync approved deliveries
async function syncToDrive(deliveryId) {
  const delivery = await delivami.getDelivery(deliveryId);
  
  for (const file of delivery.files) {
    const driveFile = await googleDrive.upload({
      name: file.name,
      content: file.buffer
    });
    
    console.log(`Uploaded ${file.name} to Drive`);
  }
}

Custom Dashboard

Build a custom dashboard with delivery data:

// Fetch and display deliveries
async function loadDashboard() {
  const deliveries = await delivami.getDeliveries({
    status: 'in_review',
    limit: 20
  });
  
  renderDashboard(deliveries);
}

Authentication

OAuth 2.0

For user-facing integrations:

  1. Redirect to Delivami OAuth
  2. User authorizes your app
  3. Receive access token
  4. Use token for API calls

API Key Authentication

For server-side integrations:

const delivami = new Delivami({
  apiKey: process.env.DELIVAMI_API_KEY
});

Error Handling

Common Errors

ErrorMeaningSolution
401Invalid API keyCheck your key
403Insufficient permissionsUpdate key scopes
404Resource not foundCheck resource ID
429Rate limitedWait and retry
500Server errorContact support

Retry Strategy

async function makeRequest(fn, retries = 3) {
  try {
    return await fn();
  } catch (error) {
    if (error.status === 429 && retries > 0) {
      const wait = Math.pow(2, 4 - retries) * 1000;
      await sleep(wait);
      return makeRequest(fn, retries - 1);
    }
    throw error;
  }
}

Testing

Test Mode

Use test API keys for development:

  • No real data affected
  • Same API endpoints
  • Test webhook delivery

Test Webhooks

  1. Create a test webhook
  2. Send test events
  3. Verify your handler works

Postman Collection

Download our Postman collection:

  1. Go to Settings > Integrations > API
  2. Click Download Postman Collection
  3. Import into Postman

Deployment

Environment Variables

Store sensitive data securely:

# Production
DELIVAMI_API_KEY=live_key_here
WEBHOOK_SECRET=your_secret_here

# Test
DELIVAMI_API_KEY=test_key_here

Monitoring

Set up monitoring for:

  • API response times
  • Error rates
  • Webhook delivery success

Best Practices

  1. Start small - Build a simple integration first
  2. Handle errors gracefully - Always have fallbacks
  3. Log everything - Help with debugging
  4. Test thoroughly - Use test mode
  5. Document your code - Future you will thank you

Resources

Next Steps

On this page