/** * @param $userId * @param $licenses AssignedLicense[] * @return mixed */ public function removeLicense($userId, array $licenses) { $data = ['addLicenses' => [], 'removeLicenses' => []]; foreach ($licenses as $license) { array_push($data['removeLicenses'], $license->getSkuId()); } $requestManager = new RequestManager($this->getResource($userId), json_encode($data), 'POST', $this->getHeader()); $requestManager->send(); return json_decode($requestManager->getHttpResponse(), true); }
/** * Gets single user with UserID or UserPrincipalName * @param $id * @return array */ public function find($id) { $url = $this->getResource() . "/{$id}"; $requestManager = new RequestManager($url, [], 'GET', $this->getHeader()); $requestManager->send(); return json_decode($requestManager->getHttpResponse(), true); }