52 $token = $this->settings[
"serviceUserToken"];
54 curl_setopt_array($curl, array(
55 CURLOPT_URL => $this->settings[
"domain"] .
"/v2beta/users/$this->userid/password",
56 CURLOPT_RETURNTRANSFER =>
true,
57 CURLOPT_ENCODING =>
'',
58 CURLOPT_MAXREDIRS => 10,
60 CURLOPT_FOLLOWLOCATION =>
true,
61 CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
62 CURLOPT_CUSTOMREQUEST =>
'POST',
63 CURLOPT_POSTFIELDS => json_encode($this->request),
64 CURLOPT_HTTPHEADER => array(
65 "Content-Type: application/json",
66 "Accept: application/json",
67 "Authorization: Bearer $token"
71 $response = json_decode(curl_exec($curl));
73 if(isset($response->code)) {
80 $token = $this->settings[
"serviceUserToken"];
82 curl_setopt_array($curl, array(
83 CURLOPT_URL => $this->settings[
"domain"] .
"/v2beta/users/$this->userid/password_reset",
84 CURLOPT_RETURNTRANSFER =>
true,
85 CURLOPT_ENCODING =>
'',
86 CURLOPT_MAXREDIRS => 10,
88 CURLOPT_FOLLOWLOCATION =>
true,
89 CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
90 CURLOPT_CUSTOMREQUEST =>
'POST',
91 CURLOPT_POSTFIELDS =>
"{
94 CURLOPT_HTTPHEADER => array(
95 "Content-Type: application/json",
96 "Accept: application/json",
97 "Authorization: Bearer $token"
101 $response = json_decode(curl_exec($curl));
102 if(isset($response->code)) {
103 throw new Exception(
"Error-Code: " . $response->code .
" Message: " . $response->message);
105 $this->verifyCode = $response->verificationCode;