Technical details
Endpoint specification (request)
The external endpoint shall be called using HTTP GET and optional querystring parameters. Basic Authentication and custom authorization headers are supported
The endpoints’ signature should support one of the formats shown in the table below. Other formats may be supported, please ask if you need more.
Template | Description | Example |
---|---|---|
MY_ENDPOINT_URL/EMAIL | query by email | https://personalization.mysite.com/product/john@example.com |
MY_ENDPOINT_URL/RECIPIENT_FIELD | query by a MailUp personal field, like firstname or ClientID | https://personalization.mysite.com/product/ID000111222 |
MY_ENDPOINT_URL/EMAIL?FIELD1=value,FIELD2=value | more query parameters can be used by specifying key-value pairs via querystring. The names of the allowed keys can be set on the MailUp web application or using the API described at the bottom of this page |
In additional to personal data fields, you may invoke the external endpoint by specifying also one or more of the following querystring parameters:
Parameter name | Description | Example |
---|---|---|
IdConsole | MailUp account ID | 59484 |
IdList | MailUp list ID | MailUp message ID |
groups | MailUp groups the recipient is matching in current mailing | 24,25,29 |
filters | MailUp filters the recipient is matching in current mailing | 10,21 |
Endpoint specification (response)
You are free to design the response structure that better suits your needs when it comes to use the returned fields into a MailUp message. The required format is JSON. You can design a flat structure or a more complex one, built with arrays or nested fields.
Your services must return HTTP 200 in case of success and 4xx or 5xx in case of errors. When an error repeatedly occurs while querying services for a recipient, MailUp does not send the email to that recipient.
For example, the endpoint https://serene-shore-87032.herokuapp.com/content/products/myemail@example.com returns a JSON object like the one on the left. As the provider of the external service, you are supposed to know well the returned JSON object (field names, nested structures...). Hence, you have all you need to create a message on MailUp where the tag names arereferenced using the Liquid markup language
Technical details
Endpoint specification (request)
The external endpoint shall be called using HTTP GET and optional querystring parameters. Basic Authentication and custom authorization headers are supported.
The endpoints’ signature should support one of the formats shown in the table below. Other formats may be supported, please ask if you need more.
Template | Description | Example |
---|---|---|
MY_ENDPOINT_URL/EMAIL | query by email | https://personalization.mysite.com/product/john@example.com |
MY_ENDPOINT_URL/RECIPIENT_FIELD | query by a MailUp personal field, like firstname or ClientID | https://personalization.mysite.com/product/ID000111222 |
MY_ENDPOINT_URL/EMAIL?FIELD1=value,FIELD2=value | more query parameters can be used by specifying key-value pairs via querystring. The names of the allowed keys can be set on the MailUp web application or using the API described at the bottom of this page |
In additional to personal data fields, you may invoke the external endpoint by specifying also one or more of the following querystring parameters:
Parameter name | Description | Example |
---|---|---|
IdConsole | MailUp account ID | 59484 |
IdList | MailUp list ID | MailUp message ID |
groups | MailUp groups the recipient is matching in current mailing | 24,25,29 |
filters | MailUp filters the recipient is matching in current mailing | 10,21 |
Your services must return HTTP 200 in case of success and 4xx or 5xx in case of errors. When an error repeatedly occurs while querying services for a recipient, MailUp does not send the email to that recipient.
Expand | ||
---|---|---|
| ||
For example, the endpoint https://serene-shore-87032.herokuapp.com/content/products/myemail@example.com returns a JSON object like the one on the left. As the provider of the external service, you are supposed to know well the returned JSON object (field names, nested structures...). Hence, you have all you need to create a message on MailUp where the tag names arereferenced using the Liquid markup language |
DoNotSend is a boolean parameter to be nested in a “Flow” object. Its default value is false, which means “send the message”. The use of HTTP errors like 4xx or 5xx to skip sending has a bad impact on overall performances, please use DoNotSend instead.
This is the right syntax to be used in the API response
Code Block |
---|
"Flow": {
"DoNotSend": true,
} |
Enable personalization at different levels
By default, the advanced personalization is set at message level. You have to turn it on and configure an endpoint for each message requiring it. In case of more available endpoints, you can decide which one has to be used for a specific message.
In some cases, you may find useful to have personalization enabled by default on all the messages of a MailUp list. By doing so, every message of the list has the personalization automatically enabled, at list level, on a predefined endpoint. You can use MailUp API or ask to MailUp support team if you want to set the personalization at list level.
Performance related best practices
- Avoid enabling the personalization to messages that do not require it. Querying an external endpoint may introduce delays
- Make sure your endpoint is robust, scalable and optimized to respond quickly
- Build your own logging system. MailUp does not inform you when the API calls fail due to errors on the external system
Setup advanced personalization using MailUp REST API
Get list of endpoints
Description | Retrieve the list of personalization endpoints configurations | |||||
---|---|---|---|---|---|---|
HTTP Method | GET | |||||
URL |
| |||||
JSON request (example) | none | |||||
JSON response (example) |
| |||||
Paging and filtering (example) | 5 items per page, get first page (count starts from zero)
Retrieve an orderd list of the endpoint(s) using the clause orderby="idEndpoint desc". Parameter names can be retreived from the response body. Please note that filter matching is case sensitive.
NB: no filtering querystring parameter provided! |
Get endpoint details by id
Description | Retrieve the personalization endpoint configuration details | |||||
---|---|---|---|---|---|---|
HTTP Method | GET | |||||
URL |
| |||||
JSON request (example) | none | |||||
JSON response (example) |
| |||||
Paging and filtering (example) | none |
Create an endpoint
Expand | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
|
Description | Create a personalization endpoint configuration | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
HTTP Method | POST | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
URL |
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
JSON request (example) |
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
JSON response (example) |
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Paging and filtering (example) | none |
Update an endpoint
Description | Update a personalization endpoint configuration | |||||
---|---|---|---|---|---|---|
HTTP Method | PUT | |||||
URL |
| |||||
JSON request (example) |
| |||||
JSON response (example) |
| |||||
Paging and filtering (example) | none |
Get endpoints of a list
Description | Get personalization endpoints related to a list | |||||
---|---|---|---|---|---|---|
HTTP Method | GET | |||||
URL |
| |||||
JSON request (example) | none | |||||
JSON response (example) |
| |||||
Paging and filtering (example) | none |
Set endpoint to list
Description | Set a personalization endpoint to a list | |||||
---|---|---|---|---|---|---|
HTTP Method | POST | |||||
URL |
| |||||
JSON request (example) | none | |||||
JSON response (example) | none | |||||
Paging and filtering (example) | none |
Remove endpoint from list
Description | Remove a personalization endpoint reference from a list | |||||
---|---|---|---|---|---|---|
HTTP Method | DELETE | |||||
URL |
| |||||
JSON request (example) | none | |||||
JSON response (example) | none | |||||
Paging and filtering (example) | none |
Delete an endpoint
Description | Remove a personalization endpoint configuration | |||||
---|---|---|---|---|---|---|
HTTP Method | DELETE | |||||
URL |
| |||||
JSON request (example) | none | |||||
JSON response (example) | none | |||||
Paging and filtering (example) | none |