Link Search Menu Expand Document

Fetch One

/api/v2/group/fetch/one

Post

groups

jwt


Purpose

To allow a user to fetch one group that he/she is a member of or to have some details about it if it is public.

Body Content [input]

{
    uid: string,
    groupID: string
}

Returns if valid [output]

{
    groupID: string,
    name: string,
    description: string,
    privacy: string,
    icon: string,
    cover_image: string,
    members: {
        uid: string,
        is_admin: bool,
        status: string
    }[],
    error: 0,
    amount: int
}

What the API does

  • Finds all records from the groups collection.
  • Filters out all records not having a uid in the members field corresponding to the one passed if they have a value of private for their privacy field.
  • Removes the has_muted field for each record in their members field.
  • Sets empty values for members if uid does not correspond to a record in the members field with a status of accepted.
  • Finds the group that has a value for its groupID field that corresponds to the one passed [404].