Skip to main content

Zapier Integration

Setup

  1. Create a Zapier App: Use the HTTP Request action
  2. Authentication: Configure API key in Zapier’s authentication settings
  3. Triggers: Use webhooks or polling to detect new records
  4. Actions: Create records using POST endpoints with AI prompts

Example: Create Invoice Trigger

const response = await fetch('https://api.useadam.io/v1/adam/invoices', {
  method: 'POST',
  headers: {
    'X-API-Key': bundle.authData.api_key,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    prompt: `Create an invoice for ${bundle.inputData.customer} for $${bundle.inputData.amount} for ${bundle.inputData.description}`
  })
});

return response.json();

Make (Integromat) Integration

Setup

  1. HTTP Module: Configure with base URL https://api.useadam.io/v1/adam
  2. Authentication: Add API key header (X-API-Key)
  3. Data Mapping: Map your data to API request format
  4. Error Handling: Handle API errors appropriately

Example: HTTP Request Configuration

  • Method: POST
  • URL: https://api.useadam.io/v1/adam/invoices
  • Headers:
    • X-API-Key: Your API key
    • Content-Type: application/json
  • Body:
{
  "prompt": "{{1.prompt}}"
}

cURL Examples

Create Invoice

curl -X POST "https://api.useadam.io/v1/adam/invoices" \
  -H "X-API-Key: your_secret_key" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Create an invoice for ABC Company for $1,000 for consulting services"
  }'

Update Invoice Payment

curl -X POST "https://api.useadam.io/v1/adam/invoices/invoice-uuid/payments" \
  -H "X-API-Key: your_secret_key" \
  -H "Content-Type: application/json" \
  -d '{
    "payments": [
      {
        "amount_paid": 500.00,
        "category": "Bank Transfer",
        "date": "2024-01-20"
      }
    ]
  }'

Get Contacts

curl -X GET "https://api.useadam.io/v1/adam/contacts?page=1&limit=20" \
  -H "X-API-Key: your_secret_key"

JavaScript/Node.js Example

const axios = require('axios');

const apiClient = axios.create({
  baseURL: 'https://api.useadam.io/v1/adam',
  headers: {
    'X-API-Key': 'your_secret_key',
    'Content-Type': 'application/json'
  }
});

// Create invoice
async function createInvoice(prompt) {
  try {
    const response = await apiClient.post('/invoices', {
      prompt: prompt
    });
    return response.data;
  } catch (error) {
    console.error('Error creating invoice:', error.response?.data || error.message);
    throw error;
  }
}

// Get invoices
async function getInvoices(page = 1, limit = 20) {
  try {
    const response = await apiClient.get('/invoices', {
      params: { page, limit }
    });
    return response.data;
  } catch (error) {
    console.error('Error fetching invoices:', error.response?.data || error.message);
    throw error;
  }
}

Python Example

import requests

class AdamAPI:
    def __init__(self, api_key):
        self.base_url = 'https://api.useadam.io/v1/adam'
        self.headers = {
            'X-API-Key': api_key,
            'Content-Type': 'application/json'
        }
    
    def create_invoice(self, prompt):
        response = requests.post(
            f'{self.base_url}/invoices',
            headers=self.headers,
            json={'prompt': prompt}
        )
        response.raise_for_status()
        return response.json()
    
    def get_invoices(self, page=1, limit=20):
        response = requests.get(
            f'{self.base_url}/invoices',
            headers=self.headers,
            params={'page': page, 'limit': limit}
        )
        response.raise_for_status()
        return response.json()

# Usage
api = AdamAPI('your_secret_key')
invoice = api.create_invoice('Create an invoice for ABC Company for $1,000')

Important Notes

  • Dates: All dates should be in ISO 8601 format (YYYY-MM-DD)
  • Amounts: All monetary amounts should be numeric (no currency symbols in API requests)
  • Timezone: The API uses UTC timezone by default; business timezone is available in business profile
  • AI Prompts: All create operations require AI prompts for intelligent record generation
  • UUID Resolution: Update operations check both uuid and source_uuid for record identification