gohl
Version:
Go Highlevel Node Js ease of use library implementation to their API
39 lines • 1.99 kB
JavaScript
;
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Appointment = void 0;
const axios_1 = require("axios");
class Appointment {
/**
* Endpoints For Appointments
* https://highlevel.stoplight.io/docs/integrations/6015cf49a7ae8-get-appointments-for-contact
* https://public-api.gohighlevel.com/#dbf523a3-c344-44cc-adf7-34b68c40dc81
*/
constructor(authData) {
this.authData = authData;
}
/**
* Get appointments for contact. For both GHL App and API
* Documentation - https://highlevel.stoplight.io/docs/integrations/6015cf49a7ae8-get-appointments-for-contact
* Documentation - https://public-api.gohighlevel.com/#af42b0d8-f002-4d09-a1a9-f860d653127f
*/
get(contactId) {
return __awaiter(this, void 0, void 0, function* () {
var _a, _b;
const headers = (_a = this.authData) === null || _a === void 0 ? void 0 : _a.headers;
const response = yield axios_1.default.get(`${(_b = this.authData) === null || _b === void 0 ? void 0 : _b.baseurl}/contacts/${contactId}/appointments/`, { headers });
const events = response.data.events;
return events;
});
}
}
exports.Appointment = Appointment;
//# sourceMappingURL=contacts.appointments.js.map