hubspot.marketing.events
Module hubspot.marketing.events
API
Definitions
ballerinax/hubspot.marketing.events Ballerina library
Overview
HubSpot is an AI-powered customer relationship management (CRM) platform.
The ballerinax/hubspot.marketing.events
connector offers APIs to connect and interact with the HubSpot Marketing Events API endpoints, specifically based on the HubSpot Marketing Events REST API.
Setup guide
To use the HubSpot Marketing Events
connector, you must have access to the HubSpot API through a HubSpot developer account and a HubSpot App under it. Therefore, you need to register for a developer account at HubSpot if you don't have one already.
Step 1: Create/Login to a HubSpot Developer Account
If you have an account already, go to the HubSpot developer portal
If you don't have a HubSpot Developer Account, you can sign up for a free account here
Step 2 (Optional): Create a Developer Test Account under your account
Within app developer accounts, you can create a developer test account to test apps and integrations without affecting any real HubSpot data.
Note: These accounts are only for development and testing purposes. Developer Test Accounts must not be used in production environments.
-
Go to the Test Account section from the left sidebar.
-
Click Create developer test account.
-
In the dialog box, give a name to your test account and click create.
Step 3: Create a HubSpot App under your account
-
In your developer account, navigate to the "Apps" section. Click on "Create App"
-
Provide the necessary details, including the app name and description.
Step 4: Configure the Authentication Flow
-
Move to the Auth Tab.
-
In the Scopes section, add the following scopes for your app using the "Add new scope" button.
crm.objects.marketing_events.read
crm.objects.marketing_events.write
-
Add your Redirect URI in the relevant section. You can also use localhost addresses for local development purposes. Click "Create App".
Step 5: Get your Client ID and Client Secret
-
Navigate to the "Auth" section of your app. Make sure to save the provided Client ID and Client Secret.
Step 6: Setup Authentication Flow
Before proceeding with the Quickstart, ensure you have obtained the Access Token using the following steps:
-
Create an authorization URL using the following format
https://app.hubspot.com/oauth/authorize?client_id=<YOUR_CLIENT_ID>&scope=<YOUR_SCOPES>&redirect_uri=<YOUR_REDIRECT_URI>
Replace the
<YOUR_CLIENT_ID>
,<YOUR_REDIRECT_URI>
and<YOUR_SCOPES>
with your specific value. -
Paste it in the browser and select your developer test account to install the app when prompted.
-
A code will be displayed in the browser. Copy the code.
-
Run the following curl command. Replace the
<YOUR_CLIENT_ID>
,<YOUR_REDIRECT_URI
> and<YOUR_CLIENT_SECRET>
with your specific value. Use the code you received in the above step 3 as the<CODE>
.-
Linux/macOS
curl --request POST \ --url https://api.hubapi.com/oauth/v1/token \ --header 'content-type: application/x-www-form-urlencoded' \ --data 'grant_type=authorization_code&code=<CODE>&redirect_uri=<YOUR_REDIRECT_URI>&client_id=<YOUR_CLIENT_ID>&client_secret=<YOUR_CLIENT_SECRET>'
-
Windows
curl --request POST ^ --url https://api.hubapi.com/oauth/v1/token ^ --header 'content-type: application/x-www-form-urlencoded' ^ --data 'grant_type=authorization_code&code=<CODE>&redirect_uri=<YOUR_REDIRECT_URI>&client_id=<YOUR_CLIENT_ID>&client_secret=<YOUR_CLIENT_SECRET>'
This command will return the access token necessary for API calls.
{ "token_type": "bearer", "refresh_token": "<Refresh Token>", "access_token": "<Access Token>", "expires_in": 1800 }
-
-
Store the access token securely for use in your application.
Step 7 (Optional): Generate a Developer API Key to retrieve and change Application Settings
Note: This step is optional and only required if you want to retrieve and change application settings via the client.
-
Go to the Developer API Key section in the HubSpot Developer Portal.
-
Click on "Create Key".
-
Copy the API Key.
-
Store the API Key securely for use in your application.
Quickstart
To use the HubSpot Marketing Events
connector in your Ballerina application, update the .bal
file as follows:
Step 1: Import the module
Import the hubspot.marketing.events
module and oauth2
module.
import ballerina/oauth2; import ballerinax/hubspot.marketing.events as hsmevents;
Step 2: Instantiate a new connector
-
Create a
Config.toml
file in the root directory of the Ballerina project and configure the obtained credentials in the above steps as follows:clientId = "<Client Id>" clientSecret = "<Client Secret>" refreshToken = "<Refresh Token>"
Note (Optional): If you want to use Set and Get Application Settings operations, you need to provide the Developer API Key in the
Config.toml
file as well.clientId = "<Client Id>" clientSecret = "<Client Secret>" refreshToken = "<Refresh Token>" apiKey = "<API Key>"
-
Instantiate a
hsmevents:ConnectionConfig
with the obtained credentials and initialize the connector with it.configurable string clientId = ?; configurable string clientSecret = ?; configurable string refreshToken = ?; final hsmevents:ConnectionConfig config = { auth : { clientId, clientSecret, refreshToken, credentialBearer: oauth2:POST_BODY_BEARER } }; final hsmevents:Client hsmevents = check new (config);
Note (Optional): To use the Set and Get Application Settings operations, you need to instantiate a separate client object with the API Key as the auth token. This client can be used only for these operations.
configurable string clientId = ?; configurable string clientSecret = ?; configurable string refreshToken = ?; configurable string apiKey = ?; final hsmevents:ConnectionConfig config = { auth : { clientId, clientSecret, refreshToken, credentialBearer: oauth2:POST_BODY_BEARER }, }; final hsmevents:Client hsmevents = check new (config); // Create a separate client object for Set and Get Application Settings operations final hsmevents:ConnectionConfig configWithApiKey = { auth : { hapikey: apiKey, private\-app\-legacy: "" } }; final hsmevents:Client hsmevents2 = check new (configWithApiKey);
Step 3: Invoke the connector operation
Now, utilize the available connector operations. A sample use case is shown below.
Create a Marketing Event
MarketingEventCreateRequestParams payload = { externalAccountId: 11111, externalEventId: 10000, eventName: "Winter webinar", eventOrganizer: "Snowman Fellowship", eventCancelled: false, eventUrl: "https://example.com/holiday-jam", eventDescription: "Let's plan for the holidays", eventCompleted: false, startDateTime: "2024-08-07T12:36:59.286Z", endDateTime: "2024-08-07T12:36:59.286Z", customProperties: [] }; public function main() returns error? { hsmevents:MarketingEventDefaultResponse createEvent = check hsmevents->postEvents_create(payload); }
(Optional) Get Application Settings
int:Signed32 appId = 12345; // Your App ID EventDetailSettings response = check hsmevents2->getAppidSettings_getall(appId); // Need to use the Client with API Key Authentication
Examples
The HubSpot Marketing Events
connector provides practical examples illustrating usage in various scenarios. Explore these examples, covering the following use cases:
- Event Participation Management - Use Marketing Event API to Manage and Update Participants seamlessly.
- Marketing Event Management - Create, update and manage multiple Marketing Events and automate event management.
Clients
hubspot.marketing.events: Client
Constructor
Gets invoked to initialize the connector
.
init (ConnectionConfig config, string serviceUrl)
- config ConnectionConfig - The configurations to be used when initializing the
connector
- serviceUrl string "https://api.hubapi.com/marketing/v3/marketing-events" - URL of the target service
deleteAssociationsExternalaccountidExternaleventidListsListid_disassociatebyexternalaccountandeventids
function deleteAssociationsExternalaccountidExternaleventidListsListid_disassociatebyexternalaccountandeventids(string externalAccountId, string externalEventId, string listId, map<string|string[]> headers) returns Response|error
Disassociate a list from a marketing event
Parameters
- externalAccountId string - The accountId that is associated with this marketing event in the external event application.
- externalEventId string - The id of the marketing event in the external event application.
- listId string - The ILS ID of the list.
deleteAssociationsMarketingeventidListsListid_disassociatebymarketingeventid
function deleteAssociationsMarketingeventidListsListid_disassociatebymarketingeventid(string marketingEventId, string listId, map<string|string[]> headers) returns Response|error
Disassociate a list from a marketing event
Parameters
- marketingEventId string - The internal id of the marketing event in HubSpot.
- listId string - The ILS ID of the list.
deleteEventsExternaleventid_archive
function deleteEventsExternaleventid_archive(string externalEventId, map<string|string[]> headers, *DeleteEventsExternaleventid_archiveQueries queries) returns Response|error
Delete Marketing Event by External Ids
Parameters
- externalEventId string - The id of the marketing event in the external event application
- queries *DeleteEventsExternaleventid_archiveQueries - Queries to be sent with the request
deleteObjectid
Delete Marketing Event by objectId
Parameters
- objectId string - The internal ID of the marketing event in HubSpot
get
function get(map<string|string[]> headers, *GetQueries queries) returns CollectionResponseMarketingEventPublicReadResponseV2ForwardPaging|error
Get all marketing event
Parameters
- queries *GetQueries - Queries to be sent with the request
Return Type
- CollectionResponseMarketingEventPublicReadResponseV2ForwardPaging|error - successful operation
getAppidSettings_getall
function getAppidSettings_getall(Signed32 appId, map<string|string[]> headers) returns EventDetailSettings|error
Retrieve the application settings
Parameters
- appId Signed32 - The id of the application to retrieve the settings for.
Return Type
- EventDetailSettings|error - successful operation
getAssociationsExternalaccountidExternaleventidLists_getallbyexternalaccountandeventids
function getAssociationsExternalaccountidExternaleventidLists_getallbyexternalaccountandeventids(string externalAccountId, string externalEventId, map<string|string[]> headers) returns CollectionResponseWithTotalPublicListNoPaging|error
Get lists associated with a marketing event
Parameters
- externalAccountId string - The accountId that is associated with this marketing event in the external event application
- externalEventId string - The id of the marketing event in the external event application.
Return Type
- CollectionResponseWithTotalPublicListNoPaging|error - successful operation
getAssociationsMarketingeventidLists_getallbymarketingeventid
function getAssociationsMarketingeventidLists_getallbymarketingeventid(string marketingEventId, map<string|string[]> headers) returns CollectionResponseWithTotalPublicListNoPaging|error
Get lists associated with a marketing event
Parameters
- marketingEventId string - The internal id of the marketing event in HubSpot.
Return Type
- CollectionResponseWithTotalPublicListNoPaging|error - successful operation
getEventsExternaleventid_getdetails
function getEventsExternaleventid_getdetails(string externalEventId, map<string|string[]> headers, *GetEventsExternaleventid_getdetailsQueries queries) returns MarketingEventPublicReadResponse|error
Get Marketing Event by External IDs
Parameters
- externalEventId string - The id of the marketing event in the external event application
- queries *GetEventsExternaleventid_getdetailsQueries - Queries to be sent with the request
Return Type
- MarketingEventPublicReadResponse|error - successful operation
getEventsSearch_dosearch
function getEventsSearch_dosearch(map<string|string[]> headers, *GetEventsSearch_dosearchQueries queries) returns CollectionResponseSearchPublicResponseWrapperNoPaging|error
Find App-Specific Marketing Events by External Event Id
Parameters
- queries *GetEventsSearch_dosearchQueries - Queries to be sent with the request
Return Type
- CollectionResponseSearchPublicResponseWrapperNoPaging|error - successful operation
getExternaleventidIdentifiers
function getExternaleventidIdentifiers(string externalEventId, map<string|string[]> headers) returns CollectionResponseWithTotalMarketingEventIdentifiersResponseNoPaging|error
Find Marketing Events by externalEventId
Parameters
- externalEventId string - The id of the marketing event in the external event application.
Return Type
- CollectionResponseWithTotalMarketingEventIdentifiersResponseNoPaging|error - successful operation
getObjectid
function getObjectid(string objectId, map<string|string[]> headers) returns MarketingEventPublicReadResponseV2|error
Get Marketing Event by objectId
Parameters
- objectId string - The internal ID of the marketing event in HubSpot
Return Type
- MarketingEventPublicReadResponseV2|error - successful operation
getParticipationsContactsContactidentifierBreakdown_getparticipationsbreakdownbycontactid
function getParticipationsContactsContactidentifierBreakdown_getparticipationsbreakdownbycontactid(string contactIdentifier, map<string|string[]> headers, *GetParticipationsContactsContactidentifierBreakdown_getparticipationsbreakdownbycontactidQueries queries) returns CollectionResponseWithTotalParticipationBreakdownForwardPaging|error
Read participations breakdown by Contact identifier
Parameters
- contactIdentifier string - The identifier of the Contact. It may be email or internal id.
- queries *GetParticipationsContactsContactidentifierBreakdown_getparticipationsbreakdownbycontactidQueries - Queries to be sent with the request
Return Type
- CollectionResponseWithTotalParticipationBreakdownForwardPaging|error - successful operation
getParticipationsExternalaccountidExternaleventidBreakdown_getparticipationsbreakdownbyexternaleventid
function getParticipationsExternalaccountidExternaleventidBreakdown_getparticipationsbreakdownbyexternaleventid(string externalAccountId, string externalEventId, map<string|string[]> headers, *GetParticipationsExternalaccountidExternaleventidBreakdown_getparticipationsbreakdownbyexternaleventidQueries queries) returns CollectionResponseWithTotalParticipationBreakdownForwardPaging|error
Read participations breakdown by Marketing Event external identifier
Parameters
- externalAccountId string - The accountId that is associated with this marketing event in the external event application.
- externalEventId string - The id of the marketing event in the external event application.
- queries *GetParticipationsExternalaccountidExternaleventidBreakdown_getparticipationsbreakdownbyexternaleventidQueries - Queries to be sent with the request
Return Type
- CollectionResponseWithTotalParticipationBreakdownForwardPaging|error - successful operation
getParticipationsExternalaccountidExternaleventid_getparticipationscountersbyeventexternalid
function getParticipationsExternalaccountidExternaleventid_getparticipationscountersbyeventexternalid(string externalAccountId, string externalEventId, map<string|string[]> headers) returns AttendanceCounters|error
Read participations counters by Marketing Event external identifier
Parameters
- externalAccountId string - The accountId that is associated with this marketing event in the external event application.
- externalEventId string - The id of the marketing event in the external event application.
Return Type
- AttendanceCounters|error - successful operation
getParticipationsMarketingeventidBreakdown_getparticipationsbreakdownbymarketingeventid
function getParticipationsMarketingeventidBreakdown_getparticipationsbreakdownbymarketingeventid(int marketingEventId, map<string|string[]> headers, *GetParticipationsMarketingeventidBreakdown_getparticipationsbreakdownbymarketingeventidQueries queries) returns CollectionResponseWithTotalParticipationBreakdownForwardPaging|error
Read participations breakdown by Marketing Event internal identifier
Parameters
- marketingEventId int - The internal id of the marketing event in HubSpot.
- queries *GetParticipationsMarketingeventidBreakdown_getparticipationsbreakdownbymarketingeventidQueries - Queries to be sent with the request
Return Type
- CollectionResponseWithTotalParticipationBreakdownForwardPaging|error - successful operation
getParticipationsMarketingeventid_getparticipationscountersbymarketingeventid
function getParticipationsMarketingeventid_getparticipationscountersbymarketingeventid(int marketingEventId, map<string|string[]> headers) returns AttendanceCounters|error
Read participations counters by Marketing Event internal identifier
Parameters
- marketingEventId int - The internal id of the marketing event in HubSpot.
Return Type
- AttendanceCounters|error - successful operation
patchEventsExternaleventid_update
function patchEventsExternaleventid_update(string externalEventId, MarketingEventUpdateRequestParams payload, map<string|string[]> headers, *PatchEventsExternaleventid_updateQueries queries) returns MarketingEventPublicDefaultResponse|error
Update Marketing Event by External IDs
Parameters
- externalEventId string - The id of the marketing event in the external event application
- payload MarketingEventUpdateRequestParams - Payload to update the marketing event
- queries *PatchEventsExternaleventid_updateQueries - Queries to be sent with the request
Return Type
- MarketingEventPublicDefaultResponse|error - successful operation
patchObjectid
function patchObjectid(string objectId, MarketingEventPublicUpdateRequestV2 payload, map<string|string[]> headers) returns MarketingEventPublicDefaultResponseV2|error
Update Marketing Event by objectId
Parameters
- objectId string - The internal ID of the marketing event in HubSpot
- payload MarketingEventPublicUpdateRequestV2 - Payload to update the marketing event
Return Type
- MarketingEventPublicDefaultResponseV2|error - successful operation
postAppidSettings_update
function postAppidSettings_update(Signed32 appId, EventDetailSettingsUrl payload, map<string|string[]> headers) returns EventDetailSettings|error
Update the application settings
Parameters
- appId Signed32 - The id of the application to update the settings for.
- payload EventDetailSettingsUrl - payload to update the settings
Return Type
- EventDetailSettings|error - successful operation
postAttendanceExternaleventidSubscriberstateCreate_recordbycontactids
function postAttendanceExternaleventidSubscriberstateCreate_recordbycontactids(string externalEventId, string subscriberState, BatchInputMarketingEventSubscriber payload, map<string|string[]> headers, *PostAttendanceExternaleventidSubscriberstateCreate_recordbycontactidsQueries queries) returns BatchResponseSubscriberVidResponse|error
Record Participants by ContactId with Marketing Event External Ids
Parameters
- externalEventId string - The id of the marketing event in the external event application
- subscriberState string - The new subscriber state for the HubSpot contacts and the specified marketing event. For example: 'register', 'attend' or 'cancel'.
- payload BatchInputMarketingEventSubscriber - Payload to record the subscriber state by contact id
- queries *PostAttendanceExternaleventidSubscriberstateCreate_recordbycontactidsQueries - Queries to be sent with the request
Return Type
- BatchResponseSubscriberVidResponse|error - successful operation
postAttendanceExternaleventidSubscriberstateEmailCreate_recordbycontactemails
function postAttendanceExternaleventidSubscriberstateEmailCreate_recordbycontactemails(string externalEventId, string subscriberState, BatchInputMarketingEventEmailSubscriber payload, map<string|string[]> headers, *PostAttendanceExternaleventidSubscriberstateEmailCreate_recordbycontactemailsQueries queries) returns BatchResponseSubscriberEmailResponse|error
Record Participants by Email with Marketing Event External Ids
Parameters
- externalEventId string - The id of the marketing event in the external event application
- subscriberState string - The new subscriber state for the HubSpot contacts and the specified marketing event. For example: 'register', 'attend' or 'cancel'.
- payload BatchInputMarketingEventEmailSubscriber - Payload to record the subscriber state by email
- queries *PostAttendanceExternaleventidSubscriberstateEmailCreate_recordbycontactemailsQueries - Queries to be sent with the request
Return Type
- BatchResponseSubscriberEmailResponse|error - successful operation
postBatchArchive
function postBatchArchive(BatchInputMarketingEventPublicObjectIdDeleteRequest payload, map<string|string[]> headers) returns Response|error
Delete Multiple Marketing Events by ObjectId
Parameters
- payload BatchInputMarketingEventPublicObjectIdDeleteRequest - Payload to delete multiple marketing events by object id
postBatchUpdate
function postBatchUpdate(BatchInputMarketingEventPublicUpdateRequestFullV2 payload, map<string|string[]> headers) returns BatchResponseMarketingEventPublicDefaultResponseV2|BatchResponseMarketingEventPublicDefaultResponseV2WithErrors|error
Update Multiple Marketing Events by ObjectId
Parameters
- payload BatchInputMarketingEventPublicUpdateRequestFullV2 - Payload to update multiple marketing events by object id
Return Type
postEventsDelete_batcharchive
function postEventsDelete_batcharchive(BatchInputMarketingEventExternalUniqueIdentifier payload, map<string|string[]> headers) returns Response|error
Delete Multiple Marketing Events by External Ids
Parameters
- payload BatchInputMarketingEventExternalUniqueIdentifier - Payload to delete multiple marketing events by external id
postEventsExternaleventidCancel_cancel
function postEventsExternaleventidCancel_cancel(string externalEventId, map<string|string[]> headers, *PostEventsExternaleventidCancel_cancelQueries queries) returns MarketingEventDefaultResponse|error
Mark a marketing event as cancelled
Parameters
- externalEventId string - The id of the marketing event in the external event application
- queries *PostEventsExternaleventidCancel_cancelQueries - Queries to be sent with the request
Return Type
- MarketingEventDefaultResponse|error - successful operation
postEventsExternaleventidComplete_complete
function postEventsExternaleventidComplete_complete(string externalEventId, MarketingEventCompleteRequestParams payload, map<string|string[]> headers, *PostEventsExternaleventidComplete_completeQueries queries) returns MarketingEventDefaultResponse|error
Mark a marketing event as completed
Parameters
- externalEventId string - The id of the marketing event in the external event application.
- payload MarketingEventCompleteRequestParams - Payload to mark a marketing event as completed
- queries *PostEventsExternaleventidComplete_completeQueries - Queries to be sent with the request
Return Type
- MarketingEventDefaultResponse|error - successful operation
postEventsExternaleventidSubscriberstateEmailUpsert_upsertbycontactemail
function postEventsExternaleventidSubscriberstateEmailUpsert_upsertbycontactemail(string externalEventId, string subscriberState, BatchInputMarketingEventEmailSubscriber payload, map<string|string[]> headers, *PostEventsExternaleventidSubscriberstateEmailUpsert_upsertbycontactemailQueries queries) returns Response|error
Record a subscriber state by contact email
Parameters
- externalEventId string - The id of the marketing event in the external event application
- subscriberState string - The new subscriber state for the HubSpot contacts and the specified marketing event. For example: 'register', 'attend' or 'cancel'.
- payload BatchInputMarketingEventEmailSubscriber - Payload to record the subscriber state by email
- queries *PostEventsExternaleventidSubscriberstateEmailUpsert_upsertbycontactemailQueries - Queries to be sent with the request
postEventsExternaleventidSubscriberstateUpsert_upsertbycontactid
function postEventsExternaleventidSubscriberstateUpsert_upsertbycontactid(string externalEventId, string subscriberState, BatchInputMarketingEventSubscriber payload, map<string|string[]> headers, *PostEventsExternaleventidSubscriberstateUpsert_upsertbycontactidQueries queries) returns Response|error
Record a subscriber state by contact ID
Parameters
- externalEventId string - The id of the marketing event in the external event application
- subscriberState string - The new subscriber state for the HubSpot contacts and the specified marketing event. For example: 'register', 'attend' or 'cancel'.
- payload BatchInputMarketingEventSubscriber - Payload to record the subscriber state by contact id
- queries *PostEventsExternaleventidSubscriberstateUpsert_upsertbycontactidQueries - Queries to be sent with the request
postEventsUpsert_batchupsert
function postEventsUpsert_batchupsert(BatchInputMarketingEventCreateRequestParams payload, map<string|string[]> headers) returns BatchResponseMarketingEventPublicDefaultResponse|error
Create or Update Multiple Marketing Events
Parameters
- payload BatchInputMarketingEventCreateRequestParams - Payload to create or update multiple marketing events
Return Type
- BatchResponseMarketingEventPublicDefaultResponse|error - successful operation
postEvents_create
function postEvents_create(MarketingEventCreateRequestParams payload, map<string|string[]> headers) returns MarketingEventDefaultResponse|error
Create a marketing event
Parameters
- payload MarketingEventCreateRequestParams - Payload to create a marketing event
Return Type
- MarketingEventDefaultResponse|error - successful operation
postObjectidAttendanceSubscriberstateCreate
function postObjectidAttendanceSubscriberstateCreate(string objectId, string subscriberState, BatchInputMarketingEventSubscriber payload, map<string|string[]> headers) returns BatchResponseSubscriberVidResponse|error
Record Participants by ContactId with Marketing Event Object Id
Parameters
- objectId string - The internal id of the marketing event in HubSpot
- subscriberState string - The attendance state value. It may be 'register', 'attend' or 'cancel'
- payload BatchInputMarketingEventSubscriber - Payload to record the subscriber state by contact id
Return Type
- BatchResponseSubscriberVidResponse|error - successful operation
postObjectidAttendanceSubscriberstateEmailCreate
function postObjectidAttendanceSubscriberstateEmailCreate(string objectId, string subscriberState, BatchInputMarketingEventEmailSubscriber payload, map<string|string[]> headers) returns BatchResponseSubscriberEmailResponse|error
Record Participants by Email with Marketing Event Object Id
Parameters
- objectId string - The internal ID of the marketing event in HubSpot
- subscriberState string - The attendance state value. It may be 'register', 'attend' or 'cancel'
- payload BatchInputMarketingEventEmailSubscriber - Payload to record the subscriber state by email
Return Type
- BatchResponseSubscriberEmailResponse|error - successful operation
putAssociationsExternalaccountidExternaleventidListsListid_associatebyexternalaccountandeventids
function putAssociationsExternalaccountidExternaleventidListsListid_associatebyexternalaccountandeventids(string externalAccountId, string externalEventId, string listId, map<string|string[]> headers) returns Response|error
Associate a list with a marketing event
Parameters
- externalAccountId string - The accountId that is associated with this marketing event in the external event application.
- externalEventId string - The id of the marketing event in the external event application.
- listId string - The ILS ID of the list.
putAssociationsMarketingeventidListsListid_associatebymarketingeventid
function putAssociationsMarketingeventidListsListid_associatebymarketingeventid(string marketingEventId, string listId, map<string|string[]> headers) returns Response|error
Associate a list with a marketing event
Parameters
- marketingEventId string - The internal id of the marketing event in HubSpot.
- listId string - The ILS ID of the list.
putEventsExternaleventid_upsert
function putEventsExternaleventid_upsert(string externalEventId, MarketingEventCreateRequestParams payload, map<string|string[]> headers) returns MarketingEventPublicDefaultResponse|error
Create or update a marketing event
Parameters
- externalEventId string - The id of the marketing event in the external event application
- payload MarketingEventCreateRequestParams - Payload to create or update a marketing event
Return Type
- MarketingEventPublicDefaultResponse|error - successful operation
Records
hubspot.marketing.events: ApiKeysConfig
Provides API key configurations needed when communicating with a remote HTTP endpoint.
Fields
- hapikey string - HubSpot Developer API Key
- private\-app\-legacy string - Key for Legacy HubSpot APIs
hubspot.marketing.events: AppInfo
Fields
- name string? -
- id string? -
hubspot.marketing.events: AttendanceCounters
Fields
- attended Signed32? -
- registered Signed32? -
- cancelled Signed32? -
- noShows Signed32? -
hubspot.marketing.events: BatchInputMarketingEventCreateRequestParams
Fields
- inputs MarketingEventCreateRequestParams[]? -
hubspot.marketing.events: BatchInputMarketingEventEmailSubscriber
Fields
- inputs MarketingEventEmailSubscriber[]? - List of marketing event details to create or update
hubspot.marketing.events: BatchInputMarketingEventExternalUniqueIdentifier
Fields
- inputs MarketingEventExternalUniqueIdentifier[]? -
hubspot.marketing.events: BatchInputMarketingEventPublicObjectIdDeleteRequest
Fields
- inputs MarketingEventPublicObjectIdDeleteRequest[]? -
hubspot.marketing.events: BatchInputMarketingEventPublicUpdateRequestFullV2
Fields
- inputs MarketingEventPublicUpdateRequestFullV2[]? -
hubspot.marketing.events: BatchInputMarketingEventSubscriber
Fields
- inputs MarketingEventSubscriber[]? - List of HubSpot contacts to subscribe to the marketing event
hubspot.marketing.events: BatchResponseMarketingEventPublicDefaultResponse
Fields
- completedAt string? -
- numErrors? Signed32? -
- requestedAt? string? -
- startedAt string? -
- links? record { string?... }? -
- results MarketingEventPublicDefaultResponse[]? -
- errors? StandardError[]? -
- status "PENDING"|"PROCESSING"|"CANCELED"|"COMPLETE" -
hubspot.marketing.events: BatchResponseMarketingEventPublicDefaultResponseV2
Fields
- completedAt string? -
- requestedAt? string? -
- startedAt string? -
- links? record { string?... }? -
- results MarketingEventPublicDefaultResponseV2[]? -
- status "PENDING"|"PROCESSING"|"CANCELED"|"COMPLETE" -
hubspot.marketing.events: BatchResponseMarketingEventPublicDefaultResponseV2WithErrors
Fields
- completedAt string? -
- numErrors? Signed32? -
- requestedAt? string? -
- startedAt string? -
- links? record { string?... }? -
- results MarketingEventPublicDefaultResponseV2[]? -
- errors? StandardError[]? -
- status "PENDING"|"PROCESSING"|"CANCELED"|"COMPLETE" -
hubspot.marketing.events: BatchResponseSubscriberEmailResponse
Fields
- completedAt string? -
- numErrors? Signed32? -
- requestedAt? string? -
- startedAt string? -
- links? record { string?... }? -
- results SubscriberEmailResponse[]? -
- errors? StandardError[]? -
- status "PENDING"|"PROCESSING"|"CANCELED"|"COMPLETE" -
hubspot.marketing.events: BatchResponseSubscriberVidResponse
Fields
- completedAt string? -
- numErrors? Signed32? -
- requestedAt? string? -
- startedAt string? -
- links? record { string?... }? -
- results SubscriberVidResponse[]? -
- errors? StandardError[]? -
- status "PENDING"|"PROCESSING"|"CANCELED"|"COMPLETE" -
hubspot.marketing.events: ClientHttp1Settings
Provides settings related to HTTP/1.x protocol.
Fields
- keepAlive KeepAlive(default http:KEEPALIVE_AUTO) - Specifies whether to reuse a connection for multiple requests
- chunking Chunking(default http:CHUNKING_AUTO) - The chunking behaviour of the request
- proxy? ProxyConfig - Proxy server related options
hubspot.marketing.events: CollectionResponseMarketingEventPublicReadResponseV2ForwardPaging
Fields
- paging? ForwardPaging? -
- results MarketingEventPublicReadResponseV2[]? -
hubspot.marketing.events: CollectionResponseSearchPublicResponseWrapperNoPaging
Fields
- results SearchPublicResponseWrapper[]? -
hubspot.marketing.events: CollectionResponseWithTotalMarketingEventIdentifiersResponseNoPaging
Fields
- total Signed32? -
- results MarketingEventIdentifiersResponse[]? -
hubspot.marketing.events: CollectionResponseWithTotalParticipationBreakdownForwardPaging
Fields
- total Signed32? -
- paging? ForwardPaging? -
- results ParticipationBreakdown[]? -
hubspot.marketing.events: CollectionResponseWithTotalPublicListNoPaging
Fields
- total Signed32? -
- results PublicList[]? -
hubspot.marketing.events: ConnectionConfig
Provides a set of configurations for controlling the behaviours when communicating with a remote HTTP endpoint.
Fields
- auth BearerTokenConfig|OAuth2RefreshTokenGrantConfig|ApiKeysConfig - Provides Auth configurations needed when communicating with a remote HTTP endpoint.
- httpVersion HttpVersion(default http:HTTP_2_0) - The HTTP version understood by the client
- http1Settings? ClientHttp1Settings - Configurations related to HTTP/1.x protocol
- http2Settings? ClientHttp2Settings - Configurations related to HTTP/2 protocol
- timeout decimal(default 60) - The maximum time to wait (in seconds) for a response before closing the connection
- forwarded string(default "disable") - The choice of setting
forwarded
/x-forwarded
header
- poolConfig? PoolConfiguration - Configurations associated with request pooling
- cache? CacheConfig - HTTP caching related configurations
- compression Compression(default http:COMPRESSION_AUTO) - Specifies the way of handling compression (
accept-encoding
) header
- circuitBreaker? CircuitBreakerConfig - Configurations associated with the behaviour of the Circuit Breaker
- retryConfig? RetryConfig - Configurations associated with retrying
- responseLimits? ResponseLimitConfigs - Configurations associated with inbound response size limits
- secureSocket? ClientSecureSocket - SSL/TLS-related options
- proxy? ProxyConfig - Proxy server related options
- validation boolean(default true) - Enables the inbound payload validation functionality which provided by the constraint package. Enabled by default
hubspot.marketing.events: ContactAssociation
Fields
- firstname? string? -
- contactId string? -
- email string? -
- lastname? string? -
hubspot.marketing.events: CrmPropertyWrapper
Fields
- name string? -
- value string? -
hubspot.marketing.events: DeleteEventsExternaleventid_archiveQueries
Represents the Queries record for the operation: deleteEventsExternaleventid_archive
Fields
- externalAccountId string - The accountId that is associated with this marketing event in the external event application
hubspot.marketing.events: ErrorDetail
Fields
- subCategory? string? - A specific category that contains more specific detail about the error
- code? string? - The status code associated with the error detail
- 'in? string? - The name of the field or parameter in which the error was found.
- context? record { string[]?... }? - Context about the error condition
- message string? - A human readable message describing the error along with remediation steps where appropriate
hubspot.marketing.events: EventDetailSettings
Fields
- appId Signed32? - The id of the application the settings are for
- eventDetailsUrl string? - The url that will be used to fetch marketing event details by id
hubspot.marketing.events: EventDetailSettingsUrl
Fields
- eventDetailsUrl string? - The url that will be used to fetch marketing event details by id. Must contain a
%s
character sequence that will be substituted with the event id. For example:https://my.event.app/events/%s
hubspot.marketing.events: ForwardPaging
Fields
- next? NextPage? -
hubspot.marketing.events: GetEventsExternaleventid_getdetailsQueries
Represents the Queries record for the operation: getEventsExternaleventid_getdetails
Fields
- externalAccountId string - The accountId that is associated with this marketing event in the external event application
hubspot.marketing.events: GetEventsSearch_dosearchQueries
Represents the Queries record for the operation: getEventsSearch_dosearch
Fields
- q string - The id of the marketing event in the external event application (externalEventId)
hubspot.marketing.events: GetParticipationsContactsContactidentifierBreakdown_getparticipationsbreakdownbycontactidQueries
Represents the Queries record for the operation: getParticipationsContactsContactidentifierBreakdown_getparticipationsbreakdownbycontactid
Fields
- 'limit Signed32(default 10) - The limit for response size. The default value is 10, the max number is 100
- state? string - The participation state value. It may be REGISTERED, CANCELLED, ATTENDED, NO_SHOW
- after? string - The cursor indicating the position of the last retrieved item.
hubspot.marketing.events: GetParticipationsExternalaccountidExternaleventidBreakdown_getparticipationsbreakdownbyexternaleventidQueries
Represents the Queries record for the operation: getParticipationsExternalaccountidExternaleventidBreakdown_getparticipationsbreakdownbyexternaleventid
Fields
- contactIdentifier? string - The identifier of the Contact. It may be email or internal id.
- 'limit Signed32(default 10) - The limit for response size. The default value is 10, the max number is 100
- state? string - The participation state value. It may be REGISTERED, CANCELLED, ATTENDED, NO_SHOW
- after? string - The cursor indicating the position of the last retrieved item.
hubspot.marketing.events: GetParticipationsMarketingeventidBreakdown_getparticipationsbreakdownbymarketingeventidQueries
Represents the Queries record for the operation: getParticipationsMarketingeventidBreakdown_getparticipationsbreakdownbymarketingeventid
Fields
- contactIdentifier? string - The identifier of the Contact. It may be email or internal id.
- 'limit Signed32(default 10) - The limit for response size. The default value is 10, the max number is 100
- state? string - The participation state value. It may be REGISTERED, CANCELLED, ATTENDED, NO_SHOW
- after? string - The cursor indicating the position of the last retrieved item.
hubspot.marketing.events: GetQueries
Represents the Queries record for the operation: get
Fields
- 'limit Signed32(default 10) - The limit for response size. The default value is 10, the max number is 100
- after? string - The cursor indicating the position of the last retrieved item.
hubspot.marketing.events: MarketingEventAssociation
Fields
- externalAccountId? string? -
- marketingEventId string? -
- externalEventId? string? -
- name string? -
hubspot.marketing.events: MarketingEventCompleteRequestParams
Fields
- startDateTime string? -
- endDateTime string? -
hubspot.marketing.events: MarketingEventCreateRequestParams
Fields
- startDateTime? string? - The start date and time of the marketing event.
- customProperties? CrmPropertyWrapper[]? - A list of PropertyValues. These can be whatever kind of property names and values you want. However, they must already exist on the HubSpot account's definition of the MarketingEvent Object. If they don't they will be filtered out and not set. In order to do this you'll need to create a new PropertyGroup on the HubSpot account's MarketingEvent object for your specific app and create the Custom Property you want to track on that HubSpot account. Do not create any new default properties on the MarketingEvent object as that will apply to all HubSpot accounts.
- externalAccountId string? - The accountId that is associated with this marketing event in the external event application.
- eventCancelled? boolean? - Indicates if the marketing event has been cancelled. Defaults to
false
- eventOrganizer string? - The name of the organizer of the marketing event.
- eventUrl? string? - A URL in the external event application where the marketing event can be managed.
- externalEventId string? - The id of the marketing event in the external event application.
- eventDescription? string? - The description of the marketing event.
- eventName string? - The name of the marketing event.
- eventType? string? - Describes what type of event this is. For example:
WEBINAR
,CONFERENCE
,WORKSHOP
- eventCompleted? boolean? -
- endDateTime? string? - The end date and time of the marketing event.
hubspot.marketing.events: MarketingEventDefaultResponse
Fields
- startDateTime? string? - The start date and time of the marketing event.
- customProperties? CrmPropertyWrapper[]? - A list of PropertyValues. These can be whatever kind of property names and values you want. However, they must already exist on the HubSpot account's definition of the MarketingEvent Object. If they don't they will be filtered out and not set. In order to do this you'll need to create a new PropertyGroup on the HubSpot account's MarketingEvent object for your specific app and create the Custom Property you want to track on that HubSpot account. Do not create any new default properties on the MarketingEvent object as that will apply to all HubSpot accounts.
- eventCancelled? boolean? - Indicates if the marketing event has been cancelled.
- eventOrganizer string? - The name of the organizer of the marketing event.
- eventUrl? string? - The URL in the external event application where the marketing event can be managed.
- eventDescription? string? - The description of the marketing event.
- eventName string? - The name of the marketing event.
- eventType? string? - The type of the marketing event.
- eventCompleted? boolean? -
- endDateTime? string? - The end date and time of the marketing event.
- objectId? string? -
hubspot.marketing.events: MarketingEventEmailSubscriber
Fields
- contactProperties? record { string?... }? -
- properties? record { string?... }? -
- email string? - The email address of the contact in HubSpot to associate with the event.
- interactionDateTime int? - Timestamp in milliseconds at which the contact subscribed to the event.
hubspot.marketing.events: MarketingEventExternalUniqueIdentifier
Fields
- externalAccountId string? - The accountId that is associated with this marketing event in the external event application.
- externalEventId string? - The id of the marketing event in the external event application.
- appId Signed32? - The id of the application that created the marketing event in HubSpot.
hubspot.marketing.events: MarketingEventIdentifiersResponse
Fields
- externalAccountId? string? -
- externalEventId string? -
- appInfo? AppInfo? -
- objectId string? -
- marketingEventName string? -
hubspot.marketing.events: MarketingEventPublicDefaultResponse
Fields
- eventOrganizer string? - The name of the organizer of the marketing event.
- eventUrl? string? - A URL in the external event application where the marketing event can be managed.
- eventType? string? - The type of the marketing event.
- eventCompleted? boolean? -
- endDateTime? string? - The end date and time of the marketing event.
- createdAt string? -
- startDateTime? string? - The start date and time of the marketing event.
- customProperties? CrmPropertyWrapper[]? - A list of PropertyValues. These can be whatever kind of property names and values you want. However, they must already exist on the HubSpot account's definition of the MarketingEvent Object. If they don't they will be filtered out and not set. In order to do this you'll need to create a new PropertyGroup on the HubSpot account's MarketingEvent object for your specific app and create the Custom Property you want to track on that HubSpot account. Do not create any new default properties on the MarketingEvent object as that will apply to all HubSpot accounts.
- eventCancelled? boolean? - Indicates if the marketing event has been cancelled.
- eventDescription? string? - The description of the marketing event.
- eventName string? - The name of the marketing event.
- id string? -
- objectId? string? -
- updatedAt string? -
hubspot.marketing.events: MarketingEventPublicDefaultResponseV2
Fields
- eventOrganizer? string? -
- eventUrl? string? -
- appInfo? AppInfo? -
- eventType? string? -
- eventCompleted? boolean? -
- endDateTime? string? -
- createdAt string? -
- startDateTime? string? -
- customProperties CrmPropertyWrapper[]? -
- eventCancelled? boolean? -
- eventDescription? string? -
- eventName string? -
- objectId string? -
- updatedAt string? -
hubspot.marketing.events: MarketingEventPublicObjectIdDeleteRequest
Fields
- objectId string? -
hubspot.marketing.events: MarketingEventPublicReadResponse
Fields
- registrants Signed32? - The number of HubSpot contacts that registered for this marketing event.
- eventOrganizer string? - The name of the organizer of the marketing event.
- eventUrl? string? - A URL in the external event application where the marketing event can be managed.
- attendees Signed32? - The number of HubSpot contacts that attended this marketing event.
- eventType? string? - The type of the marketing event.
- eventCompleted? boolean? -
- endDateTime? string? - The end date and time of the marketing event.
- noShows Signed32? - The number of HubSpot contacts that registered for this marketing event, but did not attend. This field only had a value when the event is over.
- cancellations Signed32? - The number of HubSpot contacts that registered for this marketing event, but later cancelled their registration.
- createdAt string? -
- startDateTime? string? - The start date and time of the marketing event.
- customProperties? CrmPropertyWrapper[]? - A list of PropertyValues. These can be whatever kind of property names and values you want. However, they must already exist on the HubSpot account's definition of the MarketingEvent Object. If they don't they will be filtered out and not set. In order to do this you'll need to create a new PropertyGroup on the HubSpot account's MarketingEvent object for your specific app and create the Custom Property you want to track on that HubSpot account. Do not create any new default properties on the MarketingEvent object as that will apply to all HubSpot accounts.
- eventCancelled? boolean? - Indicates if the marketing event has been cancelled.
- externalEventId string? - The id of the marketing event in the external event application.
- eventDescription? string? - The description of the marketing event.
- eventName string? - The name of the marketing event.
- id string? -
- objectId? string? -
- updatedAt string? -
hubspot.marketing.events: MarketingEventPublicReadResponseV2
Fields
- registrants? Signed32? -
- eventOrganizer? string? -
- eventUrl? string? -
- attendees? Signed32? -
- appInfo? AppInfo? -
- eventType? string? -
- eventCompleted? boolean? -
- endDateTime? string? -
- noShows? Signed32? -
- cancellations? Signed32? -
- createdAt string? -
- startDateTime? string? -
- customProperties CrmPropertyWrapper[]? -
- eventCancelled? boolean? -
- externalEventId? string? -
- eventStatus? string? -
- eventDescription? string? -
- eventName string? -
- objectId string? -
- updatedAt string? -
hubspot.marketing.events: MarketingEventPublicUpdateRequestFullV2
Fields
- startDateTime? string? -
- customProperties CrmPropertyWrapper[]? -
- eventCancelled? boolean? -
- eventOrganizer? string? -
- eventUrl? string? -
- eventDescription? string? -
- eventName? string? -
- eventType? string? -
- endDateTime? string? -
- objectId string? -
hubspot.marketing.events: MarketingEventPublicUpdateRequestV2
Fields
- startDateTime? string? -
- customProperties CrmPropertyWrapper[]? -
- eventCancelled? boolean? -
- eventOrganizer? string? -
- eventUrl? string? -
- eventDescription? string? -
- eventName? string? -
- eventType? string? -
- endDateTime? string? -
hubspot.marketing.events: MarketingEventSubscriber
Fields
- vid int? -
- properties? record { string?... }? -
- interactionDateTime int? - Timestamp in milliseconds at which the contact subscribed to the event.
hubspot.marketing.events: MarketingEventUpdateRequestParams
Fields
- startDateTime? string? - The start date and time of the marketing event.
- customProperties? CrmPropertyWrapper[]? - A list of PropertyValues. These can be whatever kind of property names and values you want. However, they must already exist on the HubSpot account's definition of the MarketingEvent Object. If they don't they will be filtered out and not set. In order to do this you'll need to create a new PropertyGroup on the HubSpot account's MarketingEvent object for your specific app and create the Custom Property you want to track on that HubSpot account. Do not create any new default properties on the MarketingEvent object as that will apply to all HubSpot accounts.
- eventCancelled? boolean? - Indicates if the marketing event has been cancelled. Defaults to
false
- eventOrganizer? string? - The name of the organizer of the marketing event.
- eventUrl? string? - A URL in the external event application where the marketing event can be managed.
- eventDescription? string? - The description of the marketing event.
- eventName? string? - The name of the marketing event.
- eventType? string? - Describes what type of event this is. For example:
WEBINAR
,CONFERENCE
,WORKSHOP
- eventCompleted? boolean? -
- endDateTime? string? - The end date and time of the marketing event.
hubspot.marketing.events: NextPage
Fields
- link? string? -
- after string? -
hubspot.marketing.events: OAuth2RefreshTokenGrantConfig
OAuth2 Refresh Token Grant Configs
Fields
- Fields Included from *OAuth2RefreshTokenGrantConfig
- refreshUrl string(default "https://api.hubapi.com/oauth/v1/token") - Refresh URL
hubspot.marketing.events: ParticipationAssociations
Fields
- marketingEvent MarketingEventAssociation? -
- contact ContactAssociation? -
hubspot.marketing.events: ParticipationBreakdown
Fields
- associations ParticipationAssociations? -
- createdAt string? -
- id string? -
- properties ParticipationProperties? -
hubspot.marketing.events: ParticipationProperties
Fields
- occurredAt int? -
- attendancePercentage? string? -
- attendanceState "REGISTERED"|"ATTENDED"|"CANCELLED"|"EMPTY"|"NO_SHOW" -
- attendanceDurationSeconds? Signed32? -
hubspot.marketing.events: PatchEventsExternaleventid_updateQueries
Represents the Queries record for the operation: patchEventsExternaleventid_update
Fields
- externalAccountId string - The accountId that is associated with this marketing event in the external event application
hubspot.marketing.events: PostAttendanceExternaleventidSubscriberstateCreate_recordbycontactidsQueries
Represents the Queries record for the operation: postAttendanceExternaleventidSubscriberstateCreate_recordbycontactids
Fields
- externalAccountId? string - The accountId that is associated with this marketing event in the external event application
hubspot.marketing.events: PostAttendanceExternaleventidSubscriberstateEmailCreate_recordbycontactemailsQueries
Represents the Queries record for the operation: postAttendanceExternaleventidSubscriberstateEmailCreate_recordbycontactemails
Fields
- externalAccountId? string - The accountId that is associated with this marketing event in the external event application
hubspot.marketing.events: PostEventsExternaleventidCancel_cancelQueries
Represents the Queries record for the operation: postEventsExternaleventidCancel_cancel
Fields
- externalAccountId string - The accountId that is associated with this marketing event in the external event application
hubspot.marketing.events: PostEventsExternaleventidComplete_completeQueries
Represents the Queries record for the operation: postEventsExternaleventidComplete_complete
Fields
- externalAccountId string - The accountId that is associated with this marketing event in the external event application.
hubspot.marketing.events: PostEventsExternaleventidSubscriberstateEmailUpsert_upsertbycontactemailQueries
Represents the Queries record for the operation: postEventsExternaleventidSubscriberstateEmailUpsert_upsertbycontactemail
Fields
- externalAccountId string - The accountId that is associated with this marketing event in the external event application
hubspot.marketing.events: PostEventsExternaleventidSubscriberstateUpsert_upsertbycontactidQueries
Represents the Queries record for the operation: postEventsExternaleventidSubscriberstateUpsert_upsertbycontactid
Fields
- externalAccountId string - The accountId that is associated with this marketing event in the external event application
hubspot.marketing.events: ProxyConfig
Proxy server configurations to be used with the HTTP client endpoint.
Fields
- host string(default "") - Host name of the proxy server
- port int(default 0) - Proxy server port
- userName string(default "") - Proxy server username
- password string(default "") - Proxy server password
hubspot.marketing.events: PublicList
Fields
- processingType string? -
- objectTypeId string? -
- updatedById? string? -
- filtersUpdatedAt? string? -
- listId string? -
- createdAt? string? -
- processingStatus string? -
- deletedAt? string? -
- listVersion Signed32? -
- size? int? -
- name string? -
- createdById? string? -
- updatedAt? string? -
hubspot.marketing.events: SearchPublicResponseWrapper
Fields
- externalAccountId string? -
- externalEventId string? -
- appId Signed32? -
- objectId string? -
hubspot.marketing.events: StandardError
Fields
- subCategory? record {}? -
- context record { string[]?... }? -
- links record { string?... }? -
- id? string? -
- category string? -
- message string? -
- errors ErrorDetail[]? -
- status string? -
hubspot.marketing.events: SubscriberEmailResponse
Fields
- vid int? -
- email string? -
hubspot.marketing.events: SubscriberVidResponse
Fields
- vid int? -
Import
import ballerinax/hubspot.marketing.events;
Metadata
Released date: 29 days ago
Version: 0.1.0
License: Apache-2.0
Compatibility
Platform: any
Ballerina version: 2201.10.0
GraalVM compatible: Yes
Pull count
Total: 0
Current verison: 0
Weekly downloads
Contributors
Other versions
0.1.0