/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * @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); }
/** * 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); }
/** * 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); }