client->makeRequest( '/tasks', "GET", $parameters ); } /** * Create task * * @param array $task * @param null $site * * @return \RetailCrm\Response\ApiResponse * */ public function tasksCreate($task, $site = null) { if (!count($task)) { throw new \InvalidArgumentException( 'Parameter `task` must contain a data' ); } /* @noinspection PhpUndefinedMethodInspection */ return $this->client->makeRequest( "/tasks/create", "POST", $this->fillSite( $site, ['task' => json_encode($task)] ) ); } /** * Edit task * * @param array $task * @param null $site * * @return \RetailCrm\Response\ApiResponse * */ public function tasksEdit($task, $site = null) { if (!count($task)) { throw new \InvalidArgumentException( 'Parameter `task` must contain a data' ); } /* @noinspection PhpUndefinedMethodInspection */ return $this->client->makeRequest( "/tasks/{$task['id']}/edit", "POST", $this->fillSite( $site, ['task' => json_encode($task)] ) ); } /** * Get custom dictionary * * @param $id * * @return \RetailCrm\Response\ApiResponse */ public function tasksGet($id) { if (empty($id)) { throw new \InvalidArgumentException( 'Parameter `id` must be not empty' ); } /* @noinspection PhpUndefinedMethodInspection */ return $this->client->makeRequest( "/tasks/$id", "GET" ); } }