Class: HubSpotSDK::Resources::Conversations::CustomChannels::Messages

Inherits:
Object
  • Object
show all
Defined in:
lib/hubspot_sdk/resources/conversations/custom_channels/messages.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Messages

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Messages.

Parameters:



104
105
106
# File 'lib/hubspot_sdk/resources/conversations/custom_channels/messages.rb', line 104

def initialize(client:)
  @client = client
end

Instance Method Details

#create(channel_id, attachments:, channel_account_id:, message_direction:, recipients:, senders:, text:, timestamp:, associate_with_contact_id: nil, in_reply_to_id: nil, integration_idempotency_id: nil, integration_thread_id: nil, pre_resolved_contacts: nil, rich_text: nil, request_options: {}) ⇒ HubSpotSDK::Models::Conversations::PublicConversationsMessage

Publish a message over your custom channel



31
32
33
34
35
36
37
38
39
40
# File 'lib/hubspot_sdk/resources/conversations/custom_channels/messages.rb', line 31

def create(channel_id, params)
  parsed, options = HubSpotSDK::Conversations::CustomChannels::MessageCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["conversations/custom-channels/2026-03/%1$s/messages", channel_id],
    body: parsed,
    model: HubSpotSDK::Conversations::PublicConversationsMessage,
    options: options
  )
end

#get(message_id, channel_id:, request_options: {}) ⇒ HubSpotSDK::Models::Conversations::PublicConversationsMessage

Get the details for a specific message sent over a custom channel

Parameters:

Returns:

See Also:



87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/hubspot_sdk/resources/conversations/custom_channels/messages.rb', line 87

def get(message_id, params)
  parsed, options = HubSpotSDK::Conversations::CustomChannels::MessageGetParams.dump_request(params)
  channel_id =
    parsed.delete(:channel_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: ["conversations/custom-channels/2026-03/%1$s/messages/%2$s", channel_id, message_id],
    model: HubSpotSDK::Conversations::PublicConversationsMessage,
    options: options
  )
end

#update(message_id, channel_id:, status_type:, error_message: nil, request_options: {}) ⇒ HubSpotSDK::Models::Conversations::PublicConversationsMessage

Update a message’s status to indicate if it was successfully sent, failed to send, or was read. For failed messages, this can also include the error message for the failure.

Parameters:

Returns:

See Also:



61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/hubspot_sdk/resources/conversations/custom_channels/messages.rb', line 61

def update(message_id, params)
  parsed, options = HubSpotSDK::Conversations::CustomChannels::MessageUpdateParams.dump_request(params)
  channel_id =
    parsed.delete(:channel_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :patch,
    path: ["conversations/custom-channels/2026-03/%1$s/messages/%2$s", channel_id, message_id],
    body: parsed,
    model: HubSpotSDK::Conversations::PublicConversationsMessage,
    options: options
  )
end