Page results of API Groups

Hi,

I’m using the API to retrieve a list of Groups as detailed here https://prodocs.cometchat.com/reference#listgroups.

Is there anyway to page these results at all?

Thanks

Hi Ryanek,

Yes we do provide an option to paginate the results based on certain query parameters -

  1. perPage - This will retrieve the number of groups to be fetched in a request. Default value will be 100 and maximum of 1000 groups can be fetched at a time.
  2. affix - This parameter determines whether to fetch the results before/after a particular timestamp.
    The timestamp can be createdAt or updatedAt value of group.
    Possible values for affix are append(after) and prepend(before).
    The default value for affix being prepend
    For eg: /groups?createdAt=1597755077&affix=prepend - This would fetch all the groups that were created prior to the passed timestamp.

Kindly refer this for details - https://prodocs.cometchat.com/reference#listgroups

Hope this helps!
Siva

1 Like

That’s what I was looking for as this functionality was not entirely clear in the documentation.

Thanks Siva!

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.