private function CreateTokenRequest($clientId, $clientSecret, $scope) { $request = new RestRequest("POST", true); $params = array("Content-Type" => "application/x-www-form-urlencoded; charset=utf-8", "grant_type" => "client_credentials", "client_id" => $clientId, "client_secret" => $clientSecret, "scope" => $scope); $request->SetParameters($params); return $request; }
private function GetResponse($resource, $method, $params, $acceptType) { $request = new RestRequest($method); $request->SetAcceptType($acceptType); $request->SetAuthorization($this->accessToken); $request->SetParameters($params); return $this->restClient->Excute($resource, $request); }