Welcome to the Instapage Support Center

|

Retrive submitted data on external page after redirect

When form redirection is set up, Instapage will pass over the submission id in redirection url. This can be used to retrieve submission data from our api on the page that you have redirected to.

Minimal php code to get submission details:

<?php
 
class InstapageSubmission
{
public $token;
public $access_token;
public $url = 'https://app.instapage.com/api/1/submission/';
 
public function __construct( $token, $access_token )
{
$this->token = $token;
$this->access_token = $access_token;
}
 
public function get( $submission_id = 0 )
{
$ch = curl_init(); 
 
curl_setopt($ch, CURLOPT_URL, $this->url . $submission_id );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'TOKEN: '. $this->token,
'ACCESS: '. $this->access_token
));
$output = curl_exec($ch);
curl_close($ch);
 
return json_decode( $output );
}
}
 
//To get Token and Access Token go to http://app.instapage.com/account/create-api-token
$token = 'YOUR TOKEN';
$access_token = 'YOUR ACCESS TOKEN';
 
$submission = new InstapageSubmission( $token, $access_token );
 
$submission_data = $submission->get( (int) $_GET[ 'submission' ] );

?>
Have more questions? Submit a request
Was this article helpful?
4 out of 4 found this helpful

Need Further Help?

Tell us what you need and we will be happy to assist you.

Our team of expert support staff and our community can answer your questions. Submit a ticket, reach out on live chat or call us now!