protected function AcquiaLiftAPI::makeDeleteRequest in Acquia Lift Connector 7.2
Makes an Acquia Authenticated DELETE request to an API endpoint.
Parameters
$path: The endpoint path.
$headers: Any headers that need to be added.
$success_msg: The error message to provide if the request fails.
$fail_msg: The error message to provide if the request fails.
Throws
1 call to AcquiaLiftAPI::makeDeleteRequest()
- AcquiaLiftAPI::deleteAgent in includes/
AcquiaLiftAPI.inc - Deletes the campaign with the specified name.
File
- includes/
AcquiaLiftAPI.inc, line 901
Class
Code
protected function makeDeleteRequest($url, $headers = array(), $success_msg, $fail_msg, $vars) {
$nonce = self::nonce();
$timestamp = time();
$this
->prepareRequest('DELETE', $url, $headers, "", $nonce, $timestamp);
$response = $this
->httpClient()
->delete($url, $headers);
if ($response->code == 200) {
$this
->logger()
->log(PersonalizeLogLevel::INFO, $success_msg, $vars);
}
else {
// Delete requests should fail softly, i.e. just with logging, not throwing
// an exception.
$this
->handleBadResponse($response->code, $fail_msg, $vars, TRUE, TRUE);
}
$this
->authenticateResponse($nonce, $timestamp, $response);
return json_decode($response->data, TRUE);
}