Back

Omnisend API Essential Guide

Aug 16, 20246 minute read

What type of API does Omnisend provide?

Omnisend has a REST API. The key details are:

API Type

Omnisend has a REST API.

Key Details

  • Omnisend recommends using their v3 API version for new projects due to its stability, feature-rich capabilities, and ongoing support and development.
  • While a v4 version is available and supports OAuth authorization, Omnisend advises against using it for new projects.
  • The Omnisend API allows connecting any ecommerce platform or adding custom features to existing integrations.

API Documentation

  • Omnisend provides API documentation (API reference) that can be accessed online.
  • They offer a Quick Start Guide and JavaScript API documentation to help developers get started.
  • Omnisend also provides a Developer Center for debugging purposes.

Integration Capabilities

  • The API can be used to integrate features like product pickers, automations (e.g. Product Abandonment, Browse Abandonment), order and shipping confirmations, and passing contact info to Omnisend.
  • It's particularly useful for platforms like Magento, OpenCart, and custom ecommerce platforms.

Best Practices

When working with REST APIs like Omnisend's, it's important to consider:

  • Using appropriate HTTP methods (GET, POST, PUT, DELETE) for different operations.
  • Handling authentication and authorization properly.
  • Structuring API requests and handling responses efficiently.
  • Following API versioning guidelines provided by Omnisend.

Does the Omnisend API have webhooks?

The Omnisend API does not appear to have traditional webhooks that you can subscribe to for receiving event notifications. Instead, Omnisend provides an events endpoint (/events) that allows you to send events to Omnisend. This is used to track customer behavior and trigger automations.

The events endpoint expects a specific request body format, including eventName, origin, eventVersion, contact information, and properties. You can send predefined events or custom events to Omnisend using this endpoint.

Some key events you can send include order events (e.g., "placed order") and cart events (e.g., "added product to cart", "started checkout"). These events allow Omnisend to track customer actions and enable features like cart abandonment automation.

The events endpoint requires authentication using an API key. While Omnisend can receive events, it does not appear to offer outgoing webhooks that you can subscribe to. For example, when integrating with Pabbly Connect, Omnisend cannot be selected as a trigger due to the lack of webhook support.

In summary, the Omnisend API allows you to send events to their platform, but does not offer traditional webhooks for subscribing to notifications. The focus is on sending customer behavior data to Omnisend rather than receiving real-time updates from Omnisend.

Rate Limits and other limitations

The API Rate Limits for the Omnisend API are as follows:

Rate Limit Details

  • API requests limit rate: 400 requests per 1 minute (period) [1].

Rate Limit Headers

The rate limits are returned with every request in the following headers [1]:

  1. X-Rate-Limit-Limit: The number of allowed requests in the current period
  2. X-Rate-Limit-Remaining: The number of remaining requests in the current period
  3. X-Rate-Limit-Reset: The number of seconds left in the current period

Key Points to Consider

  • The rate limit is applied on a per-minute basis, allowing for 400 requests within each 60-second window [1].
  • It's important to monitor these headers in your API integration to avoid exceeding the rate limits.
  • If you exceed the rate limit, you may receive an error response from the API.

Best Practices

  1. Implement rate limiting in your application to stay within the allowed limits.
  2. Use the provided headers to track your usage and adjust your request rate accordingly.
  3. Consider implementing exponential backoff and retry mechanisms for handling rate limit errors.
  4. If you consistently need more requests per minute, contact Omnisend support to discuss your needs.

Code Example

Here's a simple Python example of how you might check the rate limit headers:

import requests API_KEY = 'YOUR-API-KEY' URL = 'https://api.omnisend.com/v5/some-endpoint' headers = { 'X-API-KEY': API_KEY, 'accept': 'application/json', 'content-type': 'application/json' } response = requests.get(URL, headers=headers) # Check rate limit headers limit = response.headers.get('X-Rate-Limit-Limit') remaining = response.headers.get('X-Rate-Limit-Remaining') reset = response.headers.get('X-Rate-Limit-Reset') print(f"Rate Limit: {limit}") print(f"Remaining Requests: {remaining}") print(f"Seconds until reset: {reset}")

