How to Silently POST Submitted Data to Any API or URL

Published in Convert Forms
Updated 05 Nov, 2020
Heads up! This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.

Would you like to send the submitted data to an external API endpoint or a specific URL that is designed to retrieve them? This is quite useful if you want to automatically sync your submitted data with a 3rd-party service. The following PHP snippet will allow you to export each submission into a file.


To send your submissions to an API endpoint, copy the code shown below and place it into the PHP Scripts -> After Form Submission area of your form.

// Populate the data that will be sent
$data = [
	'first_name' => $submission->params['first_name'],
	'last_name'  => $submission->params['last_name'],
	'email' 	 => $submission->params['email']

// Set the URL that will retrieve the data
$url = '';

$response = JHttpFactory::getHttp()->post($url, $data);

// Do something if the data were sent successfully
if ($response->code == 200)
	// Your code..