Skip to content

Various Functions

Search Contacts from Calendar

List all contacts in the device's phonebook

javascript
let response = await client.getAllContacts()

Successful return

javascript
{
  session: 'Marketing',
  device: "551152204957",
  type: 'get-all-contacts',
  qt: 2,
  contacts: [
    {
      id: '552123919428',
      name: 'Alenii Venom',
      short: ''
    },
    {
      id: '556181590153',
      name: 'Joe Dutra',
      short: ''
    }
  ]
}

Error return

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

Search Blocked Contacts

List all blocked contacts

javascript
let response = await client.getBlockList()

Successful return

javascript
{
  session: 'Marketing',
  device: "551152204957",
  type: 'get-block-list',
  list: [ '5561986268199', '5561998745252' ]
}

Error return

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

Device Information

Brings device information

javascript
let response = await client.getHostDevice()

Successful return

javascript
{
  session: 'Marketing',
  device: "551152204957",
  status: 200,
  type: 'get-host-device',
  phone: '556181590153',
  image: "https://pps.whatsapp.net/v/t61.24694-24/254827313_500572874791871_6168181924916411415_n.jpg?stp=dst-jpg_s96x96&ccb=11-4&oh=5ee43eb4f1fe109b10ceba05292561aa&oe=622FF53D",
  pushName: 'Joe Dutra'
}

Error return

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

Block contact

Block and Unblock a contact

Block

javascript
//number of chat
let response = await client.blockContact("5561981590153")

Desbloquear

javascript
//number of chat
let response = await client.unblockContact("5561981590153")

Successful return

javascript
{
  session: 'Marketing',
  device: "551152204957",
  status: 200,
  type: 'block-contact',
}

Error return

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

Bring Status Information

Displays the status of a specific contact.

javascript
//number of chat
let response = await client.getProfileStatus("5561981590153")

Successful return

javascript
{
  session: 'Marketing',
  device: "551152204957",
  type: 'get-profile-status',
  status: 'Que Deus seja sempre louvado em nossas vidas'
}

Error return

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

Bring the contact image

Displays the contact's profile image

javascript
//number of chat
let response = await client.getPicture("5561981590153")

Successful return

javascript
{
    session: "1",
    device: "551152204957",
    status: 200,
    type: "get-picture",
    img: "https://pps.whatsapp.net/v/t61.24694-24/418935870_1492680228298036_3040916073525625274_n.jpg?stp=dst-jpg_s96x96&ccb=11-4&oh=01_Q5AaIBVNPGBqlnEYu_Ut8NtMUfx7Qs-G-gJnvhY_JvtYpMeP&oe=66414C35&_nc_sid=e6ed6c&_nc_cat=102",
    imgFull: "https://pps.whatsapp.net/v/t61.24694-24/418935870_1492680228298036_3040916073525625274_n.jpg?ccb=11-4&oh=01_Q5AaILuR6p01REsvwoHBKjWBMLJKFs_n-xGnLXvzX-zJ89RA&oe=66414C35&_nc_sid=e6ed6c&_nc_cat=102"
}

Return without image or permission

javascript
{
    session: "1",
    device: "551152204957",
    status: 200,
    type: "get-picture",
    img: null,
    imgFull: null
}

Error return

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

Change Profile Picture

Modify profile or group image

javascript
//number of chat, file local path
let response = await client.setPicture("5561981590153", "./image-profile.png")

Successful return

javascript
{
  session: 'Marketing',
  status: 200,
  type: 'set-picture'
}

Error return

javascript
{
  session: 'Marketing',
  status: 404,
  type: 'set-picture',
  message: 'message of erro'
}

Check Whatsapp Number

Check if a phone number has Whatsapp

javascript
//number of chat
let response = await client.getNumberProfile("5561981590153")

Successful return

javascript
{
  session: 'Marketing',
  type: 'get-number-profile',
  id: '556181590153',
  isBusiness: false,
  exist: true
}

Error return

javascript
{
  session: 'Marketing',
  status: 404,
  type: 'get-number-profile',
  message: 'message of erro'
}

Update Attendance

Update your presence for a given contact

State types: a = available, c = typing, r = recording, p = paused

javascript
//chat number, state: a, c, r, p
let response = await client.setPresence('556181590153', 'c');

Retorno de sucesso

javascript
{ 
  session: 'Marketing',
  status: 200, 
  type: 'set-presence' 
}

Error return

javascript
{
  session: 'Marketing',
  status: 404,
  type: 'set-presence',
  message: 'message of erro'
}

Change Profile Name

Update name on Whatsapp

javascript
// nome
let response = await client.setName("Orkestral");

Retorno de sucesso

javascript
{ 
  session: 'Marketing',
  status: 200, 
  type: 'set-name' 
}

Error return

javascript
{
  session: 'Marketing',
  status: 404,
  type: 'set-name',
  message: 'message of erro'
}

Change Profile Status

Update status on Whatsapp

javascript
// nome
let response = await client.setStatus('Viva la vida!');

Successful return

javascript
{ 
  session: 'Marketing',
  status: 200, 
  type: 'set-status' 
}

Error return

javascript
{
  session: 'Marketing',
  status: 404,
  type: 'set-status',
  message: 'message of erro'
}

All rights reserved to Orkestral LLC