Skip to content

Conversation

@adityaalifn
Copy link
Contributor

@adityaalifn adityaalifn commented Apr 14, 2025

// First page of results
$response = $client->queryThreads(
    ["created_by_user_id" => ['$eq' => "user123"]], // Filter by creator
    ["created_at" => -1], // Sort by created_at descending
    [
        "user_id" => "user456", // User ID in options
        "limit" => 10 // Limit to 10 results per page
    ]
);

// Get the next page using the 'next' parameter
if (isset($response["next"])) {
    $nextPage = $client->queryThreads(
        ["created_by_user_id" => ['$eq' => "user123"]], // Same filter
        ["created_at" => -1], // Same sort
        [
            "user_id" => "user456", // Same user ID
            "limit" => 10, // Same limit
            "next" => $response["next"] // Use the 'next' value for pagination
        ]
    );
}

@adityaalifn adityaalifn marked this pull request as ready for review April 15, 2025 10:15
@adityaalifn adityaalifn merged commit 4fadc8b into main Apr 15, 2025
4 checks passed
@adityaalifn adityaalifn deleted the add-query-threads branch April 15, 2025 10:51
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

Successfully merging this pull request may close these issues.

3 participants