diff --git a/src/MessageManager.php b/src/MessageManager.php index bb0011a..7a12ad4 100644 --- a/src/MessageManager.php +++ b/src/MessageManager.php @@ -28,6 +28,15 @@ public function getConversationMessages($conversation_id) return $response; } + public function searchMessages($query, $from = 0, $size = 10, $sort = "") + { + $query = urlencode($query); + + $response = $this->fireRequest("GET", "/search_messages?q={$query}&from={$from}&size={$size}&sort={$sort}"); + + return $response; + } + private function fireRequest($method, $uri, $body = []) { $method = strtoupper($method);