Class: HubSpotSDK::Resources::Marketing::MarketingEvents::Attendance

Inherits:
Object
  • Object
show all
Defined in:
lib/hubspot_sdk/resources/marketing/marketing_events/attendance.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Attendance

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 Attendance.

Parameters:



221
222
223
# File 'lib/hubspot_sdk/resources/marketing/marketing_events/attendance.rb', line 221

def initialize(client:)
  @client = client
end

Instance Method Details

#create_by_event_id_and_contact_id(subscriber_state, object_id_:, inputs:, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::BatchResponseSubscriberVidResponse

Some parameter documentations has been truncated, see Models::Marketing::MarketingEvents::AttendanceCreateByEventIDAndContactIDParams for more details.

Records the participation of multiple HubSpot contacts in a Marketing Event using their HubSpot contact IDs.

Additional Functionality:

  • Adds a timeline event to the contacts.

Allowed Properties: For the state “attend”:

  • joinedAt

  • leftAt

Parameters:

  • subscriber_state (String)

    Path param: The attendance state value. It may be ‘register’, ‘attend’ or ‘cance

  • object_id_ (String)

    Path param: The internal id of the marketing event in HubSpot.

  • inputs (Array<HubSpotSDK::Models::Marketing::MarketingEventSubscriber>)

    Body param: List of HubSpot contacts to subscribe to the marketing event

  • request_options (HubSpotSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/hubspot_sdk/resources/marketing/marketing_events/attendance.rb', line 37

def create_by_event_id_and_contact_id(subscriber_state, params)
  parsed, options =
    HubSpotSDK::Marketing::MarketingEvents::AttendanceCreateByEventIDAndContactIDParams.dump_request(params)
  object_id_ =
    parsed.delete(:object_id_) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :post,
    path: [
      "marketing/marketing-events/2026-03/%1$s/attendance/%2$s/create",
      object_id_,
      subscriber_state
    ],
    body: parsed,
    model: HubSpotSDK::Marketing::BatchResponseSubscriberVidResponse,
    options: options
  )
end

#create_by_event_id_and_email(subscriber_state, object_id_:, inputs:, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::BatchResponseSubscriberEmailResponse

Some parameter documentations has been truncated, see Models::Marketing::MarketingEvents::AttendanceCreateByEventIDAndEmailParams for more details.

Records the participation of multiple HubSpot contacts in a Marketing Event using their email addresses.

If a contact does not exist, it will be automatically created. The contactProperties field is used exclusively for creating new contacts and will not update properties of existing contacts.

Additional Functionality:

  • Adds a timeline event to the contacts.

Allowed Properties: For the state “attend”:

  • joinedAt

  • leftAt

Parameters:

Returns:

See Also:



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/hubspot_sdk/resources/marketing/marketing_events/attendance.rb', line 90

def create_by_event_id_and_email(subscriber_state, params)
  parsed, options =
    HubSpotSDK::Marketing::MarketingEvents::AttendanceCreateByEventIDAndEmailParams.dump_request(params)
  object_id_ =
    parsed.delete(:object_id_) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :post,
    path: [
      "marketing/marketing-events/2026-03/%1$s/attendance/%2$s/email-create",
      object_id_,
      subscriber_state
    ],
    body: parsed,
    model: HubSpotSDK::Marketing::BatchResponseSubscriberEmailResponse,
    options: options
  )
end

#create_by_external_event_id_and_contact_id(subscriber_state, external_event_id:, inputs:, external_account_id: nil, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::BatchResponseSubscriberVidResponse

Records the participation of multiple HubSpot contacts in a Marketing Event using their HubSpot contact IDs.

Additional Functionality:

  • Adds a timeline event to the contacts.

Allowed Properties: For the state “attend”:

  • joinedAt

  • leftAt

Parameters:

Returns:

See Also:



137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# File 'lib/hubspot_sdk/resources/marketing/marketing_events/attendance.rb', line 137

def create_by_external_event_id_and_contact_id(subscriber_state, params)
  query_params = [:external_account_id]
  parsed, options =
    HubSpotSDK::Marketing::MarketingEvents::AttendanceCreateByExternalEventIDAndContactIDParams.dump_request(
      params
    )
  query = HubSpotSDK::Internal::Util.encode_query_params(parsed.slice(*query_params))
  external_event_id =
    parsed.delete(:external_event_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :post,
    path: [
      "marketing/marketing-events/2026-03/attendance/%1$s/%2$s/create",
      external_event_id,
      subscriber_state
    ],
    query: query.transform_keys(external_account_id: "externalAccountId"),
    body: parsed.except(*query_params),
    model: HubSpotSDK::Marketing::BatchResponseSubscriberVidResponse,
    options: options
  )
end

#create_by_external_event_id_and_email(subscriber_state, external_event_id:, inputs:, external_account_id: nil, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::BatchResponseSubscriberEmailResponse

Records the participation of multiple HubSpot contacts in a Marketing Event using their email addresses.

If a contact does not exist, it will be automatically created. The contactProperties field is used exclusively for creating new contacts and will not update properties of existing contacts.

Additional Functionality:

  • Adds a timeline event to the contacts.

Allowed Properties: For the state “attend”:

  • joinedAt

  • leftAt

Parameters:

Returns:

See Also:



193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/hubspot_sdk/resources/marketing/marketing_events/attendance.rb', line 193

def create_by_external_event_id_and_email(subscriber_state, params)
  query_params = [:external_account_id]
  parsed, options =
    HubSpotSDK::Marketing::MarketingEvents::AttendanceCreateByExternalEventIDAndEmailParams.dump_request(
      params
    )
  query = HubSpotSDK::Internal::Util.encode_query_params(parsed.slice(*query_params))
  external_event_id =
    parsed.delete(:external_event_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :post,
    path: [
      "marketing/marketing-events/2026-03/attendance/%1$s/%2$s/email-create",
      external_event_id,
      subscriber_state
    ],
    query: query.transform_keys(external_account_id: "externalAccountId"),
    body: parsed.except(*query_params),
    model: HubSpotSDK::Marketing::BatchResponseSubscriberEmailResponse,
    options: options
  )
end