Přejít k obsahu  Přejít k hlavnímu menu

Blog / Knowledge base

Updated: 5. August 2020

Webhook

Data transfer from Mailocator via Webhook to third parties

Supported data formats

Data formats: filed name=value&..., XML, JSON and data aggregated into a POST variable data



Supported HTTP methods

Most formats can be combined with HTTP methods GET, POST or PUT



Basic structure of transmitted data

At least the following fields (variables) are returned in each request:
engine - contains "Mailocator"
time - contains unix timestamp of sending the request
email - contains a valid email address

Optionally, additional data from the popup form sent by the action can be added subscribe



Examples

Request with POST method and JSON format
Return data, result of PHP function call var_export($_POST,1)


array (
'{"engine":"Mailocator","time":1596634651,"email":"test@mlctr_com"}' => '',
)







Request with POST method and XML format
Return data, result of PHP function call var_export($_POST,1)


array ('<?xml version="1.0"?>
<contact>
    <engine>Mailocator</engine>
    <time>1596634651</time>
    <email>test@mlctr.com</email>
</contact>'



Request with POST method and XML format
Return data, result of PHP function call file_get_contents('php://input')


<?xml version="1.0"?>
<contact>
<engine>Mailocator</engine>
<time>1596634651</time>
<email>test@mlctr.com</email>
</contact>










Expected return codes from a third-party server:


1 - contact saved successfully, Mailocator will display a thank you note
0 - contact was not saved successfully, Mailocator displays information about the duplicate contact

If the content is different or empty, the processing process is interrupted by Mailocator, an error is written in the monitoring.

PHP example


After successfully processing the request on the server, just call echo '1';, the return value is interpreted as a correctly stored contact.

RELATED

Scenario in Mailocator

The Mailocator scenario is a key tool for setting up your campaigns to work properly. See everything and how easy it is to set up.

Discount codes

Mailocator allows you to pass discount and promotional codes to email campaigns

Discount codes obtained from the API in real time

In addition to code stacks, Mailocator allows you to read discount codes in real time from an external API, display them in a thank you page and pass them to an email tool.

Transfer of data from Mailocator to ESP

Sometimes it is useful to provide additional information from Mailocator, usually state, gender, favorite categories, discount code or name and surname. How to do it?

Preparation of the winning calendar (Advent calendar)

Mailocator contains pre-prepared templates for action calendars, which reveal to users the winnings for a specific day in exchange for an email address. You can easily prepare an Advent calendar with a discount or an event for each day.

Scratch card

A scratch card is a campaign in which the marketing content (discount, notification, coupon...) is covered by an image that can be wiped with the mouse cursor or a finger on the screen of the smart device. After deleting and revealing the content, you can automatically trigger an action, such as getting an email address.