Class: HubSpotSDK::Resources::Marketing::MarketingEvents
- Inherits:
-
Object
- Object
- HubSpotSDK::Resources::Marketing::MarketingEvents
- Defined in:
- lib/hubspot_sdk/resources/marketing/marketing_events.rb,
lib/hubspot_sdk/resources/marketing/marketing_events/events.rb,
lib/hubspot_sdk/resources/marketing/marketing_events/settings.rb,
lib/hubspot_sdk/resources/marketing/marketing_events/attendance.rb,
lib/hubspot_sdk/resources/marketing/marketing_events/participations.rb,
lib/hubspot_sdk/resources/marketing/marketing_events/subscriber_state.rb,
lib/hubspot_sdk/resources/marketing/marketing_events/list_associations.rb
Defined Under Namespace
Classes: Attendance, Events, ListAssociations, Participations, Settings, SubscriberState
Instance Attribute Summary collapse
- #attendance ⇒ HubSpotSDK::Resources::Marketing::MarketingEvents::Attendance readonly
- #events ⇒ HubSpotSDK::Resources::Marketing::MarketingEvents::Events readonly
- #list_associations ⇒ HubSpotSDK::Resources::Marketing::MarketingEvents::ListAssociations readonly
- #participations ⇒ HubSpotSDK::Resources::Marketing::MarketingEvents::Participations readonly
- #settings ⇒ HubSpotSDK::Resources::Marketing::MarketingEvents::Settings readonly
- #subscriber_state ⇒ HubSpotSDK::Resources::Marketing::MarketingEvents::SubscriberState readonly
Instance Method Summary collapse
-
#create(custom_properties:, event_name:, event_organizer:, external_account_id:, external_event_id:, end_date_time: nil, event_cancelled: nil, event_completed: nil, event_description: nil, event_type: nil, event_url: nil, start_date_time: nil, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::MarketingEventDefaultResponse
Some parameter documentations has been truncated, see Models::Marketing::MarketingEventCreateParams for more details.
-
#delete(object_id_, request_options: {}) ⇒ nil
Deletes the existing Marketing Event with the specified objectId, if it exists.
-
#delete_batch(inputs:, request_options: {}) ⇒ StringIO
Deletes multiple Marketing Events from the portal based on their objectId, if they exist.
-
#delete_batch_by_external_event_id(inputs:, request_options: {}) ⇒ StringIO
Deletes multiple Marketing Events based on externalAccountId, externalEventId, and appId.
-
#delete_by_external_event_id(external_event_id, external_account_id:, request_options: {}) ⇒ nil
Deletes the existing Marketing Event with the specified externalAccountId, externalEventId, if it exists.
-
#get(object_id_, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::MarketingEventPublicReadResponseV2
Returns the details of a Marketing Event with the specified objectId, if it exists.
-
#get_by_external_event_id(external_event_id, external_account_id:, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::MarketingEventPublicReadResponse
Returns the details of a Marketing Event with the specified externalAccountId, externalEventId, if it exists.
-
#initialize(client:) ⇒ MarketingEvents
constructor
private
A new instance of MarketingEvents.
- #list(after: nil, limit: nil, request_options: {}) ⇒ HubSpotSDK::Internal::Page<HubSpotSDK::Models::Marketing::MarketingEventPublicReadResponseV2>
-
#search_by_external_event_id(q:, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::CollectionResponseSearchPublicResponseWrapperNoPaging
Retrieves Marketing Events where the externalEventId matches the value provided in the request, limited to events created by the app making the request.
-
#search_identifiers_by_external_event_id(external_event_id, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::CollectionResponseWithTotalMarketingEventIdentifiersResponse
This endpoint searches the portal for all Marketing Events whose externalEventId matches the value provided in the request.
-
#update(object_id_, custom_properties:, end_date_time: nil, event_cancelled: nil, event_description: nil, event_name: nil, event_organizer: nil, event_type: nil, event_url: nil, start_date_time: nil, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::MarketingEventPublicDefaultResponseV2
Some parameter documentations has been truncated, see Models::Marketing::MarketingEventUpdateParams for more details.
-
#update_batch(inputs:, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::BatchResponseMarketingEventPublicDefaultResponseV2
Updates multiple Marketing Events on the portal based on their objectId, if they exist.
-
#update_by_external_event_id(external_event_id, external_account_id:, custom_properties:, end_date_time: nil, event_cancelled: nil, event_completed: nil, event_description: nil, event_name: nil, event_organizer: nil, event_type: nil, event_url: nil, start_date_time: nil, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::MarketingEventPublicDefaultResponse
Some parameter documentations has been truncated, see Models::Marketing::MarketingEventUpdateByExternalEventIDParams for more details.
-
#upsert_batch(inputs:, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::BatchResponseMarketingEventPublicDefaultResponse
Upserts multiple Marketing Events.
-
#upsert_by_external_event_id(path_external_event_id, custom_properties:, event_name:, event_organizer:, external_account_id:, body_external_event_id:, end_date_time: nil, event_cancelled: nil, event_completed: nil, event_description: nil, event_type: nil, event_url: nil, start_date_time: nil, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::MarketingEventPublicDefaultResponse
Some parameter documentations has been truncated, see Models::Marketing::MarketingEventUpsertByExternalEventIDParams for more details.
Constructor Details
#initialize(client:) ⇒ MarketingEvents
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 MarketingEvents.
497 498 499 500 501 502 503 504 505 506 507 |
# File 'lib/hubspot_sdk/resources/marketing/marketing_events.rb', line 497 def initialize(client:) @client = client @attendance = HubSpotSDK::Resources::Marketing::MarketingEvents::Attendance.new(client: client) @events = HubSpotSDK::Resources::Marketing::MarketingEvents::Events.new(client: client) @list_associations = HubSpotSDK::Resources::Marketing::MarketingEvents::ListAssociations.new(client: client) @participations = HubSpotSDK::Resources::Marketing::MarketingEvents::Participations.new(client: client) @settings = HubSpotSDK::Resources::Marketing::MarketingEvents::Settings.new(client: client) @subscriber_state = HubSpotSDK::Resources::Marketing::MarketingEvents::SubscriberState.new(client: client) end |
Instance Attribute Details
#attendance ⇒ HubSpotSDK::Resources::Marketing::MarketingEvents::Attendance (readonly)
8 9 10 |
# File 'lib/hubspot_sdk/resources/marketing/marketing_events.rb', line 8 def attendance @attendance end |
#events ⇒ HubSpotSDK::Resources::Marketing::MarketingEvents::Events (readonly)
11 12 13 |
# File 'lib/hubspot_sdk/resources/marketing/marketing_events.rb', line 11 def events @events end |
#list_associations ⇒ HubSpotSDK::Resources::Marketing::MarketingEvents::ListAssociations (readonly)
14 15 16 |
# File 'lib/hubspot_sdk/resources/marketing/marketing_events.rb', line 14 def list_associations @list_associations end |
#participations ⇒ HubSpotSDK::Resources::Marketing::MarketingEvents::Participations (readonly)
17 18 19 |
# File 'lib/hubspot_sdk/resources/marketing/marketing_events.rb', line 17 def participations @participations end |
#settings ⇒ HubSpotSDK::Resources::Marketing::MarketingEvents::Settings (readonly)
20 21 22 |
# File 'lib/hubspot_sdk/resources/marketing/marketing_events.rb', line 20 def settings @settings end |
#subscriber_state ⇒ HubSpotSDK::Resources::Marketing::MarketingEvents::SubscriberState (readonly)
23 24 25 |
# File 'lib/hubspot_sdk/resources/marketing/marketing_events.rb', line 23 def subscriber_state @subscriber_state end |
Instance Method Details
#create(custom_properties:, event_name:, event_organizer:, external_account_id:, external_event_id:, end_date_time: nil, event_cancelled: nil, event_completed: nil, event_description: nil, event_type: nil, event_url: nil, start_date_time: nil, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::MarketingEventDefaultResponse
Some parameter documentations has been truncated, see Models::Marketing::MarketingEventCreateParams for more details.
Creates a new marketing event in HubSpot
61 62 63 64 65 66 67 68 69 70 |
# File 'lib/hubspot_sdk/resources/marketing/marketing_events.rb', line 61 def create(params) parsed, = HubSpotSDK::Marketing::MarketingEventCreateParams.dump_request(params) @client.request( method: :post, path: "marketing/marketing-events/2026-03/events", body: parsed, model: HubSpotSDK::Marketing::MarketingEventDefaultResponse, options: ) end |
#delete(object_id_, request_options: {}) ⇒ nil
Deletes the existing Marketing Event with the specified objectId, if it exists.
151 152 153 154 155 156 157 158 |
# File 'lib/hubspot_sdk/resources/marketing/marketing_events.rb', line 151 def delete(object_id_, params = {}) @client.request( method: :delete, path: ["marketing/marketing-events/2026-03/%1$s", object_id_], model: NilClass, options: params[:request_options] ) end |
#delete_batch(inputs:, request_options: {}) ⇒ StringIO
Deletes multiple Marketing Events from the portal based on their objectId, if they exist.
Responses: 204: Returned if all specified Marketing Events were successfully deleted. 207: Returned if some objectIds did not correspond to any existing Marketing Events.
175 176 177 178 179 180 181 182 183 184 185 |
# File 'lib/hubspot_sdk/resources/marketing/marketing_events.rb', line 175 def delete_batch(params) parsed, = HubSpotSDK::Marketing::MarketingEventDeleteBatchParams.dump_request(params) @client.request( method: :post, path: "marketing/marketing-events/2026-03/batch/archive", headers: {"accept" => "*/*"}, body: parsed, model: StringIO, options: ) end |
#delete_batch_by_external_event_id(inputs:, request_options: {}) ⇒ StringIO
Deletes multiple Marketing Events based on externalAccountId, externalEventId, and appId.
Only Marketing Events created by the same apps will be deleted; events from other apps cannot be removed by this endpoint.
201 202 203 204 205 206 207 208 209 210 211 212 |
# File 'lib/hubspot_sdk/resources/marketing/marketing_events.rb', line 201 def delete_batch_by_external_event_id(params) parsed, = HubSpotSDK::Marketing::MarketingEventDeleteBatchByExternalEventIDParams.dump_request(params) @client.request( method: :post, path: "marketing/marketing-events/2026-03/events/delete", headers: {"accept" => "*/*"}, body: parsed, model: StringIO, options: ) end |
#delete_by_external_event_id(external_event_id, external_account_id:, request_options: {}) ⇒ nil
Deletes the existing Marketing Event with the specified externalAccountId, externalEventId, if it exists.
Only Marketing Events created by the same app can be deleted.
228 229 230 231 232 233 234 235 236 237 238 |
# File 'lib/hubspot_sdk/resources/marketing/marketing_events.rb', line 228 def delete_by_external_event_id(external_event_id, params) parsed, = HubSpotSDK::Marketing::MarketingEventDeleteByExternalEventIDParams.dump_request(params) query = HubSpotSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :delete, path: ["marketing/marketing-events/2026-03/events/%1$s", external_event_id], query: query.transform_keys(external_account_id: "externalAccountId"), model: NilClass, options: ) end |
#get(object_id_, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::MarketingEventPublicReadResponseV2
Returns the details of a Marketing Event with the specified objectId, if it exists.
252 253 254 255 256 257 258 259 |
# File 'lib/hubspot_sdk/resources/marketing/marketing_events.rb', line 252 def get(object_id_, params = {}) @client.request( method: :get, path: ["marketing/marketing-events/2026-03/%1$s", object_id_], model: HubSpotSDK::Marketing::MarketingEventPublicReadResponseV2, options: params[:request_options] ) end |
#get_by_external_event_id(external_event_id, external_account_id:, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::MarketingEventPublicReadResponse
Returns the details of a Marketing Event with the specified externalAccountId, externalEventId, if it exists.
Only Marketing Events created by the same app making the request can be retrieved.
276 277 278 279 280 281 282 283 284 285 286 |
# File 'lib/hubspot_sdk/resources/marketing/marketing_events.rb', line 276 def get_by_external_event_id(external_event_id, params) parsed, = HubSpotSDK::Marketing::MarketingEventGetByExternalEventIDParams.dump_request(params) query = HubSpotSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["marketing/marketing-events/2026-03/events/%1$s", external_event_id], query: query.transform_keys(external_account_id: "externalAccountId"), model: HubSpotSDK::Marketing::MarketingEventPublicReadResponse, options: ) end |
#list(after: nil, limit: nil, request_options: {}) ⇒ HubSpotSDK::Internal::Page<HubSpotSDK::Models::Marketing::MarketingEventPublicReadResponseV2>
127 128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/hubspot_sdk/resources/marketing/marketing_events.rb', line 127 def list(params = {}) parsed, = HubSpotSDK::Marketing::MarketingEventListParams.dump_request(params) query = HubSpotSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "marketing/marketing-events/2026-03", query: query, page: HubSpotSDK::Internal::Page, model: HubSpotSDK::Marketing::MarketingEventPublicReadResponseV2, options: ) end |
#search_by_external_event_id(q:, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::CollectionResponseSearchPublicResponseWrapperNoPaging
Retrieves Marketing Events where the externalEventId matches the value provided in the request, limited to events created by the app making the request.
Marketing Events created by other apps will not be included in the results.
301 302 303 304 305 306 307 308 309 310 311 |
# File 'lib/hubspot_sdk/resources/marketing/marketing_events.rb', line 301 def search_by_external_event_id(params) parsed, = HubSpotSDK::Marketing::MarketingEventSearchByExternalEventIDParams.dump_request(params) query = HubSpotSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "marketing/marketing-events/2026-03/events/search", query: query, model: HubSpotSDK::Marketing::CollectionResponseSearchPublicResponseWrapperNoPaging, options: ) end |
#search_identifiers_by_external_event_id(external_event_id, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::CollectionResponseWithTotalMarketingEventIdentifiersResponse
This endpoint searches the portal for all Marketing Events whose externalEventId matches the value provided in the request.
It retrieves the objectId and additional event details for each matching Marketing Event.
Since multiple Marketing Events can have the same externalEventId, the endpoint returns all matching results.
Note: Marketing Events become searchable by externalEventId a few minutes after creation.
334 335 336 337 338 339 340 341 |
# File 'lib/hubspot_sdk/resources/marketing/marketing_events.rb', line 334 def search_identifiers_by_external_event_id(external_event_id, params = {}) @client.request( method: :get, path: ["marketing/marketing-events/2026-03/%1$s/identifiers", external_event_id], model: HubSpotSDK::Marketing::CollectionResponseWithTotalMarketingEventIdentifiersResponse, options: params[:request_options] ) end |
#update(object_id_, custom_properties:, end_date_time: nil, event_cancelled: nil, event_description: nil, event_name: nil, event_organizer: nil, event_type: nil, event_url: nil, start_date_time: nil, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::MarketingEventPublicDefaultResponseV2
Some parameter documentations has been truncated, see Models::Marketing::MarketingEventUpdateParams for more details.
Updates the details of an existing Marketing Event identified by its objectId, if it exists.
105 106 107 108 109 110 111 112 113 114 |
# File 'lib/hubspot_sdk/resources/marketing/marketing_events.rb', line 105 def update(object_id_, params) parsed, = HubSpotSDK::Marketing::MarketingEventUpdateParams.dump_request(params) @client.request( method: :patch, path: ["marketing/marketing-events/2026-03/%1$s", object_id_], body: parsed, model: HubSpotSDK::Marketing::MarketingEventPublicDefaultResponseV2, options: ) end |
#update_batch(inputs:, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::BatchResponseMarketingEventPublicDefaultResponseV2
Updates multiple Marketing Events on the portal based on their objectId, if they exist.
354 355 356 357 358 359 360 361 362 363 |
# File 'lib/hubspot_sdk/resources/marketing/marketing_events.rb', line 354 def update_batch(params) parsed, = HubSpotSDK::Marketing::MarketingEventUpdateBatchParams.dump_request(params) @client.request( method: :post, path: "marketing/marketing-events/2026-03/batch/update", body: parsed, model: HubSpotSDK::Marketing::BatchResponseMarketingEventPublicDefaultResponseV2, options: ) end |
#update_by_external_event_id(external_event_id, external_account_id:, custom_properties:, end_date_time: nil, event_cancelled: nil, event_completed: nil, event_description: nil, event_name: nil, event_organizer: nil, event_type: nil, event_url: nil, start_date_time: nil, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::MarketingEventPublicDefaultResponse
Some parameter documentations has been truncated, see Models::Marketing::MarketingEventUpdateByExternalEventIDParams for more details.
Updates the details of an existing Marketing Event identified by its externalAccountId, externalEventId if it exists.
Only Marketing Events created by the same app can be updated.
405 406 407 408 409 410 411 412 413 414 415 416 417 |
# File 'lib/hubspot_sdk/resources/marketing/marketing_events.rb', line 405 def update_by_external_event_id(external_event_id, params) query_params = [:external_account_id] parsed, = HubSpotSDK::Marketing::MarketingEventUpdateByExternalEventIDParams.dump_request(params) query = HubSpotSDK::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :patch, path: ["marketing/marketing-events/2026-03/events/%1$s", external_event_id], query: query.transform_keys(external_account_id: "externalAccountId"), body: parsed.except(*query_params), model: HubSpotSDK::Marketing::MarketingEventPublicDefaultResponse, options: ) end |
#upsert_batch(inputs:, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::BatchResponseMarketingEventPublicDefaultResponse
Upserts multiple Marketing Events. If a Marketing Event with the specified ID already exists, it will be updated; otherwise, a new event will be created.
Only Marketing Events originally created by the same app can be updated.
432 433 434 435 436 437 438 439 440 441 |
# File 'lib/hubspot_sdk/resources/marketing/marketing_events.rb', line 432 def upsert_batch(params) parsed, = HubSpotSDK::Marketing::MarketingEventUpsertBatchParams.dump_request(params) @client.request( method: :post, path: "marketing/marketing-events/2026-03/events/upsert", body: parsed, model: HubSpotSDK::Marketing::BatchResponseMarketingEventPublicDefaultResponse, options: ) end |
#upsert_by_external_event_id(path_external_event_id, custom_properties:, event_name:, event_organizer:, external_account_id:, body_external_event_id:, end_date_time: nil, event_cancelled: nil, event_completed: nil, event_description: nil, event_type: nil, event_url: nil, start_date_time: nil, request_options: {}) ⇒ HubSpotSDK::Models::Marketing::MarketingEventPublicDefaultResponse
Some parameter documentations has been truncated, see Models::Marketing::MarketingEventUpsertByExternalEventIDParams for more details.
Upserts a marketing event If there is an existing marketing event with the specified ID, it will be updated; otherwise a new event will be created.
483 484 485 486 487 488 489 490 491 492 |
# File 'lib/hubspot_sdk/resources/marketing/marketing_events.rb', line 483 def upsert_by_external_event_id(path_external_event_id, params) parsed, = HubSpotSDK::Marketing::MarketingEventUpsertByExternalEventIDParams.dump_request(params) @client.request( method: :put, path: ["marketing/marketing-events/2026-03/events/%1$s", path_external_event_id], body: parsed, model: HubSpotSDK::Marketing::MarketingEventPublicDefaultResponse, options: ) end |