pub struct ConversationsService { /* private fields */ }Expand description
Access to the Conversations API. Obtained via Ghl::conversations.
Implementations§
Source§impl ConversationsService
impl ConversationsService
Sourcepub async fn search(
&self,
location_id: &str,
query: Option<&str>,
limit: u32,
) -> Result<ConversationPage>
pub async fn search( &self, location_id: &str, query: Option<&str>, limit: u32, ) -> Result<ConversationPage>
GET /conversations/search — find threads in a location.
Sourcepub async fn messages(
&self,
conversation_id: &str,
limit: u32,
) -> Result<MessagePage>
pub async fn messages( &self, conversation_id: &str, limit: u32, ) -> Result<MessagePage>
GET /conversations/{id}/messages — messages in a thread, newest first.
Sourcepub async fn send_message(
&self,
message: SendMessage,
) -> Result<SendMessageResult>
pub async fn send_message( &self, message: SendMessage, ) -> Result<SendMessageResult>
POST /conversations/messages — send an SMS, email, or channel message.
Source§impl ConversationsService
impl ConversationsService
Sourcepub async fn create_conversation(
&self,
body: &CreateConversationDto,
) -> Result<CreateConversationSuccessResponse>
Available on crate feature conversations only.
pub async fn create_conversation( &self, body: &CreateConversationDto, ) -> Result<CreateConversationSuccessResponse>
conversations only.Create Conversation
Creates a new conversation with the data provided
POST /conversations/
Requires scope: conversations.write.
Sourcepub async fn get_transcription_by_message_id(
&self,
location_id: &str,
message_id: &str,
) -> Result<GetMessageTranscriptionResponseDto>
Available on crate feature conversations only.
pub async fn get_transcription_by_message_id( &self, location_id: &str, message_id: &str, ) -> Result<GetMessageTranscriptionResponseDto>
conversations only.Get transcription by Message ID
Get the recording transcription for a message by passing the message id
GET /conversations/locations/{locationId}/messages/{messageId}/transcription
Requires scope: conversations/message.readonly.
Sourcepub async fn download_transcription_by_message_id(
&self,
location_id: &str,
message_id: &str,
) -> Result<Value>
Available on crate feature conversations only.
pub async fn download_transcription_by_message_id( &self, location_id: &str, message_id: &str, ) -> Result<Value>
conversations only.Download transcription by Message ID
Download the recording transcription for a message by passing the message id
GET /conversations/locations/{locationId}/messages/{messageId}/transcription/download
Requires scope: conversations/message.readonly.
Sourcepub async fn send_a_new_message(
&self,
body: &SendMessageBodyDto,
) -> Result<SendMessageResponseDto>
Available on crate feature conversations only.
pub async fn send_a_new_message( &self, body: &SendMessageBodyDto, ) -> Result<SendMessageResponseDto>
conversations only.Send a new message
Post the necessary fields for the API to send a new message.
POST /conversations/messages
Requires scope: conversations/message.write.
Sourcepub async fn cancel_a_scheduled_email_message(
&self,
email_message_id: &str,
) -> Result<CancelScheduledResponseDto>
Available on crate feature conversations only.
pub async fn cancel_a_scheduled_email_message( &self, email_message_id: &str, ) -> Result<CancelScheduledResponseDto>
conversations only.Cancel a scheduled email message.
Post the messageId for the API to delete a scheduled email message.
DELETE /conversations/messages/email/{emailMessageId}/schedule
Sourcepub async fn get_email_by_id(
&self,
id: &str,
) -> Result<GetEmailMessageResponseDto>
Available on crate feature conversations only.
pub async fn get_email_by_id( &self, id: &str, ) -> Result<GetEmailMessageResponseDto>
conversations only.Get email by Id
GET /conversations/messages/email/{id}
Sourcepub async fn export_messages_by_location_id(
&self,
params: &ExportMessagesByLocationIdParams,
) -> Result<ExportMessagesResponseDto>
Available on crate feature conversations only.
pub async fn export_messages_by_location_id( &self, params: &ExportMessagesByLocationIdParams, ) -> Result<ExportMessagesResponseDto>
conversations only.Export messages by location ID
Export messages for a specific location with cursor-based pagination support. Response includes messageType (string), source, and subType fields. The channel parameter is optional - if not provided, all non-email message types will be returned including activity messages (opportunity updates, appointments, etc.).
GET /conversations/messages/export
Requires scope: conversations/message.readonly.
Sourcepub async fn add_an_inbound_message(
&self,
body: &ProcessMessageBodyDto,
) -> Result<ProcessMessageResponseDto>
Available on crate feature conversations only.
pub async fn add_an_inbound_message( &self, body: &ProcessMessageBodyDto, ) -> Result<ProcessMessageResponseDto>
conversations only.Add an inbound message
Post the necessary fields for the API to add a new inbound message.
POST /conversations/messages/inbound
Requires scope: conversations/message.write.
Sourcepub async fn add_an_external_outbound_call(
&self,
body: &ProcessOutboundMessageBodyDto,
) -> Result<ProcessMessageResponseDto>
Available on crate feature conversations only.
pub async fn add_an_external_outbound_call( &self, body: &ProcessOutboundMessageBodyDto, ) -> Result<ProcessMessageResponseDto>
conversations only.Add an external outbound call
Post the necessary fields for the API to add a new outbound call.
POST /conversations/messages/outbound
Requires scope: conversations/message.write.
Sourcepub async fn send_a_review_reply_to_google_my_business(
&self,
body: &SendReviewReplyDto,
) -> Result<SendMessageResponseDto>
Available on crate feature conversations only.
pub async fn send_a_review_reply_to_google_my_business( &self, body: &SendReviewReplyDto, ) -> Result<SendMessageResponseDto>
conversations only.Send a review reply to Google My Business
Post a reply to a customer review on Google My Business
POST /conversations/messages/review-reply
Requires scope: conversations/message.write.
Sourcepub async fn upload_file_attachments(
&self,
body: &Value,
) -> Result<UploadFilesResponseDto>
Available on crate feature conversations only.
pub async fn upload_file_attachments( &self, body: &Value, ) -> Result<UploadFilesResponseDto>
conversations only.Upload file attachments
Post the necessary fields for the API to upload files. The files need to be a buffer with the key “fileAttachment”. The allowed file types are: JPG JPEG PNG MP4 MPEG ZIP RAR PDF DOC DOCX TXT MP3 WAV The API will return an object with the URLs
POST /conversations/messages/upload
Requires scope: conversations/message.write.
Sourcepub async fn complete_file_upload(
&self,
body: &CompleteFileUploadDto,
) -> Result<CompleteFileUploadResponseDto>
Available on crate feature conversations only.
pub async fn complete_file_upload( &self, body: &CompleteFileUploadDto, ) -> Result<CompleteFileUploadResponseDto>
conversations only.Complete file upload
Validates the uploaded file in GCS and returns the public URL. Call this endpoint after successfully uploading the file to the signed URL.
POST /conversations/messages/upload/complete
Requires scope: conversations/message.write.
Sourcepub async fn initiate_file_upload_to_gcs(
&self,
body: &InitiateFileUploadDto,
) -> Result<InitiateFileUploadResponseDto>
Available on crate feature conversations only.
pub async fn initiate_file_upload_to_gcs( &self, body: &InitiateFileUploadDto, ) -> Result<InitiateFileUploadResponseDto>
conversations only.Initiate file upload to GCS
Generates a signed URL for direct file upload to Google Cloud Storage. Returns a signed URL valid for 15 minutes. Upload file via PUT request, then call /complete to finalize.
POST /conversations/messages/upload/initiate
Requires scope: conversations/message.write.
Sourcepub async fn get_message_by_message_id(
&self,
id: &str,
) -> Result<GetMessageResponseDto>
Available on crate feature conversations only.
pub async fn get_message_by_message_id( &self, id: &str, ) -> Result<GetMessageResponseDto>
conversations only.Get message by message id
Get message by message id.
GET /conversations/messages/{id}
Requires scope: conversations/message.readonly.
Sourcepub async fn add_message_attachments(
&self,
message_id: &str,
body: &AddMessageAttachmentsDto,
) -> Result<Value>
Available on crate feature conversations only.
pub async fn add_message_attachments( &self, message_id: &str, body: &AddMessageAttachmentsDto, ) -> Result<Value>
conversations only.Add message attachments
Set attachments on an existing message (replaces existing). Maximum 5 URLs. Supported for TYPE_CUSTOM_CALL (34) and TYPE_CALL (1) with subType EXTERNAL_CALL.
PUT /conversations/messages/{messageId}/attachments
Requires scope: conversations/message.write.
Sourcepub async fn get_recording_by_message_id(
&self,
message_id: &str,
location_id: &str,
) -> Result<Value>
Available on crate feature conversations only.
pub async fn get_recording_by_message_id( &self, message_id: &str, location_id: &str, ) -> Result<Value>
conversations only.Get Recording by Message ID
Get the recording for a message by passing the message id
GET /conversations/messages/{messageId}/locations/{locationId}/recording
Requires scope: conversations/message.readonly.
Sourcepub async fn cancel_a_scheduled_message(
&self,
message_id: &str,
) -> Result<CancelScheduledResponseDto>
Available on crate feature conversations only.
pub async fn cancel_a_scheduled_message( &self, message_id: &str, ) -> Result<CancelScheduledResponseDto>
conversations only.Cancel a scheduled message.
Post the messageId for the API to delete a scheduled message.
DELETE /conversations/messages/{messageId}/schedule
Requires scope: conversations/message.write.
Sourcepub async fn update_message_status(
&self,
message_id: &str,
body: &UpdateMessageStatusDto,
) -> Result<SendMessageResponseDto>
Available on crate feature conversations only.
pub async fn update_message_status( &self, message_id: &str, body: &UpdateMessageStatusDto, ) -> Result<SendMessageResponseDto>
conversations only.Update message status
Post the necessary fields for the API to update message status.
PUT /conversations/messages/{messageId}/status
Requires scope: conversations/message.write.
Sourcepub async fn get_all_custom_subtypes(
&self,
params: &GetAllCustomSubtypesParams,
) -> Result<Value>
Available on crate feature conversations only.
pub async fn get_all_custom_subtypes( &self, params: &GetAllCustomSubtypesParams, ) -> Result<Value>
conversations only.Get All Custom Subtypes
Get all custom subtypes for a location
GET /conversations/preferences/custom-subtypes
Sourcepub async fn create_custom_subtype(
&self,
params: &CreateCustomSubtypeParams,
body: &CreateCustomSubtypeDto,
) -> Result<Value>
Available on crate feature conversations only.
pub async fn create_custom_subtype( &self, params: &CreateCustomSubtypeParams, body: &CreateCustomSubtypeDto, ) -> Result<Value>
conversations only.Create Custom Subtype
Create a new custom subtype for a location. Requires agency or account admin role.
POST /conversations/preferences/custom-subtypes
Sourcepub async fn update_custom_subtype(
&self,
id: &str,
params: &UpdateCustomSubtypeParams,
body: &UpdateCustomSubtypeDto,
) -> Result<Value>
Available on crate feature conversations only.
pub async fn update_custom_subtype( &self, id: &str, params: &UpdateCustomSubtypeParams, body: &UpdateCustomSubtypeDto, ) -> Result<Value>
conversations only.Update Custom Subtype
Update or archive a custom subtype. Requires agency or account admin role.
PUT /conversations/preferences/custom-subtypes/{id}
Sourcepub async fn get_contact_unsubscription_status(
&self,
params: &GetContactUnsubscriptionStatusParams,
) -> Result<Value>
Available on crate feature conversations only.
pub async fn get_contact_unsubscription_status( &self, params: &GetContactUnsubscriptionStatusParams, ) -> Result<Value>
conversations only.Get Contact Unsubscription Status
Get all subscription statuses for a contact (all emails or specific email)
GET /conversations/preferences/unsubscriptions/status
Sourcepub async fn user_subscription_change(
&self,
body: &UserSubscriptionChangeDto,
) -> Result<Value>
Available on crate feature conversations only.
pub async fn user_subscription_change( &self, body: &UserSubscriptionChangeDto, ) -> Result<Value>
conversations only.User Subscription Change
Process subscription change initiated by a user (admin/agent). Supports individual custom subscription changes and resub all functionality. Legal forms are automatically created for user-initiated resubscribe actions on custom subscriptions.
POST /conversations/preferences/unsubscriptions/user-change
Sourcepub async fn agent_ai_bot_is_typing_a_message_indicator_for_live_chat(
&self,
body: &UserTypingBody,
) -> Result<CreateLiveChatMessageFeedbackResponse>
Available on crate feature conversations only.
pub async fn agent_ai_bot_is_typing_a_message_indicator_for_live_chat( &self, body: &UserTypingBody, ) -> Result<CreateLiveChatMessageFeedbackResponse>
conversations only.Agent/Ai-Bot is typing a message indicator for live chat
Agent/AI-Bot will call this when they are typing a message in live chat message
POST /conversations/providers/live-chat/typing
Requires scope: conversations/livechat.write.
Sourcepub async fn search_conversations(
&self,
params: &SearchConversationsParams,
) -> Result<SendConversationResponseDto>
Available on crate feature conversations only.
pub async fn search_conversations( &self, params: &SearchConversationsParams, ) -> Result<SendConversationResponseDto>
conversations only.Search Conversations
Returns a list of all conversations matching the search criteria along with the sort and filter options selected.
GET /conversations/search
Requires scope: conversations.readonly.
Sourcepub async fn delete_conversation(
&self,
conversation_id: &str,
) -> Result<DeleteConversationSuccessfulResponse>
Available on crate feature conversations only.
pub async fn delete_conversation( &self, conversation_id: &str, ) -> Result<DeleteConversationSuccessfulResponse>
conversations only.Delete Conversation
Delete the conversation details based on the conversation ID
DELETE /conversations/{conversationId}
Requires scope: conversations.write.
Sourcepub async fn get_conversation(
&self,
conversation_id: &str,
) -> Result<GetConversationByIdResponse>
Available on crate feature conversations only.
pub async fn get_conversation( &self, conversation_id: &str, ) -> Result<GetConversationByIdResponse>
conversations only.Get Conversation
Get the conversation details based on the conversation ID
GET /conversations/{conversationId}
Requires scope: conversations.readonly.
Sourcepub async fn update_conversation(
&self,
conversation_id: &str,
body: &UpdateConversationDto,
) -> Result<GetConversationSuccessfulResponse>
Available on crate feature conversations only.
pub async fn update_conversation( &self, conversation_id: &str, body: &UpdateConversationDto, ) -> Result<GetConversationSuccessfulResponse>
conversations only.Update Conversation
Update the conversation details based on the conversation ID
PUT /conversations/{conversationId}
Requires scope: conversations.write.
Sourcepub async fn get_messages_by_conversation_id(
&self,
conversation_id: &str,
params: &GetMessagesByConversationIdParams,
) -> Result<GetMessagesByConversationResponseDto>
Available on crate feature conversations only.
pub async fn get_messages_by_conversation_id( &self, conversation_id: &str, params: &GetMessagesByConversationIdParams, ) -> Result<GetMessagesByConversationResponseDto>
conversations only.Get messages by conversation id
Get messages by conversation id.
GET /conversations/{conversationId}/messages
Requires scope: conversations/message.readonly.