Webhook
Data transfer from Mailocator via Webhook to third parties
Supported data formats
name=value&...
, XML, JSON and data aggregated into a POST variable data
Supported HTTP methods
Basic structure of transmitted data
engine
- contains "Mailocator"time
- contains unix timestamp of sending the requestemail
- contains a valid email addressOptionally, additional data from the popup form sent by the action can be added
subscribe
Examples
Return data, result of PHP function call
var_export($_POST,1)
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>'
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 note0
- contact was not saved successfully, Mailocator displays information about the duplicate contactIf 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.