Skip to content

Instantly share code, notes, and snippets.

@jmertic
Created November 5, 2012 19:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmertic/4019840 to your computer and use it in GitHub Desktop.
Save jmertic/4019840 to your computer and use it in GitHub Desktop.
$parameters = array(
'session' => $sessionId,
'module' => 'Accounts',
'name_value_list' => array(
array('name' => 'id', 'value' => $accountId),
array('name' => 'deleted', 'value' => '1'),
),
);
$json = json_encode($parameters);
$postArgs = array(
'method' => 'set_entry',
'input_type' => 'JSON',
'response_type' => 'JSON',
'rest_data' => $json
);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postArgs);
// Make the REST call, returning the result
$response = curl_exec($curl);
if (!$response) {
die("Connection Failure.\n");
}
// Convert the result from JSON format to a PHP array
$result = json_decode($response);
if ( !is_object($result) ) {
die("Error handling result.\n");
}
if ( !isset($result->id) ) {
die("Error: {$result->name} - {$result->description}\n.");
}
echo "Account record deleted successfully!\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment