Back

EmailOctopus API Essential Guide

Aug 16, 20246 minute read

What type of API does EmailOctopus provide?

Based on the search results provided, EmailOctopus appears to have a REST API. The available information strongly suggests that EmailOctopus uses a REST API, which is the most common and practical choice for their type of service.

The key points are:

  1. The search results do not explicitly state what type of API EmailOctopus uses.

  2. However, the "API Documentation" for EmailOctopus, which typically refers to a REST API.

  3. REST APIs are very common and widely used for web services and applications.

  4. The EmailOctopus API documentation page does not mention SOAP, GraphQL, or other API types, which further suggests it is likely a REST API.

  5. REST APIs are well-suited for web and mobile applications, which aligns with EmailOctopus's email marketing service.

To confirm this definitively, you may want to check the API documentation for specific mentions of REST endpoints or HTTP methods, look for JSON or XML response formats, or contact EmailOctopus support directly for confirmation.

Does the EmailOctopus API have webhooks?

Webhook Support

Yes, the official EmailOctopus API does support webhooks.

Event Types

You can subscribe to the following event types via webhooks:

  • contact.bounced
  • contact.clicked
  • contact.complained
  • contact.created
  • contact.deleted
  • contact.opened
  • contact.unsubscribed
  • contact.updated

Setting Up Webhooks

To set up webhooks:

  1. Provide an HTTPS endpoint that can accept JSON requests.
  2. EmailOctopus will send requests to that endpoint as events occur for your contacts.
  3. Each webhook request can contain up to 1000 events.
  4. When setting up a webhook, you can specify which event types to receive.
  5. You can exclude events generated via the API or imports.

Webhook Payload

The webhook payload includes details like:

  • Event ID
  • Event type
  • List ID
  • Contact ID
  • Contact email address
  • Contact fields (if present)
  • Contact tags (if present)
  • Contact status (if present)
  • Timestamp

Validating Requests

EmailOctopus provides a way to validate webhook requests using an HMAC-SHA256 signature.

Best Practices

  • Events are buffered for up to 1 minute before sending.
  • Failed requests are retried up to 9 times over about 10 days.
  • Your endpoint should be able to handle events with some fields omitted.

In summary, EmailOctopus offers comprehensive webhook support for tracking various contact-related events, with options to customize which events you receive and validate incoming requests.

Rate Limits and other limitations

Based on the search results provided, here are the API Rate Limits for the EmailOctopus API:

Rate Limits

  1. You can make up to 10 requests per second to the EmailOctopus API.

  2. If you exceed this limit, you will receive a '429 Too Many Requests' HTTP status code.

  3. Your connection will be blocked for up to a minute if you exceed the rate limit.

Key Points to Consider

  • These limits are in place to ensure a high-quality service for all users.

  • If you need to exceed these limits, EmailOctopus suggests considering the following alternatives:

    • For bulk uploading a list, use the import process, which is faster and not subject to these limits.
    • For syncing changes to a list with your database, consider using the webhooks feature.

Best Practices

  1. Plan your API usage to stay within the 10 requests per second limit.

  2. Implement proper error handling in your code to deal with potential 429 status codes.

  3. For large data operations, consider using the recommended alternatives like the import process or webhooks.

  4. If you consistently need higher limits, you may want to contact EmailOctopus support to discuss your specific needs.

By adhering to these rate limits and following the suggested alternatives for high-volume operations, you can ensure smooth integration with the EmailOctopus API while maintaining good service quality for all users.

Latest API Version

The most recent version of the EmailOctopus API is 1.6.

Key points to consider:

  1. The API version 1.6 is consistently used in the API endpoints shown in the search results [2][3][5].

  2. The EmailOctopus Add-On for Gravity Forms was updated to use API version 1.6 in its release 1.3 [4].

  3. The API documentation provided in the search results consistently refers to version 1.6 for various API operations, such as updating lists, getting list details, and creating contacts [2][3][5].

Code example:

Here's an example of how to use the latest API version (1.6) to create a contact in a list:

import requests headers = { 'Content-Type': 'application/json', } data = '''{ "api_key": "00000000-0000-0000-0000-000000000000", "email_address": "[email protected]", "fields": { "FirstName": "Joe", "LastName": "Bloggs", "Birthday": "2020-12-20" }, "tags": ["vip"], "status": "SUBSCRIBED" }''' response = requests.post('https://emailoctopus.com/api/1.6/lists/00000000-0000-0000-0000-000000000000/contacts', headers=headers, data=data)

Best practices:

  1. Always use the latest API version (currently 1.6) to ensure access to the most up-to-date features and improvements.

  2. Include your API key in all requests to authenticate your access to the EmailOctopus API.

  3. Use appropriate HTTP methods (GET, POST, PUT, etc.) as specified in the API documentation for different operations.

  4. Handle potential errors by checking the response status code and error messages returned by the API.

How to get a EmailOctopus developer account and API Keys?

To get a developer account for EmailOctopus and create an API integration, follow these steps:

  1. Sign up for an EmailOctopus account: If you don't already have an EmailOctopus account, you'll need to sign up for one at emailoctopus.com.

  2. Log in to your EmailOctopus account: Once you have an account, log in to access your dashboard.

  3. Navigate to the API documentation page: Go to the API documentation page at https://emailoctopus.com/api-documentation.

  4. Generate an API key: On the API documentation page, you'll find an option to create an API key. Click on the "Create key" button.

  5. Name your API key: You'll be prompted to provide a name for your API key. This helps you identify different keys if you create multiple ones.

  6. Create the API key: After naming your key, click the "Create" button to generate your API key.

  7. Save your API key: Once created, your API key will be displayed. Make sure to copy and save this key securely, as it will only be shown once. You can also download the key as a CSV file.

What can you do with the EmailOctopus API?

Based on the provided search results, here are the key data models you can interact with using the EmailOctopus API, along with what is possible for each:

Campaigns

  • Get campaign reports, including:
    • Summary
    • Links
    • Bounced contacts
    • Clicked contacts
    • Complained contacts
    • Opened contacts
    • Sent contacts
    • Unsubscribed contacts
    • Not clicked contacts
    • Not opened contacts

Lists

  • Get a specific list
  • Get all lists
  • Create a new list
  • Update an existing list
  • Delete a list
  • Get all tags on a list

Contacts

  • Get a specific contact from a list
  • Get all contacts of a list
  • Get subscribed contacts of a list
  • Get unsubscribed contacts of a list
  • Get contacts of a list by tag
  • Create a new contact in a list
  • Update an existing contact in a list
  • Delete a contact from a list
  • Update multiple contacts in a list

List Fields

  • Create a new list field
  • Update an existing list field
  • Delete a list field

Key Points to Consider

  • The API uses HTTPS for all requests.
  • JSON objects are recommended for POST requests, but form parameters are also accepted.
  • All parameters are required unless otherwise specified.
  • Responses are returned in JSON format.
  • Any non-200 HTTP response code can be considered an error.
  • API keys are used for authentication.

Best Practices

  • Include a Content-Type: application/json header when making JSON requests.
  • Use the API to automate subscriber management, trigger email campaigns based on various actions, or synchronize marketing efforts across different platforms.
  • Consider integrating EmailOctopus with other services like e-commerce platforms, CRMs, or social media management tools for more comprehensive marketing automation.

This overview covers the main data models and operations available through the EmailOctopus API, allowing developers to interact with campaigns, lists, contacts, and list fields programmatically.