44 $token = $this->settings[
"serviceUserToken"];
46 curl_setopt_array($curl, array(
47 CURLOPT_URL => $this->settings[
"domain"] .
"/v2beta/sessions/$this->sessionId",
48 CURLOPT_RETURNTRANSFER =>
true,
49 CURLOPT_ENCODING =>
'',
50 CURLOPT_MAXREDIRS => 10,
52 CURLOPT_FOLLOWLOCATION =>
true,
53 CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
54 CURLOPT_CUSTOMREQUEST =>
'DELETE',
55 CURLOPT_POSTFIELDS =>
"{
56 \"sessionToken\": \"$this->sessionToken\"
58 CURLOPT_HTTPHEADER => array(
59 "Content-Type: application/json",
60 "Accept: application/json",
61 "Authorization: Bearer $token"
65 $response = json_decode(curl_exec($curl));
66 if(isset($response->code)) {
67 throw new Exception(
"Error-Code: " . $response->code .
" Message: " . $response->message);