Reputation: 30906
How can I use the PHP getstream API to retrieve all the information about an activity from the activity id?
When we add activities we locally store the ID's for them, how could we get the activity body given that activity id 5c23d1be-0dc5-12e6-2080-1000759b484d using the php API?
Upvotes: 1
Views: 343
Reputation: 411
One way to retrieve this single activity using the Stream PHP client would be:
$options = array("id_lte" => $uuid);
$results = $user_feed_1->getActivities(0, 1, $options);
Also, one thing you can do is to set foreign_id
which can be used as a unique id to retrieve/delete/update an activity:
// Remove an activity by its id
$user_feed_1->removeActivity("e561de8f-00f1-11e4-b400-0cc47a024be0");
// Remove activities with foreign_id 'run:1'
$user_feed_1->removeActivity('run:1', true);
Upvotes: 1