37 public function delete() {
38 $token = $this->settings[
"serviceUserToken"];
40 curl_setopt_array($curl, array(
41 CURLOPT_URL => $this->settings[
"domain"] .
"/v2beta/users/$this->userid",
42 CURLOPT_RETURNTRANSFER =>
true,
43 CURLOPT_ENCODING =>
"",
44 CURLOPT_MAXREDIRS => 10,
46 CURLOPT_FOLLOWLOCATION =>
true,
47 CURLOPT_CUSTOMREQUEST =>
"DELETE",
48 CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
49 CURLOPT_HTTPHEADER => array(
50 "Accept: application/json",
51 "Authorization: Bearer $token"
54 $response = json_decode(curl_exec($curl));
55 if(isset($response->code)) {
56 throw new Exception(
"Error-Code: " . $response->code .
" Message: " . $response->message);