This code snippet demonstrates how to make a request to the Omnisend API and then check the rate limit headers in the response. You can use this information to manage your API usage and avoid exceeding the rate limits.

Latest API Version

The most recent version of the Omnisend API is v5.

Key points to consider:

  • Omnisend has introduced API v5, which is designed for easier integration, clearer capabilities, and improved functionality [1].

  • The v5 API offers several benefits over previous versions:

    • Simplified API structure compared to v3
    • Enhanced capabilities and new features
    • Focus on event-driven actions
    • Includes guides to help achieve desired use cases [1]
  • While v4 is available, it is not recommended for new projects. The company plans to integrate v4 functionalities into the more robust v3 version [2].

  • For new projects, Omnisend highly recommends using their v3 API version due to its stability, feature-rich capabilities, and ongoing support and development [2].

Best practices:

  1. Use the latest v5 API for new integrations when possible.
  2. If v5 doesn't meet your needs, consider using v3 instead of v4.
  3. Refer to the comprehensive guides and events documentation provided by Omnisend for detailed information on using v5 [1].
  4. If you have any questions or need assistance, don't hesitate to reach out to Omnisend's support team at [email protected] [2].

By using the most recent API version, you'll benefit from the latest features, improvements, and ongoing support from Omnisend.

Citations: [1] Introducing API v5: Easier integration, clearer capabilities, and improved functionality. [2] Omnisend API v4.0 Overview

How to get a Omnisend developer account and API Keys?

To get a developer account for Omnisend and create an API integration, here are the key steps:

1. Create a Developer Console Account

  • Go to the Omnisend Developer Center page
  • If you don't have an account yet, register for one
  • If you already have an account, simply log in with your credentials

2. Add Yourself as a Developer User to Your Omnisend Account

  • As the account owner, go to Store Settings -> Settings -> Developers in your Omnisend account
  • Click "Add Developer"
  • Enter your email address (the one you used for the Developer Console account)
  • You'll receive an email to verify your email address
  • Once confirmed, you'll have access to the Developers Console for your store

3. Create an API Key

  • Log in to your Omnisend account
  • Navigate to the API Keys section
  • Click "Create API Key" and give it a descriptive name
  • Copy the generated key immediately and store it securely - you won't be able to see it again

4. Start Using the API

  • Use the API key to authenticate requests to the Omnisend API
  • Refer to the API documentation for details on available endpoints and how to structure requests

What can you do with the Omnisend API?

Based on the search results provided, here is a list of data models you can interact with using the Omnisend API, along with what is possible for each:

Contacts

  • Identify/create contacts
  • Get contact details
  • List contacts

Events

  • Track any event around a contact (e.g., "page viewed", "product ordered", etc.)
  • List events

Orders

  • Retrieve order details
  • List orders

Products

  • List products
  • Create, update, and delete product information (implied from CRUD operations available for other models)

Product Categories

  • List product categories
  • Create product category
  • Delete product category
  • Get product category details
  • Update product category

Carts

  • Retrieve cart information

Campaigns

  • List campaigns

Batches

  • Get batches
  • Create batch
  • Get batch information
  • Get batch items

Key points to consider:

  • The Omnisend API allows you to connect any ecommerce platform or add custom features to your current integration.
  • The API uses OAuth 2.0 for authentication.
  • There are different versions of the API (v3, v4, v5), with v3 being recommended for stability and ongoing support.
  • The API supports pagination for handling large datasets.

Best practices:

  • Use the latest recommended version of the API (v3 as per the search results).
  • Implement proper authentication using OAuth 2.0.
  • Handle pagination when retrieving large sets of data.
  • Use appropriate HTTP methods (GET, POST, PATCH, DELETE) for different operations.
  • Include the necessary headers, such as the API key and content type, in your requests.

This list covers the main data models and operations available through the Omnisend API based on the provided search results. For the most up-to-date and comprehensive information, it's always best to refer to the official Omnisend API documentation.