Activity Feeds V3 is in closed alpha — do not use it in production (just yet).

Comments

Overview

Comments support voting, ranking, threading, images, URL previews, mentions and notifications.

Adding Comments

$response = $this->feedsV3Client->addComment(
    new GeneratedModels\AddCommentRequest(
        comment: 'This is a test comment from PHP SDK',
        objectID: $activityId,
        objectType: 'activity',
        userID: $this->testUserId
    )
);

Updating Comments

$response = $this->feedsV3Client->addComment(
    new GeneratedModels\AddCommentRequest(
        comment: 'This is a test comment from PHP SDK',
        objectID: $activityId,
        objectType: 'activity',
        userID: $this->testUserId
    )
);

Removing Comments

$response = $this->feedsV3Client->updateComment(
    $commentId,
    new GeneratedModels\UpdateCommentRequest(
        comment: 'Updated comment text from PHP SDK'
    )
);

Reading Comments

You’ll also want to show/return these comments. The most important is when reading the feed.

$response = $this->feedsV3Client->deleteComment($commentId, false); // soft delete

Querying Comments

You can also query the comments so you can show all comments for a given activity or user:

$response = $this->feedsV3Client->queryComments(
    new GeneratedModels\QueryCommentsRequest(
        filter: (object)['object_id' => $activityId],
        limit: 10
    )
);

Comment Reactions

$response = $this->feedsV3Client->queryComments(
    new GeneratedModels\QueryCommentsRequest(
        filter: (object)['object_id' => $activityId],
        limit: 10
    )
);

Comment Threading

$response = $this->feedsV3Client->deleteComment($commentId, false); // soft delete
© Getstream.io, Inc. All Rights Reserved.