Created
November 5, 2012 19:36
-
-
Save jmertic/4019840 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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