Introduction
Welcome to the WooCommerce Follow-Up Emails REST API! You can use our API to access Follow-Up Emails API endpoints.
You can view code examples and example responses in the dark area to the right.
Requirements
You must be using Follow-Up Emails 4.1 or higher.
EndPoint
This is the endpoint that all requests would use as a base. Accessing this base endpoint returns information about the API.
/fue-api/v1
curl -X GET https://yourwoosite.com/fue-api/v1 \
-u consumer_key:consumer_secret
JSON response example:
{
"store": {
"name": "Test All the Woo Things",
"description": "Just another WordPress site",
"URL": "http://yourwoosite.com",
"fue_version": "4.5.2",
"routes": {
"/": {
"supports": [
"HEAD",
"GET"
],
"meta": {
"self": "https://yourwoosite.com/fue-api/v1/"
}
},
"/emails": {
"supports": [
"HEAD",
"GET",
"POST"
],
"meta": {
"self": "https://yourwoosite.com/fue-api/v1/emails"
},
"accepts_data": true
},
"/emails/types": {
"supports": [
"HEAD",
"GET"
],
"meta": {
"self": "https://yourwoosite.com/fue-api/v1/emails/types"
}
},
"/emails/<id>": {
"supports": [
"HEAD",
"GET",
"POST",
"PUT",
"PATCH",
"DELETE"
],
"accepts_data": true
},
"/emails/templates": {
"supports": [
"HEAD",
"GET"
],
"meta": {
"self": "https://yourwoosite.com/fue-api/v1/emails/templates"
}
},
"/emails/send/<id>": {
"accepts_data": true,
"supports": [
"POST",
"PUT",
"PATCH"
]
},
"/queue": {
"supports": [
"HEAD",
"GET",
"POST"
],
"meta": {
"self": "https://yourwoosite.com/fue-api/v1/queue"
},
"accepts_data": true
},
"/queue/<id>": {
"supports": [
"HEAD",
"GET",
"POST",
"PUT",
"PATCH",
"DELETE"
],
"accepts_data": true
},
"/reports": {
"supports": [
"HEAD",
"GET"
],
"meta": {
"self": "https://yourwoosite.com/fue-api/v1/reports"
}
},
"/reports/emails": {
"supports": [
"HEAD",
"GET"
],
"meta": {
"self": "https://yourwoosite.com/fue-api/v1/reports/emails"
}
},
"/reports/emails/clicks": {
"supports": [
"HEAD",
"GET"
],
"meta": {
"self": "https://yourwoosite.com/fue-api/v1/reports/emails/clicks"
}
},
"/reports/emails/opens": {
"supports": [
"HEAD",
"GET"
],
"meta": {
"self": "https://yourwoosite.com/fue-api/v1/reports/emails/opens"
}
},
"/reports/emails/ctor": {
"supports": [
"HEAD",
"GET"
],
"meta": {
"self": "https://yourwoosite.com/fue-api/v1/reports/emails/ctor"
}
},
"/reports/users": {
"supports": [
"HEAD",
"GET"
],
"meta": {
"self": "https://yourwoosite.com/fue-api/v1/reports/users"
}
},
"/reports/excludes": {
"supports": [
"HEAD",
"GET"
],
"meta": {
"self": "https://yourwoosite.com/fue-api/v1/reports/excludes"
}
},
"/campaigns": {
"supports": [
"HEAD",
"GET"
],
"meta": {
"self": "https://yourwoosite.com/fue-api/v1/campaigns"
}
},
"/campaigns/<slug>": {
"supports": [
"HEAD",
"GET"
]
},
"/newsletter": {
"supports": [
"HEAD",
"GET"
],
"meta": {
"self": "https://yourwoosite.com/fue-api/v1/newsletter"
}
},
"/newsletter/lists": {
"supports": [
"HEAD",
"GET"
],
"meta": {
"self": "https://yourwoosite.com/fue-api/v1/newsletter/lists"
}
},
"/newsletter/subscribers": {
"supports": [
"HEAD",
"GET",
"POST"
],
"meta": {
"self": "https://yourwoosite.com/fue-api/v1/newsletter/subscribers"
},
"accepts_data": true
},
"/newsletter/subscribers/<id>": {
"supports": [
"HEAD",
"GET",
"POST",
"PUT",
"PATCH",
"DELETE"
],
"accepts_data": true
}
},
"meta": []
}
}
Authentication
The API Keys need to be generated from the WordPress Profile page by an administrator. If WooCommerce (2.2+) is already installed, the API Keys generated by WooCommerce can also be used with the API instead of using separate keys for Follow-Up Emails and WooCommerce.
REST API keys
Pre-generated keys can be used to authenticate use of the REST API endpoints. New keys can be generated either through the WordPress admin interface or they can be auto-generated through an endpoint.
Generating API keys in the WordPress admin interface
To create or manage keys for a specific WordPress user, go to WooCommerce > Settings > API > Keys/Apps.
Click the "Add Key" button. In the next screen, add a description and select the WordPress user you would like to generate the key for. Use of the REST API with the generated keys will conform to that user's WordPress roles and capabilities.
Choose the level of access for this REST API key, which can be Read access, Write access or Read/Write access. Then click the "Generate API Key" button and WooCommerce will generate REST API keys for the selected user.
Now that keys have been generated, you should see two new keys, a QRCode, and a Revoke API Key button. These two keys are your Consumer Key and Consumer Secret.
Auto generating API keys using our Application Authentication Endpoint
This endpoint can be used by any APP to allow users to generate API keys for your APP. This makes integration with WooCommerce API easier because the user only needs to grant access to your APP via a URL. After being redirected back to your APP, the API keys will be sent back in a separate POST request.
The following image illustrates how this works:
URL parameters
Parameter | Type | Description |
---|---|---|
app_name |
string | Your APP name mandatory |
scope |
string | Level of access. Available: read , write and read_write mandatory |
user_id |
string | User ID in your APP. For your internal reference, used when the user is redirected back to your APP. NOT THE USER ID IN WOOCOMMERCE mandatory |
return_url |
string | URL the user will be redirected to after authentication mandatory |
callback_url |
string | URL that will receive the generated API key. Note: this URL should be over HTTPS mandatory |
Creating an authentication endpoint URL
You must use the /wc-auth/v1/authorize
endpoint and pass the above parameters as a query string.
Example of how to build an authentication URL:
# Bash example
STORE_URL='http://yourwoosite.com'
ENDPOINT='/wc-auth/v1/authorize'
PARAMS="app_name=My App Name&scope=read_write&user_id=123&return_url=http://app.com/return-page&callback_url=https://app.com/callback-endpoint"
QUERY_STRING="$(perl -MURI::Escape -e 'print uri_escape($ARGV[0]);' "$PARAMS")"
QUERY_STRING=$(echo $QUERY_STRING | sed -e "s/%20/\+/g" -e "s/%3D/\=/g" -e "s/%26/\&/g")
echo "$STORE_URL$ENDPOINT?$QUERY_STRING"
Example of the screen that the user will see:
Notes
- While redirecting the user using
return_url
, you are also sentsuccess
anduser_id
parameters as query strings. success
sends0
if the user denied, or1
if authenticated successfully.- Use
user_id
to identify the user when redirected back to the (return_url
) and also remember to save the API Keys when yourcallback_url
is posted to after auth. - The auth endpoint will send the API Keys in JSON format to the
callback_url
, so it's important to remember that some languages such as PHP will not display it inside the$_POST
global variable, in PHP you can access it using$HTTP_RAW_POST_DATA
(for old PHP versions) orfile_get_contents('php://input');
.
Authentication over HTTPS
You may use HTTP Basic Auth by providing the REST API Consumer Key as the username and the REST API Consumer Secret as the password.
HTTP Basic Auth example
curl https://www.yourwoosite.com/fue-api/v1/emails \
-u consumer_key:consumer_secret
Occasionally some servers may not parse the Authorization header correctly (if you see a "Consumer key is missing" error when authenticating over SSL, you have a server issue). In this case, you may provide the consumer key/secret as query string parameters instead.
Example for servers that not properly parse the Authorization header:
curl https://www.yourwoosite.com/fue-api/v1/orders?consumer_key=123&consumer_secret=abc
Authentication over HTTP
You must use OAuth 1.0a "one-legged" authentication to ensure REST API credentials cannot be intercepted by an attacker. Typically you will use any standard OAuth 1.0a library in the language of your choice to handle the authentication, or generate the necessary parameters by following the following instructions.
Creating a signature
Collect the request method and URL
First you need to determine the HTTP method you will be using for the request, and the URL of the request.
The HTTP method will be GET
in our case.
The Request URL will be the endpoint you are posting to, e.g. http://www.yourwoosite.com/fue-api/v1/emails/
.
Collect parameters
Collect and normalize your query string parameters. This includes all oauth_*
parameters except for the oauth_signature
itself.
These values need to be encoded into a single string which will be used later on. The process to build the string is very specific:
- Percent encode every key and value that will be signed.
- Sort the list of parameters alphabetically by encoded key.
- For each key/value pair:
- Append the encoded key to the output string.
- Append the
=
character to the output string. - Append the encoded value to the output string.
- If there are more key/value pairs remaining, append a
&
character to the output string.
When percent encoding in PHP for example, you would use rawurlencode()
.
When sorting parameters in PHP for example, you would use uksort( $params, 'strcmp' )
.
Parameters example:
oauth_consumer_key=abc123&oauth_signature_method=HMAC-SHA1
Create the signature base string
The above values collected so far must be joined to make a single string, from which the signature will be generated. This is called the signature base string in the OAuth specification.
To encode the HTTP method, request URL, and parameter string into a single string:
- Set the output string equal to the uppercase HTTP Method.
- Append the
&
character to the output string. - Percent encode the URL and append it to the output string.
- Append the
&
character to the output string. - Percent encode the parameter string and append it to the output string.
Example signature base string:
GET&http%3A%2F%2Fwww.yourwoosite.com%2Fwp-json%2Fwc%2Fv1%2Forders&oauth_consumer_key%3Dabc123%26oauth_signature_method%3DHMAC-SHA1
Generate the signature
Generate the signature using the signature base string and your consumer secret key with a &
character with the HMAC-SHA1 hashing algorithm.
In PHP you can use the hash_hmac function.
HMAC-SHA1 or HMAC-SHA256 are the only accepted hash algorithms.
If you are having trouble generating a correct signature, you'll want to review the string you are signing for encoding errors. The authentication source can also be helpful in understanding how to properly generate the signature.
OAuth tips
- The OAuth parameters must be added as query string parameters and not included in the Authorization header. This is because there is no reliable cross-platform way to get the raw request headers in WordPress.
- The required parameters are:
oauth_consumer_key
,oauth_timestamp
,oauth_nonce
,oauth_signature
, andoauth_signature_method
.oauth_version
is not required and should be omitted. - The OAuth nonce can be any randomly generated 32 character (recommended) string that is unique to the consumer key. Read more suggestions on generating nonces on the Twitter REST API forums.
- The OAuth timestamp should be the unix timestamp at the time of the request. The REST API will deny any requests that include a timestamp outside of a 15 minute window to prevent replay attacks.
- You must use the store URL provided by the index when forming the base string used for the signature, as this is what the server will use. (e.g. if the store URL includes a
www
sub-domain, you should use it for requests) - You may test your generated signature using LinkedIn's OAuth test console -- leave the member token/secret blank.
- Twitter has great instructions on generating signatures with OAuth 1.0a, but remember tokens are not used with this implementation.
- Note that the request body is not signed as per the OAuth spec, see Google's OAuth 1.0 extension for details on why.
- If including parameters in your request, it saves a lot of trouble if you can order your query string items alphabetically.
Pagination
Requests that return multiple items will be paginated to 20 items by default. You can specify further pages with the ?page
parameter:
GET /emails?page=2
Page number is 1-based and ommiting the ?page parameter will return the first page.
The total number of resources and pages are always included in the X-FUE-Total
and X-FUE-TotalPages
HTTP headers.
Emails
This section lists all API that can be used to create, edit or otherwise manipulate emails.
Email Properties
Attribute | Type | Description |
---|---|---|
type |
string | The type of email - one of storewide , signup , manual , customer , or twitter see Email Types |
template |
string | The FUE template to use. WooCommerce by default |
name |
string | The name to use for this email |
subject |
string | The subject line for the email |
message |
string | The message/text of the email |
status |
string | Email status. One of active , inactive , or archive |
trigger |
string | What triggers the email. See which triggers are available for each email type here |
interval |
int | Decimal that is used together with the duration to define the sending schedule |
duration |
string | Possible values are minutes , hours , days , weeks , months , years , and date |
always_send |
bool | Only available for email types of storewide . Passing true will disregard the priority and send all emails that match the event's parameters |
tracking_code |
string | URL tracking code. See this tool to get the URL for Google Analytics |
send_date |
string | Used when the interval is 'date', in ISO 8601 format |
product_id |
int | The email will only be triggered if the purchased product matches this setting. Parameter available for email types of storewide , reminder , subscription , wootickets |
category_id |
int | Similar in nature to product_id but only available to storewide emails |
campaign |
string | The campaign(s) this email belongs to. Campaign will be created if it doesn't exist. Separate with comma if passing multiple campaigns. |
requirements |
string | Set additional requirements that allows for a more controlled email sending. See Requirements |
Email Types
Retrieve the types of emails available.
HTTP Request
/fue-api/v1/emails/types
curl -X GET https://yourwoosite.com/fue-api/v1/emails/types \
-u consumer_key:consumer_secret
JSON response example:
{
"storewide": {
"id": "storewide",
"priority": 9,
"label": "Storewide Emails",
"singular_label": "Storewide Email",
"triggers": {
"first_purchase": "after first purchase",
"cart": "after added to cart",
"product_purchase_above_one": "after customer purchased more than one time",
"downloadable_file_added": "after downloadable file added",
"downloaded": "after file downloaded",
"not_downloaded": "file not yet downloaded",
"coupon": "after Coupon used",
"pending": "after Order Status: pending",
"processing": "after Order Status: processing",
"on-hold": "after Order Status: on-hold",
"completed": "after Order Status: completed",
"cancelled": "after Order Status: cancelled",
"refunded": "after Order Status: refunded",
"failed": "after Order Status: failed",
"refund_manual": "after refunded manually",
"refund_successful": "after refunded successfully",
"refund_failed": "after refund failed"
},
"conditions": null,
"durations": {
"minutes": [
"minute",
"minutes"
],
"hours": [
"hour",
"hours"
],
"days": [
"day",
"days"
],
"weeks": [
"week",
"weeks"
],
"months": [
"month",
"months"
],
"years": [
"year",
"years"
]
},
"short_description": "Create your emails for all, or specific, products or categories as well as abandoned carts.",
"long_description": "Create your emails for all, or specific, products or categories as well as abandoned carts.",
"supports": [
"conditions"
],
"list_template": "/opt/plugins/woocommerce-follow-up-emails/templates/email-list/storewide-list.php"
},
"signup": {
"id": "signup",
"priority": 10,
"label": "Signup Emails",
"singular_label": "Signup Email",
"triggers": {
"signup": "after user signs up",
"list_signup": "after user signs up to a list"
},
"conditions": null,
"durations": {
"minutes": [
"minute",
"minutes"
],
"hours": [
"hour",
"hours"
],
"days": [
"day",
"days"
],
"weeks": [
"week",
"weeks"
],
"months": [
"month",
"months"
],
"years": [
"year",
"years"
]
},
"short_description": "Create emails to send when a user creates an account in your store, or signs up for a list.",
"long_description": "Create emails to send when a user creates an account in your store, or signs up for a list.",
"supports": [
"conditions"
]
},
"manual": {
"id": "manual",
"priority": 10,
"label": "Manual Emails",
"singular_label": "Manual Email",
"triggers": [],
"conditions": null,
"durations": [],
"short_description": "Create manual emails to have templates, and create newsletters, for ad-hoc emails to customers and prospects.",
"long_description": "Create manual emails to have templates, and create newsletters, for ad-hoc emails to customers and prospects.",
"list_template": "/opt/plugins/woocommerce-follow-up-emails/templates/email-list/manual-list.php",
"supports": []
},
"customer": {
"id": "customer",
"priority": 10,
"label": "Customer Emails",
"singular_label": "Customer Email",
"triggers": {
"after_last_purchase": "after last purchase",
"order_total_above": "after order total is above",
"order_total_below": "after order total is below",
"purchase_above_one": "after customer purchased more than one time",
"total_orders": "after total orders by customer",
"total_purchases": "after total purchase amount by customer"
},
"conditions": null,
"durations": {
"minutes": [
"minute",
"minutes"
],
"hours": [
"hour",
"hours"
],
"days": [
"day",
"days"
],
"weeks": [
"week",
"weeks"
],
"months": [
"month",
"months"
],
"years": [
"year",
"years"
]
},
"short_description": "Engage your customers by following up with emails specifically related to customer lifetime value metrics.",
"long_description": "Engage your customers by following up with emails specifically related to customer lifetime value metrics.",
"list_template": "/opt/plugins/woocommerce-follow-up-emails/templates/email-list/storewide-list.php"
},
"twitter": {
"id": "twitter",
"priority": 10,
"label": "Twitter Messages",
"singular_label": "Twitter Message",
"triggers": {
"first_purchase": "after first purchase",
"cart": "after added to cart",
"product_purchase_above_one": "after customer purchased more than one time",
"downloadable_file_added": "after downloadable file added",
"downloaded": "after file downloaded",
"not_downloaded": "file not yet downloaded",
"coupon": "after Coupon used",
"pending": "after Order Status: pending",
"processing": "after Order Status: processing",
"on-hold": "after Order Status: on-hold",
"completed": "after Order Status: completed",
"cancelled": "after Order Status: cancelled",
"refunded": "after Order Status: refunded",
"failed": "after Order Status: failed",
"refund_manual": "after refunded manually",
"refund_successful": "after refunded successfully",
"refund_failed": "after refund failed"
},
"conditions": null,
"durations": {
"minutes": [
"minute",
"minutes"
],
"hours": [
"hour",
"hours"
],
"days": [
"day",
"days"
],
"weeks": [
"week",
"weeks"
],
"months": [
"month",
"months"
],
"years": [
"year",
"years"
]
},
"short_description": "Collect @twitter usernames from your customers and create followups that tweet messages to your customers.",
"long_description": "Collect @twitter usernames from your customers and create followups that tweet messages to your customers.",
"list_template": "/opt/plugins/woocommerce-follow-up-emails/templates/email-list/twitter-list.php"
}
}
Create a New Follow-Up Email
This API helps you to create a new Follow-up Email.
HTTP request
/fue-api/v1/emails
curl -X POST https://yourwoosite.com/fue-api/v1/emails \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"type": "storewide",
"template": "woocommercee",
"name": "My Test API Email",
"subject": "My Test Subject Line",
"message": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
"status": "active",
"trigger": "refunded",
"interval": 1,
"duration": "minutes",
"always_send": false,
"tracking_code": "http://www.yourwoosite.com/?utm_source=adsite&utm_campaign=adcampaign&utm_term=adkeyword",
"product_id": 99,
"campaign": "My FUE campaign"
}'
JSON response example:
{
"email": {
"id": 8339,
"created_at": "2017-11-02 14:27:45",
"type": "storewide",
"template": "woocommercee",
"name": "My Test API Email",
"subject": "My Test Subject Line",
"message": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
"status": "active",
"trigger": "first_purchase",
"trigger_string": "1 minutes after first purchase",
"interval": "1",
"duration": "minutes",
"always_send": "0",
"product_id": "99",
"category_id": "",
"campaigns": [
"my-fue-campaign"
],
"requirements": []
}
}
Update Email
Updates an existing email using the same parameters for creating new emails.
HTTP request
/fue-api/v1/emails/<id>
curl -X POST https://yourwoosite.com/fue-api/v1/emails/8388 \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"type": "storewide",
"template": "woocommercee",
"name": "My Test API Email with edited name goodness",
"subject": "My Test Subject Line",
"message": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
"status": "active",
"trigger": "refunded",
"interval": 1,
"duration": "minutes",
"always_send": false,
"tracking_code": "http://www.yourwoosite.com/?utm_source=adsite&utm_campaign=adcampaign&utm_term=adkeyword",
"product_id": 99,
"campaign": "My FUE campaign"
}'
JSON response example:
{
"email": {
"id": 8388,
"created_at": "2017-11-13 13:24:48",
"type": "storewide",
"template": "woocommercee",
"name": "My Test API Email with edited name goodness",
"subject": "My Test Subject Line",
"message": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
"status": "active",
"trigger": "first_purchase",
"trigger_string": "1 minutes after first purchase",
"interval": "1",
"duration": "minutes",
"always_send": "0",
"product_id": "99",
"category_id": "",
"campaigns": [
"my-fue-campaign"
],
"requirements": []
}
}
List Emails
Returns a list of emails
Filters
Filters
Filter | Description |
---|---|
type | The email type (e.g. storewide ) |
status | Email status. active , inactive or archived |
campaign | Only show emails under the given campaign |
limit | The number of results to return per page |
GET /emails?filter[type]=signup&filter[status]=active&filter[limit]=10
HTTP Request
/fue-api/v1/emails
curl -X GET https://yourwoosite.com/fue-api/v1/emails \
-u consumer_key:consumer_secret
JSON response example:
[
{
"email": {
"id": 8388,
"created_at": "2017-11-13 13:24:48",
"type": "storewide",
"template": "woocommercee",
"name": "My Test API Email with edited name goodness",
"subject": "My Test Subject Line",
"message": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
"status": "active",
"trigger": "first_purchase",
"trigger_string": "1 minutes after first purchase",
"interval": "1",
"duration": "minutes",
"always_send": "0",
"product_id": "99",
"category_id": "",
"campaigns": [
"my-fue-campaign"
],
"requirements": []
}
}
]
Retrieve an Email
Returns an email
object.
HTTP Request
/fue-api/v1/emails/<id>
curl -X GET https://yourwoosite.com/fue-api/v1/emails/8388 \
-u consumer_key:consumer_secret
JSON response example:
[
{
"email": {
"id": 8388,
"created_at": "2017-11-13 13:24:48",
"type": "storewide",
"template": "woocommercee",
"name": "My Test API Email with edited name goodness",
"subject": "My Test Subject Line",
"message": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
"status": "active",
"trigger": "first_purchase",
"trigger_string": "1 minutes after first purchase",
"interval": "1",
"duration": "minutes",
"always_send": "0",
"product_id": "99",
"category_id": "",
"campaigns": [
"my-fue-campaign"
],
"requirements": []
}
}
]
Send a Manual Email
Sends a manual
email.
Parameters
Param | Descriptions |
---|---|
send_type | email or subscribers are supported by default. |
recipient_email | Email address of the recipient if send_type is email |
email_list | The list to send to the email to if send_type is subscribers . Passing an empty value will send to all subscribers. |
schedule_email | 1 to enable scheduling. Defaults to 0 |
sending_schedule_date | Required if schedule_email is enabled. RFC3339 date/time format |
send_again | 1 to send the same email again after a certain period of time. Defaults to 0 |
interval | Integer used in scheduling the second email |
interval_duration | Valid values are minutes , hours , days , weeks , months or years |
tracking | Google Analytics tracking code that will be appended to URLs in the email |
HTTP Request
/fue-api/v1/emails/send/<id>
curl -X POST https://yourwoosite.com/fue-api/v1/emails/send/8390 \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"send_type": "email",
"recipient_email": "dev-email@flywheel.local",
"tracking": false
}'
JSON response example:
[
{
"item": {
"id": "21",
"user_id": "0",
"user_email": "dev-email@flywheel.local",
"order_id": "0",
"product_id": "0",
"email_id": "8390",
"email": {
"email": {
"id": 8390,
"created_at": "2017-11-13 14:01:32",
"type": "manual",
"template": "WooCommerce",
"name": "manual email test",
"subject": "this is a test",
"message": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
"status": "active",
"trigger": "date",
"trigger_string": "Manual Email",
"interval": "1",
"duration": "0",
"always_send": "1",
"product_id": "0",
"category_id": "0",
"campaigns": [],
"requirements": []
}
},
"date_scheduled": "2017-11-13T14:08:15Z",
"is_cart": "0",
"is_sent": "0",
"date_sent": "-0001-11-30T05:14:00Z",
"email_trigger": "Manual Email",
"meta": {
"recipient_key": "0|dev-email@flywheel.local|",
"recipient": [
0,
"dev-email@flywheel.local",
""
],
"user_id": 0,
"email_address": "dev-email@flywheel.local",
"user_name": "",
"subject": "this is a test",
"message": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
"codes": [],
"notes": [
{
"date": "2017-11-13 14:08:15",
"message": "The email \"manual email test\" has been added to the queue (Queue ID #21)"
}
]
}
}
}
]
Email Templates
List Templates
Lists the email templates.
HTTP Request
/fue-api/v1/emails/templates
curl -X GET https://yourwoosite.com/fue-api/v1/emails/templates \
-u consumer_key:consumer_secret
JSON response example:
[{
"template": {
"id": "fue-responsive-one-column.html",
"name": "Responsive 1 Column",
"sections": [
"teaser",
"image_600px-wide",
"title",
"subtitle",
"body_one",
"title_two",
"subtitle_two",
"body_two",
"address"
]
}
}, {
"template": {
"id": "fue-responsive-three-column-hero.html",
"name": "Responsive 3 Columns with Hero",
"sections": [
"teaser",
"heroImage_600x100",
"mainTitle",
"mainContent",
"productOneImageURL",
"productOne",
"productOneContent",
"productTwoImageURL",
"productTwo",
"productTwoContent",
"productThreeImageURL",
"productThree",
"productThreeContent",
"businessName",
"businessAddress",
"unsubscribe"
]
}
}, {
"template": {
"id": "fue-responsive-two-sub-columns.html",
"name": "Responsive 2 Columns",
"sections": [
"teaser",
"image_600px-wide",
"title",
"subtitle",
"body_one",
"left-image_260px-wide",
"subtitle_left",
"left_content",
"right-image_260px-wide",
"subtitle_right",
"right_content",
"title",
"subtitle",
"body_one",
"title_two</h2>\n <h4>{section:subtitle_two",
"body_two"
]
}
}, {
"template": {
"id": "WooCommerce",
"name": null,
"sections": []
}
}]
Campaigns
List Campaigns
Returns a list of campaign
s
/fue-api/v1/campaigns
curl -X GET https://yourwoosite.com/fue-api/v1/campaigns \
-u consumer_key:consumer_secret
JSON response example:
[{
"campaign": {
"id": "api",
"name": "API"
}
}, {
"campaign": {
"id": "intro",
"name": "Intro"
}
}]
List All Emails in a Campaign
Returns a list of email
s
HTTP Request
/fue-api/v1/campaigns/<id>
curl -X GET https://yourwoosite.com/fue-api/v1/campaigns \
-u consumer_key:consumer_secret
JSON response example:
{
"email":
{
"id": 3455,
"created_at": "2015-01-15 07:13:04",
"type": "storewide",
"template": "WooCommerce",
"name": "Your Order - {store_name}",
"subject": "Order Complete",
"message": "{section:header}Hello {customer_name}!{/section}",
"status": "archived",
"trigger": "completed",
"trigger_string": "10 minutes after Order Status: completed",
"interval": "10",
"duration": "minutes",
"always_send": "0",
"product_id": "0",
"category_id": "0",
"campaigns":
[
"order-flow"
]
}
},
...
]
```
Newsletter
List Newsletter Lists
Returns all available newsletter lists
HTTP request
/fue-api/v1/newsletter/lists
curl -X GET https://yourwoosite.com/fue-api/v1/newsletter/lists \
-u consumer_key:consumer_secret
JSON response example:
{
"lists":
[
"campaign2015",
"customers"
]
}
List Subscribers
Returns a list of subscriber
s. A filter is available to only return subscribers belonging to a particular list
.
HTTP request
/fue-api/v1/newsletter/subscribers?filter[list]=campaign2015
curl -X GET https://yourwoosite.com/fue-api/v1/newsletter/subscribers?filter[list]=campaign2015 \
-u consumer_key:consumer_secret
JSON response example:
[
{
"subscriber":
{
"id": "11",
"email": "jdoe@yourwoosite.com",
"date_added": "2015-04-09 09:38:57",
"email_list": "campaign2015"
}
},
...
]
Add New Subscribers
Adds an email address and optionally to a mailing list or lists
Key | Type | Description |
---|---|---|
string | The email address to add. Separate emails using a comma to add multiple emails at once | |
list | integer (list id) or string (list name) or array of list ids or list names | Optional. The list to add the email address(es) to. |
HTTP request
/fue-api/v1/newsletter/subscribers
curl -X POST https://yourwoosite.com/fue-api/v1/emails \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"email": "test@yourwoosite.com",
"list": [2,3]
}'
JSON response example:
{
"subscribers": [
{
"id": "6",
"email": "test@yourwoosite.com",
"date_added": "2017-11-22 09:32:32",
"lists": [
{
"id": "3",
"name": "Marketing list"
},
{
"id": "2",
"name": "My List"
}
]
}
]
}
Edit a Subscriber
Key | Type | Description |
---|---|---|
string | Optional. Change the email address of the subscriber. | |
lists | integer (list id) or string (list name) or array or list ids or list names | Optional. Assign subscriber to the given lists. Separate with comma if using multiple lists. Pass an empty value to remove from all lists. |
HTTP request
/fue-api/v1/newsletter/subscribers/<id>
curl -X POST https://yourwoosite.com/fue-api/v1/newsletter/subscribers/6 \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"email": "edited@yourwoosite.com",
"list": [2,3]
}'
JSON response example:
{
"subscriber": {
"id": "6",
"email": "edited@yourwoosite.com",
"first_name": "",
"last_name": "",
"date_added": "2017-11-22 09:32:32",
"lists": [{
"id": "3",
"name": "Marketing List"
}, {
"id": "2",
"name": "My List"
}]
}
}
Delete Subscribers
Deletes a subscriber.
HTTP Request
/fue-api/v1/newsletter/subscribers/<id>
curl -X DELETE https://yourwoosite.com/fue-api/v1/newsletter/subscribers/6 \
-u consumer_key:consumer_secret
JSON response example:
{
"ack": "OK"
}
Queue
List Queue
Returns a list of items in the Queue.
Filters
Filter | Description |
---|---|
user_id | Return items matching a user's ID |
user_email | Match the recipient's email address |
order_id | WooCommerce Order ID that triggered the email |
product_id | WooCommerce Product ID that triggered the email |
Return item's linked email object |
|
cart | Boolean. Pass true to retrieve cart emails |
sent | Boolean. Pass true to retrieve sent items |
status | 0 : Suspended; 1 : Active |
date_sent_from | RFC3339 date/time format in UTC timezone |
date_sent_to | RFC3339 date/time format in UTC timezone |
date_scheduled_from | RFC3339 date/time format in UTC timezone |
date_scheduled_to | RFC3339 date/time format in UTC timezone |
limit | Limit the number of results per page |
HTTP Request
/fue-api/v1/queue
curl -X GET https://yourwoosite.com/fue-api/v1/queue \
-u consumer_key:consumer_secret
JSON response example:
[{
"item": {
"id": "22",
"user_id": "0",
"user_email": "email_recipient@yourwoosite.com",
"order_id": "0",
"product_id": "0",
"email_id": "0",
"email": null,
"date_scheduled": "2017-11-14T06:00:00Z",
"is_cart": "0",
"is_sent": "0",
"date_sent": "-0001-11-30T05:14:00Z",
"email_trigger": "Daily summary",
"meta": {
"daily_summary": true,
"email": "email_recipient@yourwoosite.com",
"subject": "Follow-up emails summary",
"message": "",
"notes": [{
"date": "2017-11-14 07:20:31",
"message": "Email has been added to the queue (Queue ID #22)"
}, {
"date": "2017-11-14 07:20:31",
"message": "Email is scheduled to be sent on 2017-11-14 06:00:00"
}, {
"date": "2017-11-14 07:22:10",
"message": "Skipped sending because there was no message to be sent"
}]
}
}
}, {
"item": {
"id": "23",
"user_id": "0",
"user_email": "email_recipient@yourwoosite.com",
"order_id": "0",
"product_id": "0",
"email_id": "0",
"email": null,
"date_scheduled": "2017-11-15T06:00:00Z",
"is_cart": "0",
"is_sent": "0",
"date_sent": "-0001-11-30T05:14:00Z",
"email_trigger": "Daily summary",
"meta": {
"daily_summary": true,
"email": "email_recipient@yourwoosite.com",
"subject": "Follow-up emails summary",
"message": "",
"notes": [{
"date": "2017-11-14 07:22:10",
"message": "Email has been added to the queue (Queue ID #23)"
}, {
"date": "2017-11-14 07:22:10",
"message": "Email is scheduled to be sent on 2017-11-15 06:00:00"
}, {
"date": "2017-11-15 06:00:43",
"message": "Skipped sending because there was no message to be sent"
}]
}
}
}, {
"item": {
"id": "24",
"user_id": "0",
"user_email": "email_recipient@yourwoosite.com",
"order_id": "0",
"product_id": "0",
"email_id": "0",
"email": null,
"date_scheduled": "2017-11-15T06:00:00Z",
"is_cart": "0",
"is_sent": "0",
"date_sent": "-0001-11-30T05:14:00Z",
"email_trigger": "Daily summary",
"meta": {
"daily_summary": true,
"email": "email_recipient@yourwoosite.com",
"subject": "Follow-up emails summary",
"message": "",
"notes": [{
"date": "2017-11-15 06:00:43",
"message": "Email has been added to the queue (Queue ID #24)"
}, {
"date": "2017-11-15 06:00:43",
"message": "Email is scheduled to be sent on 2017-11-15 06:00:00"
}, {
"date": "2017-11-15 06:10:16",
"message": "Skipped sending because there was no message to be sent"
}]
}
}
}, {
"item": {
"id": "27",
"user_id": "0",
"user_email": "email_recipient@yourwoosite.com",
"order_id": "0",
"product_id": "0",
"email_id": "0",
"email": null,
"date_scheduled": "2017-11-16T06:00:00Z",
"is_cart": "0",
"is_sent": "0",
"date_sent": "-0001-11-30T05:14:00Z",
"email_trigger": "Daily summary",
"meta": {
"daily_summary": true,
"email": "email_recipient@yourwoosite.com",
"subject": "Follow-up emails summary",
"message": "",
"notes": [{
"date": "2017-11-16 07:17:14",
"message": "Email has been added to the queue (Queue ID #27)"
}, {
"date": "2017-11-16 07:17:14",
"message": "Email is scheduled to be sent on 2017-11-16 06:00:00"
}, {
"date": "2017-11-16 07:17:50",
"message": "Skipped sending because there was no message to be sent"
}]
}
}
}, {
"item": {
"id": "28",
"user_id": "0",
"user_email": "email_recipient@yourwoosite.com",
"order_id": "0",
"product_id": "0",
"email_id": "0",
"email": null,
"date_scheduled": "2017-11-17T06:00:00Z",
"is_cart": "0",
"is_sent": "0",
"date_sent": "-0001-11-30T05:14:00Z",
"email_trigger": "Daily summary",
"meta": {
"daily_summary": true,
"email": "email_recipient@yourwoosite.com",
"subject": "Follow-up emails summary",
"message": "",
"notes": [{
"date": "2017-11-16 07:17:50",
"message": "Email has been added to the queue (Queue ID #28)"
}, {
"date": "2017-11-16 07:17:50",
"message": "Email is scheduled to be sent on 2017-11-17 06:00:00"
}, {
"date": "2017-11-20 07:35:04",
"message": "Skipped sending because there was no message to be sent"
}]
}
}
}, {
"item": {
"id": "29",
"user_id": "0",
"user_email": "email_recipient@yourwoosite.com",
"order_id": "0",
"product_id": "0",
"email_id": "0",
"email": null,
"date_scheduled": "2017-11-17T06:00:00Z",
"is_cart": "0",
"is_sent": "0",
"date_sent": "-0001-11-30T05:14:00Z",
"email_trigger": "Daily summary",
"meta": {
"daily_summary": true,
"email": "email_recipient@yourwoosite.com",
"subject": "Follow-up emails summary",
"message": "",
"notes": [{
"date": "2017-11-20 07:35:04",
"message": "Email has been added to the queue (Queue ID #29)"
}, {
"date": "2017-11-20 07:35:04",
"message": "Email is scheduled to be sent on 2017-11-17 06:00:00"
}, {
"date": "2017-11-20 07:36:33",
"message": "Skipped sending because there was no message to be sent"
}]
}
}
}, {
"item": {
"id": "30",
"user_id": "0",
"user_email": "email_recipient@yourwoosite.com",
"order_id": "0",
"product_id": "0",
"email_id": "0",
"email": null,
"date_scheduled": "2017-11-21T06:00:00Z",
"is_cart": "0",
"is_sent": "0",
"date_sent": "-0001-11-30T05:14:00Z",
"email_trigger": "Daily summary",
"meta": {
"daily_summary": true,
"email": "email_recipient@yourwoosite.com",
"subject": "Follow-up emails summary",
"message": "",
"notes": [{
"date": "2017-11-20 07:36:33",
"message": "Email has been added to the queue (Queue ID #30)"
}, {
"date": "2017-11-20 07:36:33",
"message": "Email is scheduled to be sent on 2017-11-21 06:00:00"
}, {
"date": "2017-11-21 06:00:16",
"message": "Skipped sending because there was no message to be sent"
}]
}
}
}, {
"item": {
"id": "31",
"user_id": "0",
"user_email": "email_recipient@yourwoosite.com",
"order_id": "0",
"product_id": "0",
"email_id": "0",
"email": null,
"date_scheduled": "2017-11-21T06:00:00Z",
"is_cart": "0",
"is_sent": "0",
"date_sent": "-0001-11-30T05:14:00Z",
"email_trigger": "Daily summary",
"meta": {
"daily_summary": true,
"email": "email_recipient@yourwoosite.com",
"subject": "Follow-up emails summary",
"message": "",
"notes": [{
"date": "2017-11-21 06:00:16",
"message": "Email has been added to the queue (Queue ID #31)"
}, {
"date": "2017-11-21 06:00:16",
"message": "Email is scheduled to be sent on 2017-11-21 06:00:00"
}, {
"date": "2017-11-21 06:01:16",
"message": "Skipped sending because there was no message to be sent"
}]
}
}
}, {
"item": {
"id": "32",
"user_id": "0",
"user_email": "email_recipient@yourwoosite.com",
"order_id": "0",
"product_id": "0",
"email_id": "0",
"email": null,
"date_scheduled": "2017-11-22T06:00:00Z",
"is_cart": "0",
"is_sent": "0",
"date_sent": "-0001-11-30T05:14:00Z",
"email_trigger": "Daily summary",
"meta": {
"daily_summary": true,
"email": "email_recipient@yourwoosite.com",
"subject": "Follow-up emails summary",
"message": "",
"notes": [{
"date": "2017-11-21 06:01:16",
"message": "Email has been added to the queue (Queue ID #32)"
}, {
"date": "2017-11-21 06:01:16",
"message": "Email is scheduled to be sent on 2017-11-22 06:00:00"
}, {
"date": "2017-11-22 07:14:17",
"message": "Skipped sending because there was no message to be sent"
}]
}
}
}, {
"item": {
"id": "33",
"user_id": "0",
"user_email": "email_recipient@yourwoosite.com",
"order_id": "0",
"product_id": "0",
"email_id": "0",
"email": null,
"date_scheduled": "2017-11-22T06:00:00Z",
"is_cart": "0",
"is_sent": "0",
"date_sent": "-0001-11-30T05:14:00Z",
"email_trigger": "Daily summary",
"meta": {
"daily_summary": true,
"email": "email_recipient@yourwoosite.com",
"subject": "Follow-up emails summary",
"message": "",
"notes": [{
"date": "2017-11-22 07:14:17",
"message": "Email has been added to the queue (Queue ID #33)"
}, {
"date": "2017-11-22 07:14:17",
"message": "Email is scheduled to be sent on 2017-11-22 06:00:00"
}, {
"date": "2017-11-22 07:14:50",
"message": "Skipped sending because there was no message to be sent"
}]
}
}
}]
Get a Specific Queue Item
HTTP Request
/fue-api/v1/queue/<item_id>
curl -X GET https://yourwoosite.com/fue-api/v1/queue/33 \
-u consumer_key:consumer_secret
JSON response example:
{
"item": {
"id": "33",
"user_id": "0",
"user_email": "email_recipient@yourwoosite.com",
"order_id": "0",
"product_id": "0",
"email_id": "0",
"email": null,
"date_scheduled": "2017-11-22T06:00:00Z",
"is_cart": "0",
"is_sent": "0",
"date_sent": "-0001-11-30T05:14:00Z",
"email_trigger": "Daily summary",
"meta": {
"daily_summary": true,
"email": "email_recipient@yourwoosite.com",
"subject": "Follow-up emails summary",
"message": "",
"notes": [{
"date": "2017-11-22 07:14:17",
"message": "Email has been added to the queue (Queue ID #33)"
}, {
"date": "2017-11-22 07:14:17",
"message": "Email is scheduled to be sent on 2017-11-22 06:00:00"
}, {
"date": "2017-11-22 07:14:50",
"message": "Skipped sending because there was no message to be sent"
}]
}
}
}
Create a Queue Item
Parameters
Parameter | Description |
---|---|
email_id | Email ID linked to the queue item |
user_id | User ID of the customer. 0 for guests |
user_email | Email address of the recipient |
order_id | WooCommerce Order ID |
product_id | WooCommerce Product ID |
send_date | Scheduled send date in UTC |
is_cart | Flag for add_to_cart emails. 1 for cart emails, 0 otherwise. |
is_sent | Flag for sent emails. 1 if email has been sent. |
meta | An array of metadata. Values depend on the email type and trigger |
status | 0 for suspended and 1 for active |
HTTP Request
/fue-api/v1/queue
curl -X POST https://yourwoosite.com/fue-api/v1/emails \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"email_id": "8344",
"user_id": "0",
"user_email": "email_recipient@yourwoosite.com",
"order_id": "0",
"product_id": "0",
"send_date": "2017-11-22T06:00:00Z",
"is_cart": "0",
"is_sent": "0",
"meta": {}
}'
JSON response example:
{
"item": {
"id": "62",
"user_id": "0",
"user_email": "email_recipient@yourwoosite.com",
"order_id": "0",
"product_id": "0",
"email_id": "8344",
"email": {
"email": {
"id": 8344,
"created_at": "2017-11-03 07:32:15",
"type": "storewide",
"template": "woocommercee",
"name": "My Test API Email",
"subject": "My Test Subject Line",
"message": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
"status": "active",
"trigger": "first_purchase",
"trigger_string": "0 after first purchase",
"interval": "",
"duration": "",
"always_send": "0",
"product_id": "99",
"category_id": "",
"campaigns": [
"my-fue-campaign"
],
"requirements": []
}
},
"date_scheduled": "2017-11-22T06:00:00Z",
"is_cart": "0",
"is_sent": "0",
"date_sent": "2017-12-12T16:29:37Z",
"email_trigger": "",
"meta": []
}
}
Edit a Queue Item
Parameters
Parameter | Description |
---|---|
email_id | Email ID linked to the queue item |
user_id | User ID of the customer. 0 for guests |
user_email | Email address of the recipient |
order_id | WooCommerce Order ID |
product_id | WooCommerce Product ID |
send_date | Scheduled send date in UTC |
is_cart | Flag for add_to_cart emails. 1 for cart emails, 0 otherwise. |
is_sent | Flag for sent emails. 1 if email has been sent. |
meta | An array of metadata. Values depend on the email type and trigger |
status | 0 for suspended and 1 for active |
HTTP Request
/fue-api/v1/queue/<item_id>
curl -X POST https://yourwoosite.com/fue-api/v1/queue/62; \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"send_date": "2017-12-22T06:00:00Z"
}'
JSON response example:
{
"item": {
"id": "62",
"user_id": "0",
"user_email": "email_recipient@yourwoosite.com",
"order_id": "0",
"product_id": "0",
"email_id": "8344",
"email": {
"email": {
"id": 8344,
"created_at": "2017-11-03 07:32:15",
"type": "storewide",
"template": "woocommercee",
"name": "My Test API Email",
"subject": "My Test Subject Line",
"message": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
"status": "active",
"trigger": "first_purchase",
"trigger_string": "0 after first purchase",
"interval": "",
"duration": "",
"always_send": "0",
"product_id": "99",
"category_id": "",
"campaigns": [
"my-fue-campaign"
],
"requirements": []
}
},
"date_scheduled": "2017-12-22T06:00:00Z",
"is_cart": "0",
"is_sent": "0",
"date_sent": "2017-12-12T16:29:37Z",
"email_trigger": "",
"meta": []
}
}
Delete a Queue Item
Deletes an item from the queue.
HTTP Request
/fue-api/v1/queue/<item_id>
curl -X DELETE https://yourwoosite.com/fue-api/v1/queue/62 \
-u consumer_key:consumer_secret
JSON response example:
{
"message": "Deleted queue item"
}
Reports
List Available Reports
Lists the available reports.
HTTP Request
/fue-api/v1/reports
curl -X GET https://yourwoosite.com/fue-api/v1/reports \
-u consumer_key:consumer_secret
JSON response example:
{
"reports": [
"emails",
"emails/clicks",
"emails/opens",
"emails/ctor",
"users",
"excludes"
]
}
Basic Email Reports
Retrieve a basic report of emails
Filters
Filter | Description |
---|---|
limit | Limit the number of results per page |
HTTP Request
/fue-api/v1/reports/emails?filter[limit]=25
curl -X GET https://yourwoosite.com/fue-api/v1/reports/emails?filter[limit]=25 \
-u consumer_key:consumer_secret
JSON response example:
{
"emails": [{
"email": "Processing",
"email_trigger": "1 minute after Order Status: processing",
"num_sent": "6",
"num_opens": "0",
"num_clicks": "0"
}, {
"email": "Marketing Upsell",
"email_trigger": "1 minute after Order Status: processing",
"num_sent": "3",
"num_opens": "0",
"num_clicks": "0"
}, {
"email": "Sports Only",
"email_trigger": "1 minute After Booking Status: confirmed",
"num_sent": "4",
"num_opens": "0",
"num_clicks": "0"
}
...
]
}
Get Link Click Details
Filters
Filter | Description |
---|---|
limit | Limit the number of results per page |
HTTP Request
/fue-api/v1/reports/emails/clicks?filter[limit]=25
curl -X GET https://yourwoosite.com/fue-api/v1/reports/emails/clicks?filter[limit]=25 \
-u consumer_key:consumer_secret
JSON response example:
{
"clicks": [{
"queue_id": "485",
"email_id": "1377",
"user_id": "0",
"email": "email_recipient@yourwoosite.com",
"target_url": "https://yourwoosite.com",
"date_added": "2015-01-21 14:30:41"
}, {
"queue_id": "470",
"email_id": "697",
"user_id": "27",
"email": "email_recipient@yourwoosite.com",
"target_url": "https://yourwoosite.com/my-account",
"date_added": "2015-01-20 11:44:54"
}
...
]
}
Get Email Open Details
Lists details of opened emails
Filters
Filter | Description |
---|---|
limit | Limit the number of results per page |
HTTP Request
/fue-api/v1/reports/emails/opens
curl -X GET https://yourwoosite.com/fue-api/v1/reports/emails/opens?filter[limit]=25 \
-u consumer_key:consumer_secret
JSON response example:
{
"opens": [{
"queue_id": "485",
"email_id": "1377",
"user_id": "0",
"email": "email_recipient@yourwoosite.com",
"date_added": "2015-01-21 14:30:41"
}, {
"queue_id": "470",
"email_id": "697",
"user_id": "27",
"email": "email_recipient@yourwoosite.com",
"date_added": "2015-01-20 11:44:54"
}
...
]
}
Get Top Click to Open Rate (CTOR) Emails
Returns a CTOR object
HTTP Request
/fue-api/v1/reports/emails/ctor
curl -X GET https://yourwoosite.com/fue-api/v1/reports/emails/ctor \
-u consumer_key:consumer_secret
JSON response example:
{
"ctor": [{
"email_id": "311",
"clicks": "50",
"opens": "211",
"ctor": "23.7"
}, {
"email_id": "330",
"clicks": "27",
"opens": "121",
"ctor": "22.3"
}
...
]
}
User Reports
User reporting
Filters
Filter | Description |
---|---|
limit | Limit the results returned per page |
HTTP Request
/fue-api/v1/reports/users?filter[limit]=15
curl -X GET https://yourwoosite.com/fue-api/v1/reports/users?filter[limit]=15 \
-u consumer_key:consumer_secret
JSON response example:
{
"users": [{
"id": 1,
"name": "John Test",
"sent": 63,
"opens": 0,
"clicks": 0
}, {
"id": 27,
"name": "test-wp-user",
"sent": 1,
"opens": 1,
"clicks": 0
}, {
"id": 0,
"name": "Miley West",
"sent": 4,
"opens": 2,
"clicks": 1
}
...
]
}
List Opt-Outs
Filters
Filter | Description |
---|---|
limit | Limit the results returned per page |
HTTP Request
/fue-api/v1/reports/excludes?filter[limit]=15
curl -X GET https://yourwoosite.com/fue-api/v1/reports/excludes?filter[limit]=15 \
-u consumer_key:consumer_secret
JSON response example:
{
"optouts": [{
"email_name": "Marketing Campaign A",
"email_address": "jd@mail.com",
"date": "2015-01-02T03:21:46Z"
}]
}
Trigger Requirements
Requirement Types
Identifier | Email Type | Description |
---|---|---|
bought_products | storewide | Restrict email to customers who have bought any of the specified product IDs |
bought_categories | storewide | Similar to bought_products except that the check is made against the category IDs a customer had previously bought products from |
first_purchase | storewide | Email will match customers who are purchasing for the first time |
order_total_below | storewide | Match orders where the order total is below the specified value |
order_total_above | storewide | Match orders where the order total exceeds the specified value |
total_orders_below | storewide | Match customers whose number of orders is below the specified value |
total_orders_above | storewide | Match customers whose number of orders exceeds the specified value |
total_purchases_below | storewide | Match customers whose accumulated order total is below the specified value |
total_purchases_above | storewide | Match customers whose accumulated order total exceeds the specified value |
have_not_started_first_lesson | sensei | Match learners who are signed up to a course but have not started the first lesson. Specify a course by passing a course ID as the value. |
have_not_completed_a_lesson | sensei | Match learners who are signed up to a course but have not completed any lessons. Specify a course by passing a course ID as the value. |
have_not_completed_a_course | sensei | Match learners who are signup up but have not yet completed a course. Specify a course by passing a course ID as the value. |
have_not_taken_quiz | sensei | Match learners who have not yet taken a quiz. Specify a lesson by passing a lesson ID as the value. |
have_failed_quiz | sensei | Match learners who have failed a lesson quiz. Specify a lesson by passing a lesson ID as the value. |
have_passed_quiz | sensei | Match learners who have passed a lesson quiz. Specify a lesson by passing a lesson ID as the value. |