Use the API to programatically create a calendar subscription using the Google Calendar

This API function requires that your application be authenticated via OAuth. You can learn how to authenticate your application here.

calendarParams

ParameterTypeDescription
subscriberId

Optional
StringIdentifier that represents a unique user to you. E.g. email address, device id, anonymous id.
emailAddress

Optional
StringEmail address linked to the subscription. Rokt Calendar allows you to capture the the email address of a subscriber so that you can market to the subscriber at a later date.
additionalOptIn

Optional
BooleanAdditional opt-in allows the subscriber to specify if they are opting-in to the question/statement as defined by the copy associated with the checkbox.
calendarTags

Optional
CalendarTags[]Array of calendar tags to filter events by. Tags are used to group similar events. For example all events that belong to the same sporting team/topic can be tagged with a team name.

When a tagId is used, the subscription will only include events tagged with the selected tag.

See Calendar Tag Model for complete schema.
timezoneId

Optional
StringWindows timezone identifier to filter events by. If used, the subscription will include events that are tagged with this time zone and any events that are not tagged with a time zone.

See Timezones for available list.
requestEventIds

Optional
String[]
(UUID/GUID)
An array of event identifiers. Identifiers that do not match will be ignored.
externalEventIds

Optional
String[]One or more identifiers that represents unique events to you. Identifiers that do not match will be ignored.
utmSource

Optional
StringValue used to identify the referring subscriber Source. This is used as the UTM Source in Dashboard Analytics. e.g. Newsletter-December.
utmMedium

Optional
StringValue used to identify the referring subscriber Medium. This is used as the UTM Source in Dashboard Analytics. e.g. Email
utmCampaign

Optional
StringValue used to identify the referring subscriber Campaign. in Dashboard Analytics. e.g. Summer Campaign
utmContent

Optional
StringValue used to identify the referring subscriber Content. Used for Dashboard Analytics. in Dashboard Analytics. e.g. 400x300 banner
userAgent

Optional
StringThe user agent string extracted from the Http header of the API request. This is used to identify the users operating system, device and other important parameters.
urlReferrer

Optional
StringUrl referrer of the user. Used for Dashboard Analytics. The place from which the subscriber navigated to the calendar page. e.g. Facebook
ipAddress

Optional
StringIP Address of the user. Used for monitoring and logging purposes
events

Optional
EventDetails[]You can add manual events to this subscription that belong solely to this subscription.
redirectTo

Required
StringThe url to redirect the user to after the subscription has been created.

Response

A Google subscription initially requires the user to authorize us to have access to their Google Calendar, once this is done the flow will be essentially the same as a WebCal.

New Subscription
Before we can create the subscription, the user must be redirected to Google OAuth Consent Form, to authorize us. The response will be 302 (content found) with a redirect link to Google OAuth page.

After the user has selected an option on the consent form we will redirect the user back to the caller using the redirectTo url provided in the request and the result as query parameters.

Result Query Parameters

ParameterTypeDescription
success

Always present
BooleanIndicates if the subscription was created successfully.
subscriberId

Sometimes present
StringIdentifier that represents a unique user to you given to us in initial request.
new

Sometimes present
BooleanIndicates if it is a new subscription was created. If false an existing subscription has been updated.
subscriptionId

Sometimes present
UUID/GUIDUnique identifier of the subscription.
errors

Sometimes present
Errors[]
(Json)
Json serialize array of Errors

📘

Tip

To deactivate subscribers please see the information in this section Deactivate an Existing Subscription

Language