Skip to content

Group Roles

We created the easiest way to create groups with Superchats

Create group

Create a group with participants

javascript
//name of group, array with number of contacts
let response = await client.createGroup("Name Group", ["556181590153", "5561981819855"])

Successful return

javascript
{
  session: 'Marketing',
  device: "551152204957",
  status: 200,
  type: 'create-group',
  groupId: "15815954040-1631239154"
}

Erro return

javascript
{
  session: 'Marketing',
  device: "551152204957",
  status: 404,
  type: 'create-group',
  message: 'message of erro'
}

Create Community

Create one community

javascript
//name of community
let response = await client.createCommunity("Name Community")

Retorno de sucesso

javascript
{
  session: 'Marketing',
  device: "551152204957",
  status: 200,
  type: 'create-community',
  groupId: "158159540401631239154"
}

Retorno de erro

javascript
{
  session: 'Marketing',
  device: "551152204957",
  status: 404,
  type: 'create-community',
  message: 'message of erro'
}

Add participants

Add participants to the group

javascript
//id of group, array with number of contacts
let response = await client.addParticipantsGroup("15815954040-1631239154", ["556181590153", "5561981819855"])

Successful return

javascript
{
  session: 'Marketing',
  device: "551152204957",
  status: 200,
  type: 'add-participants-group',
}

Erro return

javascript
{
  session: 'Marketing',
  device: "551152204957",
  status: 404,
  type: 'add-participants-group',
  message: 'message of erro'
}

Add Admins

Add or remove admin

javascript
//id of group, array with number of contacts
let response = await client.addGroupAdmins("15815954040-1631239154", ["556181590153", "5561981819855"])
javascript
//id of group, array with number of contacts
let response = await client.removeGroupAdmins("15815954040-1631239154", ["556181590153", "5561981819855"])

Successful return

javascript
{
  session: 'Marketing',
  device: "551152204957",
  status: 200,
  type: 'add-group-admins',
}

Erro return

javascript
{
  session: 'Marketing',
  device: "551152204957",
  status: 404,
  type: 'add-group-admins',
  message: 'message of erro'
}

Alterar Nome do Grupo

Modify the group name

javascript
//id of group, name group
let response = await client.groupTitle("15815954040-1631239154", "new name of group")

Successful return

javascript
{
  session: 'Marketing',
  device: "551152204957",
  status: 200,
  type: 'group-title',
}

Erro return

javascript
{
  session: 'Marketing',
  device: "551152204957",
  status: 404,
  type: 'group-title',
  message: 'message of erro'
}

Alterar Descrição do Grupo

Modifica descrição do Grupo

javascript
//id of group, name group
let response = await client.groupDescription("15815954040-1631239154", "description of group")

Successful return

javascript
{
  session: 'Marketing',
  device: "551152204957",
  status: 200,
  type: 'group-description',
}

Erro return

javascript
{
  session: 'Marketing',
  device: "551152204957",
  status: 404,
  type: 'group-description',
  message: 'message of erro'
}

Entrar em Grupo

Entra em um grupo especifico

javascript
//id of group
let response = await client.joinGroup("15815954040-1631239154")

Successful return

javascript
{
  session: 'Marketing',
  device: "551152204957",
  status: 200,
  type: 'join-group',
}

Erro return

javascript
{
  session: 'Marketing',
  device: "551152204957",
  status: 404,
  type: 'join-group',
  message: 'message of erro'
}

Sair de Grupo

Sai de um grupo especifico

javascript
//id of group
let response = await client.leaveGroup("15815954040-1631239154")

Successful return

javascript
{
  session: 'Marketing',
  device: "551152204957",
  status: 200,
  type: 'leave-group',
}

Erro return

javascript
{
  session: 'Marketing',
  device: "551152204957",
  status: 404,
  type: 'leave-group',
  message: 'message of erro'
}

Atualiza o link de um grupo especifico

javascript
//id of group
let response = await client.revokeGroupLink("15815954040-1631239154")

Successful return

javascript
{
  session: 'Marketing',
  device: "551152204957",
  status: 200,
  type: 'revoke-group-link',
  linkGroup: 'G3M81fQbuwDB2cuAdPIv0h'
}

Erro return

javascript
{
  session: 'Marketing',
  device: "551152204957",
  status: 404,
  type: 'revoke-group-link',
  message: 'message of erro'
}

Group Information

Returns information from a specific group

javascript
//id of group
let response = await client.infoGroup("15815954040-1631239154")

Successful return

javascript
{
  session: 'Marketing',
  device: "551152204957",
  type: 'info-group',
  status: 200,
  id: '15795662985-1631581942',
  owner: '15795662985@c.us',
  title: 'Teste Grupo Live',
  create: 1631581942,
  participants: [
    {
      id: '556181590153',
      name: 'Joe Dutra',
      short: 'Joe',
      isAdmin: false,
      isSuperAdmin: false
    },
    {
      id: '5521991977392',
      name: 'Israel - Fabrica de Sonhos',
      short: 'Israel - Fabrica',
      isAdmin: false,
      isSuperAdmin: false
    }
  ]
}

Erro return

javascript
{
  session: 'Marketing',
  device: "551152204957",
  status: 404,
  type: 'info-group',
  message: 'message of erro'
}

Modify Settings

Modify settings for a specific group

Set group messaging to admins only

javascript
//id of group, type, boolean
let response = await client.setGroupSettings("15815954040-1631239154", "message", true)

Set group change settings for admins only

javascript
//id of group, type, boolean
let response = await client.setGroupSettings("15815954040-1631239154", "settings", true)

Successful return

javascript
{
  session: 'Marketing',
  device: "551152204957",
  status: 200,
  type: 'set-group-settings',
}

Erro return

javascript
{
  session: 'Marketing',
  device: "551152204957",
  status: 404,
  type: 'set-group-settings',
  message: 'message of erro'
}

Get Groups List

Get all groups list

javascript
let response = await client.getGroups()

Successful return

javascript
{
  session: 'Marketing',
  device: "551152204957",
  status: 200,
  type: 'get-groups',
  chats: [
    { id: '5511982743910-1596072761', name: 'Venom Support' },
    { id: '556181590153-1625838636', name: 'Venom Business' }
  ]
}

Erro return

javascript
{
  session: 'Marketing',
  device: "551152204957",
  status: 404,
  type: 'get-groups',
  message: 'message of erro'
}

All rights reserved to Orkestral LLC