Skip to main content

ContactsService

Struct ContactsService 

Source
pub struct ContactsService { /* private fields */ }
Expand description

Access to the Contacts API. Obtained via Ghl::contacts.

Implementations§

Source§

impl ContactsService

Source

pub async fn create(&self, contact: CreateContact) -> Result<Contact>

POST /contacts/

Source

pub async fn get(&self, contact_id: &str) -> Result<Contact>

GET /contacts/{id}

Source

pub async fn update( &self, contact_id: &str, update: UpdateContact, ) -> Result<Contact>

PUT /contacts/{id}

Source

pub async fn delete(&self, contact_id: &str) -> Result<()>

DELETE /contacts/{id}

Source

pub fn list(&self, location_id: impl Into<String>) -> ListContacts

GET /contacts/ — returns a lazy request builder.

Source§

impl ContactsService

Source

pub async fn get_contacts( &self, params: &GetContactsParams, ) -> Result<ContactsSearchSuccessfulResponseDto>

Available on crate feature 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.

Source

pub async fn create_contact( &self, body: &CreateContactDto, ) -> Result<CreateContactsSuccessfulResponseDto>

Available on crate feature contacts only.

Create Contact

Please find the list of acceptable values for the country field here

POST /contacts/

Requires scope: contacts.write.

Source

pub async fn add_remove_contacts_from_business( &self, body: &ContactsBusinessUpdate, ) -> Result<ContactsBulkUpateResponse>

Available on crate feature 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

Source

pub async fn update_contacts_tags( &self, type_: &str, body: &UpdateTagsDTO, ) -> Result<UpdateTagsResponseDTO>

Available on crate feature 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}

Source

pub async fn get_contacts_by_business_id( &self, business_id: &str, params: &GetContactsByBusinessIdParams, ) -> Result<ContactsSearchSuccessfulResponseDto>

Available on crate feature contacts only.

Get Contacts By BusinessId

GET /contacts/business/{businessId}

Requires scope: contacts.readonly.

Source

pub async fn search_contacts(&self, body: &SearchBodyV2DTO) -> Result<Value>

Available on crate feature 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.

Source

pub async fn get_duplicate_contact( &self, params: &GetDuplicateContactParams, ) -> Result<Value>

Available on crate feature 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.

Source

pub async fn upsert_contact( &self, body: &UpsertContactDto, ) -> Result<UpsertContactsSuccessfulResponseDto>

Available on crate feature 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.

Source

pub async fn delete_contact( &self, contact_id: &str, ) -> Result<DeleteContactsSuccessfulResponseDto>

Available on crate feature contacts only.

Delete Contact

DELETE /contacts/{contactId}

Requires scope: contacts.write.

Source

pub async fn get_contact( &self, contact_id: &str, ) -> Result<ContactsByIdSuccessfulResponseDto>

Available on crate feature contacts only.

Get Contact

GET /contacts/{contactId}

Requires scope: contacts.readonly.

Source

pub async fn update_contact( &self, contact_id: &str, body: &UpdateContactDto, ) -> Result<UpdateContactsSuccessfulResponseDto>

Available on crate feature contacts only.

Update Contact

Please find the list of acceptable values for the country field here

PUT /contacts/{contactId}

Requires scope: contacts.write.

Source

pub async fn get_appointments_for_contact( &self, contact_id: &str, ) -> Result<GetEventsSuccessfulResponseDto>

Available on crate feature contacts only.

Get Appointments for Contact

GET /contacts/{contactId}/appointments

Requires scope: contacts.readonly.

Source

pub async fn remove_contact_from_every_campaign( &self, contact_id: &str, ) -> Result<CreateDeleteCantactsCampaignsSuccessfulResponseDto>

Available on crate feature contacts only.

Remove Contact From Every Campaign

DELETE /contacts/{contactId}/campaigns/removeAll

Requires scope: contacts.write.

Source

pub async fn remove_contact_from_campaign( &self, contact_id: &str, campaign_id: &str, ) -> Result<CreateDeleteCantactsCampaignsSuccessfulResponseDto>

Available on crate feature contacts only.

Remove Contact From Campaign

DELETE /contacts/{contactId}/campaigns/{campaignId}

Requires scope: contacts.write.

Source

pub async fn add_contact_to_campaign( &self, contact_id: &str, campaign_id: &str, body: &AddContactToCampaignDto, ) -> Result<CreateDeleteCantactsCampaignsSuccessfulResponseDto>

Available on crate feature contacts only.

Add Contact to Campaign

Add contact to Campaign

POST /contacts/{contactId}/campaigns/{campaignId}

Requires scope: contacts.write.

Source

pub async fn remove_followers( &self, contact_id: &str, body: &FollowersDTO, ) -> Result<DeleteFollowersSuccessfulResponseDto>

Available on crate feature contacts only.

Remove Followers

