refreshAppointment
This interface fetches the latest state of a single appointment from the CRM. It is called when a user opens an appointment detail view or manually refreshes an appointment to pick up changes made directly in the CRM.
Input parameters
| Parameter | Description |
|---|---|
user |
An object describing the Chrome extension user associated with the action that triggered this interface. |
authHeader |
The HTTP Authorization header to be transmitted with the API request to the target CRM. |
appointmentId |
The CRM ID of the appointment to retrieve. |
Return value(s)
An object with the following property:
| Parameter | Description |
|---|---|
appointment |
The current appointment object from the CRM. |
If the appointment cannot be found, return:
| Parameter | Description |
|---|---|
successful |
false |
returnMessage |
An object with message, messageType, and ttl. |
Example
return {
appointment: {
id: "12345",
thirdPartyAppointmentId: "12345",
title: "Intake call with Jane Smith",
description: "Initial consultation",
startTimeUtc: "2024-03-15T14:00:00.000Z",
durationMinutes: 60,
status: "scheduled",
contactId: "67890",
attendees: [{ id: 67890, name: "Jane Smith", type: "Contact" }]
}
};
Reference
const listRes = await axios.get(
`https://${user.hostname}/api/v4/calendar_entries.json`,
{
headers: { 'Authorization': authHeader },
params: {
fields: 'id,summary,start_at,end_at,description,attendees{id,name,type}'
}
}
);
const entries = listRes?.data?.data ?? [];
const appointments = entries.map(e => {
const startUtc = e?.start_at ? moment.parseZone(e.start_at).utc() : null;