eAi
eAi

Reputation: 632

getstream-io: Using getActivities with an aggregated feed id

I have an aggregated feed ID in the format 46702136-5b7a-11e9-8080-80007f00215c.verb:id_2019-04-10.

When I call client.getActivities with this ID, I get an error "Invalid activity ID". I've tried just using the first part of the ID but this fails to return anything.

Is there a reason this doesn't work, or an alternative?

Upvotes: 2

Views: 250

Answers (1)

Tommaso Barbugli
Tommaso Barbugli

Reputation: 12031

The get activities endpoint allows you to retrieve individual activities, not aggregated activities.

This is because aggregated activities are specific to individual feeds and their feed group.

If you want to fetch an activity inside a group, you can still use client.getActivities eg.

client.getActivities(group.activities[0].id)

Otherwise if you want to fetch a single aggregated activity from a specific feed; you can do something like this:

feed.get(
   id_lte=group.id,
   id_gte=group.id,
   limit=1
)

Upvotes: 3

Related Questions