public function getConversations(
        $userId = false,
        $limit = 20,
        $offset = 0,
        $closed = null,
        $assigned = null,
        $tags = []
    ) {
        $params = [
            'count' => $limit,
            'after' => $offset
        ];

        if ($userId) {
            $data = $this->call('users/' . $this->appId . '/conversations', $params, 'get');
        } else {
            if ($closed !== null) {
                $params['closed'] = (bool)$closed;
            }
            if ($assigned !== null) {
                $params['assigned'] = (int)$assigned;
            }
            if ($tags) {
                $params['tags'] = implode(',', $tags);
            }

            $data = $this->call('apps/' . $this->appId . '/conversations', $params, 'get');
        }

        $array = [];
        if ($data) {
            foreach ($data as $msg) {
                $array[] = Conversation::fromResponse($msg);
            }
        }

        return $array;
    }
public function getConversations(
        $userId = false,
        $limit = 20,
        $offset = 0,
        $closed = null,
        $assigned = null,
        $tags = []
    ) {
        $params = [
            'count' => $limit,
            'after' => $offset
        ];

        if ($userId) {
            $data = $this->call('users/' . $this->appId . '/conversations', $params, 'get');
        } else {
            if ($closed !== null) {
                $params['closed'] = (bool)$closed;
            }
            if ($assigned !== null) {
                $params['assigned'] = (int)$assigned;
            }
            if ($tags) {
                $params['tags'] = implode(',', $tags);
            }

            $data = $this->call('apps/' . $this->appId . '/conversations', $params, 'get');
        }

        $array = [];
        if ($data) {
            foreach ($data as $msg) {
                $array[] = Conversation::fromResponse($msg);
            }
        }

        return $array;
    }
public function getConversations ( $ userId = false , $ limit = 20 , $ offset = 0 , $ closed = null , $ assigned = null , $ tags = [ ] ) { $ params = [ 'count' => $ limit , 'after' => $ offset ] ; if ( $ userId ) { $ data = $ this -> call ( 'users/' . $ this -> appId . '/conversations' , $ params , 'get' ) ; } else { if ( $ closed !== null ) { $ params [ 'closed' ] = ( bool ) $ closed ; } if ( $ assigned !== null ) { $ params [ 'assigned' ] = ( int ) $ assigned ; } if ( $ tags ) { $ params [ 'tags' ] = implode ( ',' , $ tags ) ; } $ data = $ this -> call ( 'apps/' . $ this -> appId . '/conversations' , $ params , 'get' ) ; } $ array = [ ] ; if ( $ data ) { foreach ( $ data as $ msg ) { $ array [ ] = Conversation :: fromResponse ( $ msg ) ; } } return $ array ; }
Get all conversations in application.

@param int $userId
@param int $limit
@param int $offset

Only for all conversations
@param bool $closed - true for open dialogs, false for closed dialogs, null for all dialogs
@param int $assigned - Id of Admin or null
@param array $tags

@return array

@throws InvalidArgumentException
@throws Exception
Get all conversations in application .