# Class JGroupApi

#### Hierarchy (View Summary)

- JBaseApi
  - JGroupApi

- Defined in jamespot-user-api/src/apis/group/group.ts:25

##### Index

### Constructors

constructor

### Properties

jApi
network

### Methods

autocomplete
changeMemberRole
countMembers
create
getApplications
getCategories
getCategoriesConfiguration
getObjectListJamespotSpotMembers
getProperties
getSpot
getUserLevelAndRight
getWidgets
groupAddToFavorite
groupRequest
list
objectListSpotArticles
resetNotifications
update

## Constructors

### constructor

- new JGroupApi(jApi: JamespotUserApi): JGroupApi

  #### Parameters

  - jApi: JamespotUserApi

  #### Returns JGroupApi

  Inherited from JBaseApi.constructor

  - Defined in jamespot-user-api/src/apis/base.ts:8

## Properties

### jApi

jApi: JamespotUserApi

Inherited from JBaseApi.jApi

- Defined in jamespot-user-api/src/apis/base.ts:5

### network

network: Network

Inherited from JBaseApi.network

- Defined in jamespot-user-api/src/apis/base.ts:6

## Methods

### autocomplete

- autocomplete(query: string): Promise<jSpotAutocomplete[]>

  autocomplete return a list of groups

  #### Parameters

  - query: string

  #### Returns Promise<jSpotAutocomplete[]>

  - Defined in jamespot-user-api/src/apis/group/group.ts:30

### changeMemberRole

- changeMemberRole(
  payload: { idSpot: number; idUser: number; role: number },
  ): Promise<ApiWrapper<string, BaseMessages>>

  #### Parameters

  - payload: { idSpot: number; idUser: number; role: number }

  #### Returns Promise<ApiWrapper<string, BaseMessages>>

  - Defined in jamespot-user-api/src/apis/group/group.ts:257

### countMembers

- countMembers(
  payload: { uri: string },
  signal?: AbortSignal,
  ): Promise<ApiWrapper<number, BaseMessages>>

  #### Parameters

  - payload: { uri: string }
  - `Optional` signal: AbortSignal

  #### Returns Promise<ApiWrapper<number, BaseMessages>>

  - Defined in jamespot-user-api/src/apis/group/group.ts:265

### create

- create<T extends "raw-little" | "raw-list" | "raw-view" | undefined = undefined>(
  group: CreateGroup,
  format?: T,
  ): Promise<
  ApiWrapper<
  ApiReturn<T, jGroupLittle, jGroupLittle, jGroupView, jObjectLittle>,
  BaseMessages,
  >,
  >

  Create a group from scratch

  #### Type Parameters

  - T extends "raw-little" | "raw-list" | "raw-view" | undefined = undefined

  #### Parameters

  - group: CreateGroup
  - `Optional` format: T

    return format

  #### Returns Promise<
  ApiWrapper<
  ApiReturn<T, jGroupLittle, jGroupLittle, jGroupView, jObjectLittle>,
  BaseMessages,
  >,
  >

  - Defined in jamespot-user-api/src/apis/group/group.ts:44

### getApplications

- getApplications(): Promise<
  ApiWrapper<Record<string, GroupWidget>, BaseMessages>,
  >

  Get the available applications that can be added to a group

  #### Returns Promise<ApiWrapper<Record<string, GroupWidget>, BaseMessages>>

  - Defined in jamespot-user-api/src/apis/group/group.ts:115

### getCategories

- getCategories(): Promise<ApiWrapper<Category[], BaseMessages>>

  Get the available group categories

  #### Returns Promise<ApiWrapper<Category[], BaseMessages>>

  - Defined in jamespot-user-api/src/apis/group/group.ts:123

### getCategoriesConfiguration

- getCategoriesConfiguration(
  __namedParameters?: { signal?: AbortSignal },
  ): Promise<ApiWrapper<GroupCategoriesConfiguration, BaseMessages>>

  #### Parameters

  - __namedParameters: { signal?: AbortSignal } = {}

  #### Returns Promise<ApiWrapper<GroupCategoriesConfiguration, BaseMessages>>

  - Defined in jamespot-user-api/src/apis/group/group.ts:127

### getObjectListJamespotSpotMembers

- getObjectListJamespotSpotMembers(
  idSpot: string | number,
  query?: string,
  limit?: number,
  page?: number,
  ): Promise<
  ApiWrapper<
  PagingResults<{ level: 0 | 1 | 2 | 3; user: jUserLittle }>,
  BaseMessages,
  >,
  >

  Get the members of a group

  #### Parameters

  - idSpot: string | number

    spot id

  - `Optional` query: string

    query string to search within user names

  - `Optional` limit: number

    limit per page

  - page: number = 1

    page number

  #### Returns Promise<
  ApiWrapper<
  PagingResults<{ level: 0 | 1 | 2 | 3; user: jUserLittle }>,
  BaseMessages,
  >,
  >

  array of User

  - Defined in jamespot-user-api/src/apis/group/group.ts:147

### getProperties

- getProperties(
  idSpot: string | number,
  ): Promise<ApiWrapper<GroupProperties, BaseMessages>>

  Get the properties of a group that are not within the model

  #### Parameters

  - idSpot: string | number

  #### Returns Promise<ApiWrapper<GroupProperties, BaseMessages>>

  - Defined in jamespot-user-api/src/apis/group/group.ts:91

### getSpot

