Overview
This page builds two of an integration’s three baseline views: a report-runner view charting what the integration processed, and an event-stream view carrying a live feed of the events it produces. Integration Categories covers what each category charts and streams.When You Would Build These
Every build path needs both, whatever the partner does. The third view comes from Create the Integration Campaign and Component Model.Before You Start
You need an integration campaign whose model component owns aviews socket and an access token authorized to manage campaigns, components, report runners, and event streams.
How to Build
Create the Two View Components
Name the componentsreport-runner-view and event-streams — literal names that let a client-local build be compared against the packaged one. Tab labels come from each view’s title.
Both install into the views socket via installed_into_socket; socket_name is not a property of a component create. Give each title, status, and settingsToDisplay, the last typed STRING_LIST.
withType("EVENT_STREAM") in place of withType("REPORT_RUNNER"):
- Type the element setting
STRING—reportRunnerIdon the report view,eventStreamIdon the event-stream view; there is noREPORT_RUNNER_IDorEVENT_STREAM_IDtype. Each holds a buildtime query for the element its own component owns, so the view survives the element being recreated. - Wrap every Java collection in
Java.from, as both expressions do; settings are evaluated as part of the create. - Give every view an
ordertypedINTEGER, lowest first, configuration at the front.
Map the Report’s Columns to a Chart
Give the report-runner view areportColumnsMapping setting typed JSON, the mapping serialized as an escaped string. Every column it names — the axis column and each series column — must be one the runner’s mappings expression produces, by exactly the name that expression assigns.
Republish Before Attaching Elements
A bundled component declareselements inline; the API creates each as its own resource attached by component_ids — report_runners becomes POST /v7/report-runners, event_streams becomes POST /v6/event-streams with filters added afterward. Attach each to the view that displays it: the runner to $REPORT_VIEW_COMPONENT_ID, the stream to $EVENT_STREAM_VIEW_COMPONENT_ID.
Publish now, after creating the views and before creating their elements: a component_ids reference resolves against the published campaign, the same rule that governs webhooks and reward suppliers.
The publish operation is not carried in the OpenAPI specification, so a reference lookup returns nothing found. This page and Validate and Publish an Integration are its documentation.
Choose or Create the Report Type
report_type is an account-scoped identifier, so read the account’s types and match on display name. Filter the listing: a mature account holds a couple of hundred types and the unfiltered response runs to roughly a megabyte.
display_name, search_query, report_type_id, tags, limit, and offset. Pass the type’s name as report_type — an opaque string such as r84a5841xf0hehbzsf6j. A report type has no id field, so a projection asking for one returns a list of nulls. Read a candidate in full with GET /v6/report-types/{id}, whose path segment takes that same name, before choosing between types sharing a display name. Re-read before acting on an empty result: a truncated response is not an absent type.
Two properties decide whether a type works:
- The parameters it declares are the only ones the runner may send, with values from its own enumerations: a time range is
ALL_TIME, notall_time, and a locale list accepts only locales the account declares. Add them one at a time when one is refused. - The mappings dialect it accepts. A row-shaped
mappingsparameter rejects the grouping functionsgroup_countandGROUP_SUMa charted activity report needs; a metric-shaped one accepts them. Read the parameter’s type before writing the expression, and choose the parent by that, not by a close-sounding display name.
GET /v6/report-types and copy its parameter names.
Build the Report Behind the Activity Tab
A report runner is a scheduled report, its parameter values, and an attachment to the view that charts it:mappings expression is where the partner shows up: count and group the events this integration produces — business events an inbound build maps to, reward events a fulfillment partner generates, outbound activity a library install forwards — and give each series a column the chart mapping can name.
Where the partner page publishes a runner contract, copy it literally: name, schedule, formats, tags, scopes, execution policy, and every parameter and mapping expression.
Give schedule_start_date an ISO-8601 timestamp with an offset, dated in the future. A runner’s type is fixed once created: one made REFRESHING cannot become scheduled.
Build the Event Stream Behind the Events Tab
Create the stream after the republish above, then add each filter. Filters are created under the stream with atype discriminator in the body rather than a path segment, the opposite of reward webhook filters. The create returns the EVENT_STREAM_ID filters need.
APPLICATION_TYPE narrows it to the partner’s app type and belongs on every stream. Add an EVENT_TYPE filter when the integration produces one recognizable class of event, as reward fulfillment does with {"type": "EVENT_TYPE", "event_types": ["REWARD", "SEND_REWARD"]}.
Republish Again So the Views Resolve Their Elements
Neither view stores the identifier. Each carries ajavascript@buildtime query for the element attached to its own component:
withType('EVENT_STREAM'). Both evaluate when the campaign is built and return null when nothing of that type is attached. So the sequence is publish, create the elements, publish again:
$CAMPAIGN_VERSION first.
How to Test
Read the built campaign — a component’s own definition holds the buildtime query, not an identifier — and confirm:reportRunnerIdandeventStreamIdare non-null.- Each element’s
component_idsnames its own view. - The stream carries
APPLICATION_TYPE, plus anyEVENT_TYPEfilter needed. - Every column
reportColumnsMappingnames is one the runner’smappingsproduces. schedule_start_dateis in the future.
