UNPKG

gohl

Version:

Go Highlevel Node Js ease of use library implementation to their API

112 lines (111 loc) 4.35 kB
import { AuthData } from "../interfaces/auth/authdata"; import { IContact } from "../interfaces/contact"; import { Task } from "./contacts.tasks"; import { Note } from "./contacts.notes"; import { Campaign } from "./contacts.campaigns"; import { Workflow } from "./contacts.workflows"; import { Tag } from "./contacts.tags"; import { Appointment } from "./contacts.appointments"; import { IContactSearchFilter } from "../interfaces/contact.search.filter"; export declare class Contacts { private authData?; tasks: Task; notes: Note; campaigns: Campaign; workflows: Workflow; tags: Tag; appointments: Appointment; /** * Endpoints For Contacts * https://highlevel.stoplight.io/docs/integrations/e957726e8625d-contacts-api * https://public-api.gohighlevel.com/#0097b747-33c2-452f-8c78-aab5ab36c071 */ constructor(authData?: AuthData); /** * Get contacts. [Deprecated] * Documentation - https://highlevel.stoplight.io/docs/integrations/dbe4f3a00a106-search-contacts * @param locationId * @param filters * @returns */ get(locationId: string, filters: { query?: string; startAfter?: number; startAfterId?: string; limit?: number; }): Promise<{ count: number; contacts: IContact[]; }>; /** * Get Contacts and Search contacts. For both App and API version * Documentation - https://highlevel.stoplight.io/docs/integrations/dbe4f3a00a106-search-contacts * Documentation - https://public-api.gohighlevel.com/#dac71866-cddd-48e9-ba77-99fd293594fa * @param query * @param order * @param sortBy * @param limit */ search(query?: string, order?: 'asc' | 'desc', sortBy?: 'date_added' | 'date_updated', limit?: number): Promise<{ total: number; contacts: IContact[]; }>; /** * Get Searched contacts use filters. * Documentation - https://highlevel.stoplight.io/docs/integrations/dbe4f3a00a106-search-contacts * Documnetation on Filters - https://doc.clickup.com/8631005/d/h/87cpx-158396/6e629989abe7fad * @param query */ searchWithFilters(query: IContactSearchFilter): Promise<{ total: number; contacts: IContact[]; }>; /** * Search contact by email or phone number.. Only For API version * Documentation - https://public-api.gohighlevel.com/#5f4bde90-5179-43b2-b38d-f09b7bb771ad * @param email * @param phone */ lookup(email?: string, phone?: string): Promise<IContact[]>; /** * Get Contacts By BusinessId * Documentation: https://highlevel.stoplight.io/docs/integrations/8efc6d5a99417-get-contacts-by-business-id * @param businessId * @returns */ getByBusinessId(businessId: string): Promise<{ total: number; count: number; contacts: IContact[]; }>; /** * Get Contacts By Id. For other GHL App and API version * Documentation: https://highlevel.stoplight.io/docs/integrations/00c5ff21f0030-get-contact * @param contactId * @returns */ getOne(contactId: string): Promise<IContact>; /** * Creates a new contact with the provided information. For other GHL App and API version * Documentation: https://public-api.gohighlevel.com/#5fbc2b83-603d-4974-81c3-7d8658a79594 * @param {CreateContactInfo} contact - The contact information including email, name, phone, company, and source. * @returns The newly created contact. */ create(contact: IContact, locationId?: string): Promise<IContact>; /** * Update contact. For other GHL App and API version * Documentation: https://highlevel.stoplight.io/docs/integrations/9ce5a739d4fb9-update-contact * Documentation: https://public-api.gohighlevel.com/#1c7060e2-ebaf-4b5b-9248-be0292689bba * @param {string} id * @param contact * @returns */ update(id: string, contact: IContact, locationId?: string): Promise<IContact>; /** * Remove contact. For other GHL App and API version * Documentation: https://highlevel.stoplight.io/docs/integrations/28ab84e9522b6-delete-contact * Documentation: https://public-api.gohighlevel.com/#546cdf6c-3367-4569-b3c4-46d9f13a71ba * @param id */ remove(id: string): Promise<boolean>; }