Skip to main content

Prerequisites

Before you begin, make sure you have:
  • A Mission Inbox account
  • Basic understanding of REST APIs
  • A development environment set up
  • Your preferred programming language ready

Step 1: Access Developer Settings

Navigate to Settings > Developer Settings in your Mission Inbox dashboard to manage your API credentials.

Step 2: Get Your API Key

In the Developer Settings page:
  1. Generate a new token: Click “Generate New API Key” to create a fresh token for your application
  2. Copy existing API key: Or copy an existing API key if you already have one
  3. Securely store your API key: Save it in your environment variables or secure credential store
Keep your API key secure and never expose it in client-side code or public repositories.

Step 3: Test Your Connection

Start by testing your API connection to ensure everything is working:
const response = await fetch('https://api-v2.missioninbox.com/api/account/information/', {
  method: 'GET',
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY',
    'Content-Type': 'application/json'
  }
});

console.log(response.status); // Should return 200
const data = await response.json();
console.log('Account Info:', data);
import requests

headers = {
    'Authorization': 'Api-Key YOUR_API_KEY',
    'Content-Type': 'application/json'
}

response = requests.get('https://api-v2.missioninbox.com/api/account/information/', headers=headers)
print(f'Status: {response.status_code}')
print(f'Response: {response.json()}')
<?php
$headers = [
    'Authorization: Api-Key YOUR_API_KEY',
    'Content-Type: application/json'
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api-v2.missioninbox.com/api/account/information/');
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

echo "Status: $httpCode\n";
echo "Response: $response\n";
?>

Authentication

All API requests require authentication using your API key in the Authorization header:
Authorization: Api-Key YOUR_API_KEY

Error Handling

Implement proper error handling in your application:
try {
  const response = await fetch(apiUrl, options);
  
  if (!response.ok) {
    const error = await response.json();
    throw new Error(`API Error ${response.status}: ${error.message}`);
  }
  
  const data = await response.json();
  return data;
} catch (error) {
  console.error('Email sending failed:', error.message);
  // Handle error appropriately
}

Best Practices

  • Store API keys securely using environment variables
  • Never commit API keys to version control
  • Use HTTPS for all requests
  • Implement proper authentication in your application
  • Implement retry logic with exponential backoff
  • Cache API responses when appropriate
  • Use batch operations for multiple emails
  • Monitor rate limits and adjust request frequency
  • Always include both HTML and plain text versions
  • Use descriptive subject lines
  • Implement proper unsubscribe mechanisms
  • Follow CAN-SPAM and GDPR guidelines
  • Track email delivery status
  • Monitor bounce and complaint rates
  • Set up webhooks for real-time notifications
  • Review analytics regularly

Next Steps

Now that you’ve sent your first email, here’s what to explore next:
Need help? If you run into any issues during setup, don’t hesitate to reach out to our support team at support@missioninbox.com.