Skip to main content

PHP sample: get request for a specific action

When you have added a destination URL to your account where you want to receive the Kartra API's outbound pings, you will need a script to catch and interpret the data. Make sure it's written in a programming language that can catch the HTTP raw post request.

Here is a small PHP sample on how to get the raw post:

$postdata = file_get_contents("php://input"); 
    
    // the data comes as an json so you will need to decode it 
    $postdata_decoded = json_decode($postdata); 
    // after this you can use the info passed from kartra in your own scripts. 
    // Ex: $postdata_decoded-lead contains the lead details that triggered the action
?>
Did this answer your question?