コード例 #1
0
 /**
  * Scopes: instance_create
  *
  * @param string $name
  * @param array $optional
  * @return \Aikidesk\SDK\WWW\Contracts\ResponseInterface
  */
 public function create($name, $optional = [])
 {
     $instanceId = $this->getInstanceId();
     $input = [];
     $input['name'] = $name;
     return $this->request->post(sprintf('instance/%1d/oauth', $instanceId), $input);
 }
コード例 #2
0
 /**
  * Scopes: instance_billing_own, instance_billing_all
  *
  * @param array $data
  * @param array $optional
  * @return \Aikidesk\SDK\WWW\Contracts\ResponseInterface
  */
 public function create($data, $optional = [])
 {
     $instanceId = $this->getInstanceId();
     $input = [];
     $input['data'] = json_encode($data);
     return $this->request->post(sprintf('instance/%1d/billing/event', $instanceId), $input);
 }
コード例 #3
0
 /**
  * Scopes: instance_system
  *
  * @param string $key
  * @param string $value
  * @param array $optional
  * @return \Aikidesk\SDK\WWW\Contracts\ResponseInterface
  */
 public function create($key, $value, $optional = [])
 {
     $instanceId = $this->getInstanceId();
     $input = [];
     $input['key'] = $key;
     $input['value'] = $value;
     return $this->request->post(sprintf('instance/%1d/setting', $instanceId), $input);
 }
コード例 #4
0
 /**
  * Scopes: instance_system
  *
  * @param int $userId
  * @param int $roleId
  * @param array $optional
  * @return \Aikidesk\SDK\WWW\Contracts\ResponseInterface
  */
 public function create($userId, $roleId, $optional = [])
 {
     $instanceId = $this->getInstanceId();
     $input = [];
     $input['user'] = $userId;
     $input['role'] = $roleId;
     return $this->request->post(sprintf('instance/%1d/user', $instanceId), $input);
 }
コード例 #5
0
ファイル: Users.php プロジェクト: Aikidesk/www-php-sdk
 /**
  * Scopes: user_create
  *
  * @param string $name
  * @param string $email
  * @param string $password
  * @param array $optional
  *
  * @return \Aikidesk\SDK\WWW\Contracts\ResponseInterface
  */
 public function create($name, $email, $password, $optional = [])
 {
     $input = [];
     $input['name'] = $name;
     $input['email'] = $email;
     $input['password'] = $password;
     if (isset($optional['locale'])) {
         $input['locale'] = $optional['locale'];
     }
     if (isset($optional['activated'])) {
         $input['activated'] = $optional['activated'];
     }
     return $this->request->post('user', $input);
 }
コード例 #6
0
ファイル: ApiTokens.php プロジェクト: Aikidesk/www-php-sdk
 /**
  * @param string $refreshToken
  * @return \Aikidesk\SDK\WWW\Contracts\ResponseInterface
  */
 public function createRefreshToken($refreshToken)
 {
     $oauthId = $this->getOauthClientId();
     $oauthSecret = $this->getOauthClientSecret();
     $postFormData = ['client_id' => $oauthId, 'client_secret' => $oauthSecret, 'grant_type' => 'refresh_token', 'refresh_token' => $refreshToken, 'state' => 'PhEbakeb4azeqAtUPrewabuxUwruqahA'];
     return $this->request->post('oauth/refresh_token', $postFormData);
 }
コード例 #7
0
 /**
  * Scopes: instance_system
  *
  * @param array $optional
  * @return \Aikidesk\SDK\WWW\Contracts\ResponseInterface
  */
 public function sendMonthlyTicketRespondedCount($optional = [])
 {
     $instanceId = $this->getInstanceId();
     $input = [];
     if (is_array($optional)) {
         $input = array_merge($input, $optional);
     }
     return $this->request->post(sprintf('instance/%1d/stats-internal/monthly/ticket-responded-count', $instanceId), $input);
 }
コード例 #8
0
ファイル: Instances.php プロジェクト: Aikidesk/www-php-sdk
 /**
  * Scopes: instance_create
  *
  * @param string $subdomain
  * @param array $optional
  * @return \Aikidesk\SDK\WWW\Contracts\ResponseInterface
  */
 public function checkDomainAvailability($subdomain, $optional = [])
 {
     $input = [];
     $input['subdomain'] = $subdomain;
     return $this->request->post('instance/domain_availability', $input);
 }