DELETE /contacts/{contactId}/followers

Requires scope: contacts.write.

Source

pub async fn add_followers( &self, contact_id: &str, body: &FollowersDTO, ) -> Result<CreateAddFollowersSuccessfulResponseDto>

Available on crate feature contacts only.

Add Followers

POST /contacts/{contactId}/followers

Requires scope: contacts.write.

Source

pub async fn get_all_notes( &self, contact_id: &str, ) -> Result<GetNotesListSuccessfulResponseDto>

Available on crate feature contacts only.

Get All Notes

GET /contacts/{contactId}/notes

Requires scope: contacts.readonly.

Source

pub async fn create_note( &self, contact_id: &str, body: &NotesDTO, ) -> Result<GetCreateUpdateNoteSuccessfulResponseDto>

Available on crate feature contacts only.

Create Note

POST /contacts/{contactId}/notes

Requires scope: contacts.write.

Source

pub async fn delete_note( &self, contact_id: &str, id: &str, ) -> Result<DeleteNoteSuccessfulResponseDto>

Available on crate feature contacts only.

Delete Note

DELETE /contacts/{contactId}/notes/{id}

Requires scope: contacts.write.

Source

pub async fn get_note( &self, contact_id: &str, id: &str, ) -> Result<GetCreateUpdateNoteSuccessfulResponseDto>

Available on crate feature contacts only.

Get Note

GET /contacts/{contactId}/notes/{id}

Requires scope: contacts.readonly.

Source

pub async fn update_note( &self, contact_id: &str, id: &str, body: &UpdateNoteDTO, ) -> Result<GetCreateUpdateNoteSuccessfulResponseDto>

Available on crate feature contacts only.

Update Note

PUT /contacts/{contactId}/notes/{id}

Requires scope: contacts.write.

Source

pub async fn remove_tags( &self, contact_id: &str, body: &TagsDTO, ) -> Result<CreateDeleteTagSuccessfulResponseDto>

Available on crate feature contacts only.

Remove Tags

DELETE /contacts/{contactId}/tags

Requires scope: contacts.write.

Source

pub async fn add_tags( &self, contact_id: &str, body: &TagsDTO, ) -> Result<CreateAddTagSuccessfulResponseDto>

Available on crate feature contacts only.

Add Tags

POST /contacts/{contactId}/tags

Requires scope: contacts.write.

Source

pub async fn get_all_tasks( &self, contact_id: &str, ) -> Result<TasksListSuccessfulResponseDto>

Available on crate feature contacts only.

Get all Tasks

GET /contacts/{contactId}/tasks

Requires scope: contacts.readonly.

Source

pub async fn create_task( &self, contact_id: &str, body: &CreateTaskParams, ) -> Result<TaskByIsSuccessfulResponseDto>

Available on crate feature contacts only.

Create Task

POST /contacts/{contactId}/tasks

Requires scope: contacts.write.

Source

pub async fn delete_task( &self, contact_id: &str, task_id: &str, ) -> Result<DeleteTaskSuccessfulResponseDto>

Available on crate feature contacts only.

Delete Task

DELETE /contacts/{contactId}/tasks/{taskId}

Requires scope: contacts.write.

Source

pub async fn get_task( &self, contact_id: &str, task_id: &str, ) -> Result<TaskByIsSuccessfulResponseDto>

Available on crate feature contacts only.

Get Task

GET /contacts/{contactId}/tasks/{taskId}

Requires scope: contacts.readonly.

Source

pub async fn update_task( &self, contact_id: &str, task_id: &str, body: &UpdateTaskBody, ) -> Result<TaskByIsSuccessfulResponseDto>

Available on crate feature contacts only.

Update Task

PUT /contacts/{contactId}/tasks/{taskId}

Requires scope: contacts.write.

Source

pub async fn update_task_completed( &self, contact_id: &str, task_id: &str, body: &UpdateTaskStatusParams, ) -> Result<TaskByIsSuccessfulResponseDto>

Available on crate feature contacts only.

Update Task Completed

PUT /contacts/{contactId}/tasks/{taskId}/completed

Requires scope: contacts.write.

Source

pub async fn delete_contact_from_workflow( &self, contact_id: &str, workflow_id: &str, body: &CreateWorkflowDto, ) -> Result<ContactsWorkflowSuccessfulResponseDto>

Available on crate feature contacts only.

Delete Contact from Workflow

DELETE /contacts/{contactId}/workflow/{workflowId}

Requires scope: contacts.write.

Source

pub async fn add_contact_to_workflow( &self, contact_id: &str, workflow_id: &str, body: &CreateWorkflowDto, ) -> Result<ContactsWorkflowSuccessfulResponseDto>

Available on crate feature contacts only.

Add Contact to Workflow

POST /contacts/{contactId}/workflow/{workflowId}

Requires scope: contacts.write.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more