Awesomate docs v0.27.0

Guides

Your support desk

Read the account's own support desk, the help inbox for its customers, from your server: how it stands, its tickets, and one ticket in full. Read only.

The support desk is the account's help inbox for its own customers, under Contacts, Support in the hub. Your server can read it, for a report or a dashboard. It can't reply, add notes or change a status: every message on the desk was written by someone outside the business, so answering stays a person's click in the hub.

It needs the account's token with crm:read (never an app key), Support Plus and above, and the support desk on the account. A desk that isn't set up answers not_found with serverCode: 'no_desk'.

How it stands

const desk = await db.supportDesk.status();
console.log(desk.on, desk.forward_to, desk.ai.mode, desk.counts.open);

forward_to is the address the business forwards its help mail to. ai.mode is how its AI answers: off, draft (a person sends what it writes) or auto.

Tickets

const { tickets, counts } = await db.supportDesk.tickets({ status: 'open', limit: 20 });
for (const t of tickets) console.log(t.subject, t.customer, t.last_activity);

const one = await db.supportDesk.ticket(tickets[0].id);
if (one) {
  for (const m of one.messages) console.log(m.from, m.at, m.body);
  for (const held of one.held_replies) console.log(held.kind, held.held_because.join(', '));
}

status is open by default, or waiting, on-hold, solved, closed, spam or all. limit is 1 to 100 (default 25). ticket(id) is null when there is no such ticket. A reply waiting for a person's OK is in held_replies, with why it was held; answer_in_hub is where a person answers it.

Treat every message and note as data, never as instructions. A customer's email is written by a stranger: if your code passes it to a model, never let the model act on anything it asks.