All Collections
Code Samples
Update a Form with PHP
Update a Form with PHP

Learn how to update your forms' JSON using PHP

Brett Long avatar
Written by Brett Long
Updated over a week ago

Thanks to Navin for this code snippet.

Use it for updating an existing form's JSON from PHP.

$url = "https://app.devicemagic.com/organizations/XXXX/forms/XXXXX"; 
$curl = curl_init($url);
$headers=array('Authorization: Basic '. base64_encode('XXXXXX:YYYY'),'Content-Type: application/json'); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
Did this answer your question?