- getSpot<
  T extends "raw-little"
  | "raw-list"
  | "raw-view"
  | undefined = undefined,
  >(
  idSpot: string | number,
  format?: T,
  ): Promise<
  ApiWrapper<
  ApiReturn<T, jGroupLittle, jGroupLittle, jGroupView, string>,
  BaseMessages,
  >,
  >

  Get a spot

  #### Type Parameters

  - T extends "raw-little" | "raw-list" | "raw-view" | undefined = undefined

  #### Parameters

  - idSpot: string | number
  - `Optional` format: T

  #### Returns Promise<
  ApiWrapper<
  ApiReturn<T, jGroupLittle, jGroupLittle, jGroupView, string>,
  BaseMessages,
  >,
  >

  - Defined in jamespot-user-api/src/apis/group/group.ts:77

### getUserLevelAndRight

- getUserLevelAndRight(
  idSpot: string | number,
  ): Promise<ApiWrapper<UserLevelAndRight, BaseMessages>>

  Get a spot

  #### Parameters

  - idSpot: string | number

  #### Returns Promise<ApiWrapper<UserLevelAndRight, BaseMessages>>

  - Defined in jamespot-user-api/src/apis/group/group.ts:198

### getWidgets

- getWidgets(
  idSpot: string | number,
  ): Promise<ApiWrapper<GroupProperties, BaseMessages>>

  Get the widgets of a group

  #### Parameters

  - idSpot: string | number

  #### Returns Promise<ApiWrapper<GroupProperties, BaseMessages>>

  - Defined in jamespot-user-api/src/apis/group/group.ts:104

### groupAddToFavorite

- groupAddToFavorite(
  idSpot: string | number,
  ): Promise<ApiWrapper<boolean, BaseMessages>>

  Join a public group

  #### Parameters

  - idSpot: string | number

  #### Returns Promise<ApiWrapper<boolean, BaseMessages>>

  - Defined in jamespot-user-api/src/apis/group/group.ts:224

### groupRequest

- groupRequest(
  idSpot: string | number,
  ): Promise<ApiWrapper<boolean, BaseMessages>>

  Post a request to join a moderated group

  #### Parameters

  - idSpot: string | number

  #### Returns Promise<ApiWrapper<boolean, BaseMessages>>

  - Defined in jamespot-user-api/src/apis/group/group.ts:211

### list

- list<
  T extends jGroupLittle = jGroupLittle,
  K extends GroupFormatsExtension = [],
  >(
  config: GroupListConfig,
  params?: { formatExtension?: K; signal?: AbortSignal },
  ): Promise<
  ApiWrapper<PagingResults<GroupWithExtensions<T, K>>, BaseMessages>,
  >

  #### Type Parameters

  - T extends jGroupLittle = jGroupLittle
  - K extends GroupFormatsExtension = []

  #### Parameters

  - config: GroupListConfig
  - `Optional` params: { formatExtension?: K; signal?: AbortSignal }

  #### Returns Promise<ApiWrapper<PagingResults<GroupWithExtensions<T, K>>, BaseMessages>>

  - Defined in jamespot-user-api/src/apis/group/group.ts:159

### objectListSpotArticles

- objectListSpotArticles<
  F extends "raw-little"
  | "raw-list"
  | "raw-view" = LITTLE,
  T extends string | number | symbol = never,
  E extends ArticleFormatsExtension = [],
  >(
  payload: ({ idSpot: number } | { idSpots: number[] }) & {
  limit?: number;
  order?: string;
  page?: number;
  tagConcepts?: string[];
  types?: string[];
  },
  options?: { format?: F; formatExtension?: E; signal?: AbortSignal },
  ): Promise<ApiWrapper<PagingResults<ArticleReturn<F, T, E>>, BaseMessages>>

  #### Type Parameters

  - F extends "raw-little" | "raw-list" | "raw-view" = LITTLE
  - T extends string | number | symbol = never
  - E extends ArticleFormatsExtension = []

  #### Parameters

  - payload: ({ idSpot: number } | { idSpots: number[] }) & {
    limit?: number;
    order?: string;
    page?: number;
    tagConcepts?: string[];
    types?: string[];
    }
  - `Optional` options: { format?: F; formatExtension?: E; signal?: AbortSignal }

  #### Returns Promise<ApiWrapper<PagingResults<ArticleReturn<F, T, E>>, BaseMessages>>

  - Defined in jamespot-user-api/src/apis/group/group.ts:232

### resetNotifications

- resetNotifications(
  config: ResetNotificationConfiguration,
  ): Promise<ApiWrapper<{ members: number; msg: string }, BaseMessages>>

  Reset the notifications configuration for all users of the group

  #### Parameters

  - config: ResetNotificationConfiguration

    configuration

  #### Returns Promise<ApiWrapper<{ members: number; msg: string }, BaseMessages>>

  - Defined in jamespot-user-api/src/apis/group/group.ts:185

### update

- update<T extends "raw-little" | "raw-list" | "raw-view" | undefined = undefined>(
  group: UpdateGroup,
  format?: T,
  ): Promise<
  ApiWrapper<
  ApiReturn<T, jGroupLittle, jGroupLittle, jGroupView, string>,
  BaseMessages,
  >,
  >

  Update a group

  #### Type Parameters

  - T extends "raw-little" | "raw-list" | "raw-view" | undefined = undefined

  #### Parameters

  - group: UpdateGroup

    group to update. The uri is mandatory and identify the group to update

  - `Optional` format: T

    return format

  #### Returns Promise<
  ApiWrapper<
  ApiReturn<T, jGroupLittle, jGroupLittle, jGroupView, string>,
  BaseMessages,
  >,
  >

  - Defined in jamespot-user-api/src/apis/group/group.ts:59