Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot Retrieve All Messages For A Specific Channel #120

Open
berkayturanci opened this issue Apr 8, 2024 · 0 comments
Open

Cannot Retrieve All Messages For A Specific Channel #120

berkayturanci opened this issue Apr 8, 2024 · 0 comments

Comments

@berkayturanci
Copy link

I am having an issue on retrieving all messages for a channel;

"{"code":4,"message":"GetOrCreateChannel failed with error: \"expected object for field \"data\" but got array\"","StatusCode":400,"duration":"0.00ms","more_info":"https://getstream.io/chat/docs/api_errors_response","details":[]}",

On using this;

` private static function updateChannelMessagesFlag(int $spaceId, string $spaceType, string $channelType)
{
$client = new Client(env("STREAM_CHAT_ACCESS_KEY"), env("STREAM_CHAT_SECRET_ACCESS_KEY"));

    $channelId = self::getChannelId($spaceType, $spaceId, $channelType);

    \Log::info('$channelId is '. $channelId);


    $channel = $client->Channel(
        'team',
        $channelId
    );

    $queryResponse = $channel->query([
        'messages' => [
            'limit' => 300,
            'offset' => 0,
            ]
        ]
    );

    \Log::info('$queryResponse is '. json_encode($queryResponse));

`

I am simply following the quide from here; https://getstream.io/chat/docs/php/channel_pagination/?language=php

My library version is 3.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant