问题
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?
回答1:
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
)
来源:https://stackoverflow.com/questions/55613463/getstream-io-using-getactivities-with-an-aggregated-feed-id