getstream-io: Using getActivities with an aggregated feed id

我是研究僧i 提交于 2020-05-24 04:26:26

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!