pub struct ContactsService { /* private fields */ }Expand description
Access to the Contacts API. Obtained via Ghl::contacts.
Implementations§
Source§impl ContactsService
impl ContactsService
Sourcepub async fn create(&self, contact: CreateContact) -> Result<Contact>
pub async fn create(&self, contact: CreateContact) -> Result<Contact>
POST /contacts/
Sourcepub async fn update(
&self,
contact_id: &str,
update: UpdateContact,
) -> Result<Contact>
pub async fn update( &self, contact_id: &str, update: UpdateContact, ) -> Result<Contact>
PUT /contacts/{id}
Sourcepub fn list(&self, location_id: impl Into<String>) -> ListContacts
pub fn list(&self, location_id: impl Into<String>) -> ListContacts
GET /contacts/ — returns a lazy request builder.
Source§impl ContactsService
impl ContactsService
Sourcepub async fn get_contacts(
&self,
params: &GetContactsParams,
) -> Result<ContactsSearchSuccessfulResponseDto>
Available on crate feature contacts only.
pub async fn get_contacts( &self, params: &GetContactsParams, ) -> Result<ContactsSearchSuccessfulResponseDto>
contacts only.Get Contacts
Get Contacts Note: This API endpoint is deprecated. Please use the Search Contacts endpoint instead.
GET /contacts/
Requires scope: contacts.readonly.
Sourcepub async fn create_contact(
&self,
body: &CreateContactDto,
) -> Result<CreateContactsSuccessfulResponseDto>
Available on crate feature contacts only.
pub async fn create_contact( &self, body: &CreateContactDto, ) -> Result<CreateContactsSuccessfulResponseDto>
contacts only.Create Contact
Please find the list of acceptable values for the country field here
POST /contacts/
Requires scope: contacts.write.
Sourcepub async fn add_remove_contacts_from_business(
&self,
body: &ContactsBusinessUpdate,
) -> Result<ContactsBulkUpateResponse>
Available on crate feature contacts only.
pub async fn add_remove_contacts_from_business( &self, body: &ContactsBusinessUpdate, ) -> Result<ContactsBulkUpateResponse>
contacts only.Add/Remove Contacts From Business
Add/Remove Contacts From Business . Passing a null businessId will remove the
businessId from the contacts
POST /contacts/bulk/business
Available on crate feature contacts only.
contacts only.Update Contacts Tags
Allows you to update tags to multiple contacts at once, you can add or remove tags from the contacts
POST /contacts/bulk/tags/update/{type}
Sourcepub async fn get_contacts_by_business_id(
&self,
business_id: &str,
params: &GetContactsByBusinessIdParams,
) -> Result<ContactsSearchSuccessfulResponseDto>
Available on crate feature contacts only.
pub async fn get_contacts_by_business_id( &self, business_id: &str, params: &GetContactsByBusinessIdParams, ) -> Result<ContactsSearchSuccessfulResponseDto>
contacts only.Get Contacts By BusinessId
GET /contacts/business/{businessId}
Requires scope: contacts.readonly.
Sourcepub async fn search_contacts(&self, body: &SearchBodyV2DTO) -> Result<Value>
Available on crate feature contacts only.
pub async fn search_contacts(&self, body: &SearchBodyV2DTO) -> Result<Value>
contacts only.Search Contacts
Search contacts based on combinations of advanced filters. Documentation Link - https://doc.clickup.com/8631005/d/h/87cpx-158396/6e629989abe7fad
POST /contacts/search
Requires scope: contacts.readonly.
Sourcepub async fn get_duplicate_contact(
&self,
params: &GetDuplicateContactParams,
) -> Result<Value>
Available on crate feature contacts only.
pub async fn get_duplicate_contact( &self, params: &GetDuplicateContactParams, ) -> Result<Value>
contacts only.Get Duplicate Contact
Get Duplicate Contact. If Allow Duplicate Contact is disabled under Settings, the
global unique identifier will be used for searching the contact. If the setting is
enabled, first priority for search is email and the second priority will be
phone.
GET /contacts/search/duplicate
Requires scope: contacts.readonly.
Sourcepub async fn upsert_contact(
&self,
body: &UpsertContactDto,
) -> Result<UpsertContactsSuccessfulResponseDto>
Available on crate feature contacts only.
pub async fn upsert_contact( &self, body: &UpsertContactDto, ) -> Result<UpsertContactsSuccessfulResponseDto>
contacts only.Upsert Contact
Please find the list of acceptable values for the country field here The Upsert
API will adhere to the configuration defined under the “Allow Duplicate Contact”
setting at the Location level. If the setting is configured to check both Email and
Phone, the API will attempt to identify an existing contact based on the priority
sequence specified in the setting, and will create or update the contact
accordingly. If two separate contacts already exist—one with the same email and
another w
POST /contacts/upsert
Requires scope: contacts.write.
Sourcepub async fn delete_contact(
&self,
contact_id: &str,
) -> Result<DeleteContactsSuccessfulResponseDto>
Available on crate feature contacts only.
pub async fn delete_contact( &self, contact_id: &str, ) -> Result<DeleteContactsSuccessfulResponseDto>
contacts only.Delete Contact
DELETE /contacts/{contactId}
Requires scope: contacts.write.
Sourcepub async fn get_contact(
&self,
contact_id: &str,
) -> Result<ContactsByIdSuccessfulResponseDto>
Available on crate feature contacts only.
pub async fn get_contact( &self, contact_id: &str, ) -> Result<ContactsByIdSuccessfulResponseDto>
contacts only.Get Contact
GET /contacts/{contactId}
Requires scope: contacts.readonly.
Sourcepub async fn update_contact(
&self,
contact_id: &str,
body: &UpdateContactDto,
) -> Result<UpdateContactsSuccessfulResponseDto>
Available on crate feature contacts only.
pub async fn update_contact( &self, contact_id: &str, body: &UpdateContactDto, ) -> Result<UpdateContactsSuccessfulResponseDto>
contacts only.Update Contact
Please find the list of acceptable values for the country field here
PUT /contacts/{contactId}
Requires scope: contacts.write.
Sourcepub async fn get_appointments_for_contact(
&self,
contact_id: &str,
) -> Result<GetEventsSuccessfulResponseDto>
Available on crate feature contacts only.
pub async fn get_appointments_for_contact( &self, contact_id: &str, ) -> Result<GetEventsSuccessfulResponseDto>
contacts only.Get Appointments for Contact
GET /contacts/{contactId}/appointments
Requires scope: contacts.readonly.
Sourcepub async fn remove_contact_from_every_campaign(
&self,
contact_id: &str,
) -> Result<CreateDeleteCantactsCampaignsSuccessfulResponseDto>
Available on crate feature contacts only.
pub async fn remove_contact_from_every_campaign( &self, contact_id: &str, ) -> Result<CreateDeleteCantactsCampaignsSuccessfulResponseDto>
contacts only.Remove Contact From Every Campaign
DELETE /contacts/{contactId}/campaigns/removeAll
Requires scope: contacts.write.
Sourcepub async fn remove_contact_from_campaign(
&self,
contact_id: &str,
campaign_id: &str,
) -> Result<CreateDeleteCantactsCampaignsSuccessfulResponseDto>
Available on crate feature contacts only.
pub async fn remove_contact_from_campaign( &self, contact_id: &str, campaign_id: &str, ) -> Result<CreateDeleteCantactsCampaignsSuccessfulResponseDto>
contacts only.Remove Contact From Campaign
DELETE /contacts/{contactId}/campaigns/{campaignId}
Requires scope: contacts.write.
Sourcepub async fn add_contact_to_campaign(
&self,
contact_id: &str,
campaign_id: &str,
body: &AddContactToCampaignDto,
) -> Result<CreateDeleteCantactsCampaignsSuccessfulResponseDto>
Available on crate feature contacts only.
pub async fn add_contact_to_campaign( &self, contact_id: &str, campaign_id: &str, body: &AddContactToCampaignDto, ) -> Result<CreateDeleteCantactsCampaignsSuccessfulResponseDto>
contacts only.Add Contact to Campaign
Add contact to Campaign
POST /contacts/{contactId}/campaigns/{campaignId}
Requires scope: contacts.write.
Sourcepub async fn remove_followers(
&self,
contact_id: &str,
body: &FollowersDTO,
) -> Result<DeleteFollowersSuccessfulResponseDto>
Available on crate feature contacts only.
pub async fn remove_followers( &self, contact_id: &str, body: &FollowersDTO, ) -> Result<DeleteFollowersSuccessfulResponseDto>
contacts only.Remove Followers
DELETE /contacts/{contactId}/followers
Requires scope: contacts.write.
Sourcepub async fn add_followers(
&self,
contact_id: &str,
body: &FollowersDTO,
) -> Result<CreateAddFollowersSuccessfulResponseDto>
Available on crate feature contacts only.
pub async fn add_followers( &self, contact_id: &str, body: &FollowersDTO, ) -> Result<CreateAddFollowersSuccessfulResponseDto>
contacts only.Add Followers
POST /contacts/{contactId}/followers
Requires scope: contacts.write.
Sourcepub async fn get_all_notes(
&self,
contact_id: &str,
) -> Result<GetNotesListSuccessfulResponseDto>
Available on crate feature contacts only.
pub async fn get_all_notes( &self, contact_id: &str, ) -> Result<GetNotesListSuccessfulResponseDto>
contacts only.Get All Notes
GET /contacts/{contactId}/notes
Requires scope: contacts.readonly.
Sourcepub async fn create_note(
&self,
contact_id: &str,
body: &NotesDTO,
) -> Result<GetCreateUpdateNoteSuccessfulResponseDto>
Available on crate feature contacts only.
pub async fn create_note( &self, contact_id: &str, body: &NotesDTO, ) -> Result<GetCreateUpdateNoteSuccessfulResponseDto>
contacts only.Create Note
POST /contacts/{contactId}/notes
Requires scope: contacts.write.
Sourcepub async fn delete_note(
&self,
contact_id: &str,
id: &str,
) -> Result<DeleteNoteSuccessfulResponseDto>
Available on crate feature contacts only.
pub async fn delete_note( &self, contact_id: &str, id: &str, ) -> Result<DeleteNoteSuccessfulResponseDto>
contacts only.Delete Note
DELETE /contacts/{contactId}/notes/{id}
Requires scope: contacts.write.
Sourcepub async fn get_note(
&self,
contact_id: &str,
id: &str,
) -> Result<GetCreateUpdateNoteSuccessfulResponseDto>
Available on crate feature contacts only.
pub async fn get_note( &self, contact_id: &str, id: &str, ) -> Result<GetCreateUpdateNoteSuccessfulResponseDto>
contacts only.Get Note
GET /contacts/{contactId}/notes/{id}
Requires scope: contacts.readonly.
Sourcepub async fn update_note(
&self,
contact_id: &str,
id: &str,
body: &UpdateNoteDTO,
) -> Result<GetCreateUpdateNoteSuccessfulResponseDto>
Available on crate feature contacts only.
pub async fn update_note( &self, contact_id: &str, id: &str, body: &UpdateNoteDTO, ) -> Result<GetCreateUpdateNoteSuccessfulResponseDto>
contacts only.Update Note
PUT /contacts/{contactId}/notes/{id}
Requires scope: contacts.write.
Available on crate feature contacts only.
contacts only.Remove Tags
DELETE /contacts/{contactId}/tags
Requires scope: contacts.write.
Available on crate feature contacts only.
contacts only.Add Tags
POST /contacts/{contactId}/tags
Requires scope: contacts.write.
Sourcepub async fn get_all_tasks(
&self,
contact_id: &str,
) -> Result<TasksListSuccessfulResponseDto>
Available on crate feature contacts only.
pub async fn get_all_tasks( &self, contact_id: &str, ) -> Result<TasksListSuccessfulResponseDto>
contacts only.Get all Tasks
GET /contacts/{contactId}/tasks
Requires scope: contacts.readonly.
Sourcepub async fn create_task(
&self,
contact_id: &str,
body: &CreateTaskParams,
) -> Result<TaskByIsSuccessfulResponseDto>
Available on crate feature contacts only.
pub async fn create_task( &self, contact_id: &str, body: &CreateTaskParams, ) -> Result<TaskByIsSuccessfulResponseDto>
contacts only.Create Task
POST /contacts/{contactId}/tasks
Requires scope: contacts.write.
Sourcepub async fn delete_task(
&self,
contact_id: &str,
task_id: &str,
) -> Result<DeleteTaskSuccessfulResponseDto>
Available on crate feature contacts only.
pub async fn delete_task( &self, contact_id: &str, task_id: &str, ) -> Result<DeleteTaskSuccessfulResponseDto>
contacts only.Delete Task
DELETE /contacts/{contactId}/tasks/{taskId}
Requires scope: contacts.write.
Sourcepub async fn get_task(
&self,
contact_id: &str,
task_id: &str,
) -> Result<TaskByIsSuccessfulResponseDto>
Available on crate feature contacts only.
pub async fn get_task( &self, contact_id: &str, task_id: &str, ) -> Result<TaskByIsSuccessfulResponseDto>
contacts only.Get Task
GET /contacts/{contactId}/tasks/{taskId}
Requires scope: contacts.readonly.
Sourcepub async fn update_task(
&self,
contact_id: &str,
task_id: &str,
body: &UpdateTaskBody,
) -> Result<TaskByIsSuccessfulResponseDto>
Available on crate feature contacts only.
pub async fn update_task( &self, contact_id: &str, task_id: &str, body: &UpdateTaskBody, ) -> Result<TaskByIsSuccessfulResponseDto>
contacts only.Update Task
PUT /contacts/{contactId}/tasks/{taskId}
Requires scope: contacts.write.
Sourcepub async fn update_task_completed(
&self,
contact_id: &str,
task_id: &str,
body: &UpdateTaskStatusParams,
) -> Result<TaskByIsSuccessfulResponseDto>
Available on crate feature contacts only.
pub async fn update_task_completed( &self, contact_id: &str, task_id: &str, body: &UpdateTaskStatusParams, ) -> Result<TaskByIsSuccessfulResponseDto>
contacts only.Update Task Completed
PUT /contacts/{contactId}/tasks/{taskId}/completed
Requires scope: contacts.write.
Sourcepub async fn delete_contact_from_workflow(
&self,
contact_id: &str,
workflow_id: &str,
body: &CreateWorkflowDto,
) -> Result<ContactsWorkflowSuccessfulResponseDto>
Available on crate feature contacts only.
pub async fn delete_contact_from_workflow( &self, contact_id: &str, workflow_id: &str, body: &CreateWorkflowDto, ) -> Result<ContactsWorkflowSuccessfulResponseDto>
contacts only.Delete Contact from Workflow
DELETE /contacts/{contactId}/workflow/{workflowId}
Requires scope: contacts.write.
Sourcepub async fn add_contact_to_workflow(
&self,
contact_id: &str,
workflow_id: &str,
body: &CreateWorkflowDto,
) -> Result<ContactsWorkflowSuccessfulResponseDto>
Available on crate feature contacts only.
pub async fn add_contact_to_workflow( &self, contact_id: &str, workflow_id: &str, body: &CreateWorkflowDto, ) -> Result<ContactsWorkflowSuccessfulResponseDto>
contacts only.Add Contact to Workflow
POST /contacts/{contactId}/workflow/{workflowId}
Requires scope: contacts.write.