| @@ 131-147 (lines=17) @@ | ||
| 128 | * @param string $privacy Can be 'public' or 'secret'. 'public by default. |
|
| 129 | * @return array|bool |
|
| 130 | */ |
|
| 131 | public function create($name, $description, $privacy = 'public') |
|
| 132 | { |
|
| 133 | $this->request->checkLoggedIn(); |
|
| 134 | $post = Request::createRequestData( |
|
| 135 | [ |
|
| 136 | 'options' => [ |
|
| 137 | 'name' => $name, |
|
| 138 | 'description' => $description, |
|
| 139 | 'privacy' => $privacy, |
|
| 140 | ] |
|
| 141 | ] |
|
| 142 | ); |
|
| 143 | $postString = UrlHelper::buildRequestString($post); |
|
| 144 | $response = $this->request->exec(UrlHelper::RESOURCE_CREATE_BOARD, $postString); |
|
| 145 | ||
| 146 | return $this->response->checkResponse($response); |
|
| 147 | } |
|
| 148 | ||
| 149 | /** |
|
| 150 | * Search scope |
|
| @@ 17-34 (lines=18) @@ | ||
| 14 | * |
|
| 15 | * @return bool |
|
| 16 | */ |
|
| 17 | public function sendMessage($userId, $text) |
|
| 18 | { |
|
| 19 | $this->request->checkLoggedIn(); |
|
| 20 | $data = array( |
|
| 21 | "options" => array( |
|
| 22 | "user_ids" => array($userId), |
|
| 23 | "emails" => array(), |
|
| 24 | "text" => $text, |
|
| 25 | ), |
|
| 26 | ); |
|
| 27 | ||
| 28 | $request = Request::createRequestData($data); |
|
| 29 | ||
| 30 | $postString = UrlHelper::buildRequestString($request); |
|
| 31 | $response = $this->request->exec(UrlHelper::RESOURCE_SEND_MESSAGE, $postString); |
|
| 32 | ||
| 33 | return $this->response->checkResponse($response); |
|
| 34 | } |
|
| 35 | ||
| 36 | /** |
|
| 37 | * Get last user conversations |
|