Skip to main content
Gainsight Inc.

Tutorial: Use External Events to Trigger a Program

Overview

This tutorial explains how to register an external event to trigger a Program. Gainsight provides you the capability to publish events from an external system (apart from SFDC and MDA). You can also watch this 8-min. video on how to create an event for use as a participant source in Programs.

For more information on events, see the Events Framework article.

In the example below, we will consider an order complete event from an external fulfillment system as the external event. When this event occurs, an order satisfaction survey e-mail will be sent to the customer.

External Events 1.png

Procedure

  1. Open the following url:

https://<salesforce instance url>/apex/Administration#Administration-EventsFramework

External Events 2.png

  1. Register the Order Complete event using the standard instructions provided in the Events Framework article.

Notes:

  • Ensure that the structure of data coming in to the AO through this event is in the standard format. For structure format requirements, see Events Framework.
  • When the events framework is enabled, a token is provided. This token is used for security authentication for the customer/tenant when the events are published.
  1. Once the event is registered, publish the event using the following code:

curl -X POST -H "Content-Type: application/json" -H "topicName: <topic created on events page> " -H "eventName: <event registered on the events page>" -H "eventVersion: <version of the event to be used> " -H "contractId: <AO ID generated when an AO is created> " -H "sharedSecret: <token from the events page for authentication>" -H "tenantId: <tenant-id from gainsight, contact support if not known>" -d '{data contract}' https://ep.gainsight.com/api/v0.1/eventManager/event

  1. The posted event is received as part of the above mentioned trigger and broadcasted to Programs.
  2. Program then receives the events and processes them to add as participants and send further emails. To validate, you can check if the participants have been added inside the Program.

External Event added as Participant

Snip20180726_17.png

Order Satisfaction Survey sent as part of ProgramOrder Satisfaction Survey.png

 

  • Was this article helpful?