getstream-io

Get single activity by id


How to get an activity by its id (unique uuid) or by foreign_id + time?

I could not find it in documentation. All information there represents how to get feed in pages. Not a single activity.


Solution

  • If you save the id you get from adding an activity, then you can opt to fetch activities based on the id, using "id_gte" or "id_lte" and only fetch with offset 0 and limit 1. Such as:

    $feed->getActivities(0, 1, ['id_gte' => $id]);
    

    This code is based on php, but their sdk should have equal functions for other languages if you require.