Introduction

Our API interface is used to integrate SendPulse’s distribution service capabilities with client’s personal projects.

The API is designed for developers and is accompanied by detailed documentation.

Description

SendPulse’s REST API works over the HTTP protocol and is essentially a set of methods used to perform requests and receive responses for each operation.

All answers return in the form of JSON structures.

The request limit is 10 requests per second.

Cross Domain Queries (jQuery Ajax Example) are not allowed. 

SendPulse API Libraries

The latest versions of SendPulse API client libraries are available at GitHub.

API Endpoint

All references to API requests in this document include the root URL:

https://api.sendpulse.com

Authorization

The authorization process requires a personal key for signing each further API request.

The necessary parameters to obtain a key can be found in the private account settings page found on the following URL 

https://login.sendpulse.com/settings in the API tab.

The following parameters are used:

grant_type has to be equal to client_credentials
client_id your ID (API)
client_secret your secret (API)

To get the key you have to send a POST request to:

https://api.sendpulse.com/oauth/access_token

The resulting key is valid for 1 hour and does not require additional requests for each operation. A request for a new key must be sent before the current key expires.

The key code (token) must be sent in the header of all requests except for requests for getting the token itself (when the key is not required).

A sample response:

{
  "access_token": "tf4Si1LydYpTAPyHXUgjig72jlrd5HpIJL5oigmc",
  "token_type": "Bearer",
  "expires_in": 3600
}

A sample key:

Authorization: Bearer tf4Si1LydYpTAPyHXUgjig72jlrd5HpIJL5oigmc

Error Codes and Descriptions

Error code Description
8 No data
10 Sender email address missing
11 Can’t find recipients addresses
13 Empty email message content field
14 Can’t find email address with the specified ID
17 Can’t find the email address
19 Email address already exists
20 Using free email services (not allowed)
21 No such email address awaiting activation
97 Invalid email address type. Using free email services is not allowed.
201 Empty mailing list name
203 This mailing list name already exists
211 Mailing list empty
213 Mailing list not found
303 Can’t find email addresses in the mailing list
400 Specified SMTP user doesn’t exist. Create an SMTP account.
502 Can’t find the email address
602 Can’t find the campaign. Probably, it has already been sent.
701 Sender email address or name not specified.
703 Can’t find the mailing list
704 Can’t find the sender
707 Account balance depleted
711 Wait 15 minutes before sending to the same list again
720 Empty subject field
721 Email message empty
722 Mailing list ID not specified
791 API-campaigns limit exceeded (5 per hour)
799 Incorrect date format. Use YYYY-MM-DD hh:ii:ss that equals or greater than the current date
800 Invalid operation
802 Campaign not found
901 Sender name not specified
902 Selected email address already in use
903 Sender email address not specified
904 Email address blacklisted
905 Sender address quota reached
906 Email address syntax error
1101 Email address not specified
1003 The specified sender doesn’t exist
1004 The activation code has been sent. Wait 15 minutes to retry
1005 Error sending confirmation
1104 Activation code not specified
2020202020 More than 10 requests per second