Welcome to our new documentation site! All public articles are available here. If you can’t find an article you’re looking for, or a private article isn’t loading, contact docs@gainsight.com, and we’ll help.

Events API

Prev Next

Gainsight NXT

This article explains how to publish an event in Gainsight through the publish an event API.

Introduction

The Publish an Event API helps the publisher to publish an event. The Publish an Event API is an external API which helps you to publish an event in the Gainsight.

Authentication/ Authorization

API access is controlled using a SharedSecret Key. You need to register the sender of Events (any other system infrastructure) from Gainsight. Gainsight generates a unique key for this registration which is used while configuring the publisher. This key is always unique for a specific org and should be kept secured.

Headers

Key

Value

eventVersion

v01

sharedSecret

<secret-token>

eventName

sample_event

Content-Type

JSON

tenantId

<tenant-id>

Throttling Limits

API

Rate Limit

Synchronous API Calls

100 API calls per min / 100,000 API call per day

Asynchronous API Calls (Gainsight bulk APIs limit)

10 calls per hour / 100 per day

Note: All of the above API limits are *Fixed window rate limits.

* Fixed window rate limiting restricts the number of API requests at a specific time. For example, a server can have a rate limiting component that implements a fixed window algorithm that only accepts 100 requests per minute. The time-frame is fixed, and it starts at a specific time. For example, the server will only serve 100 requests between 10:00 am, and 10:01 am.

Publish an Event API

The Publish an Event API is an external API which helps you to publish an event in the Gainsight.

Method

POST

Endpoint URL

version/eventManager/event

Sample Request Body

{
  "hello":"world"
}

Publish a System Asset Event

The System Asset Events is being introduced to serve as the connecting mechanism for various systems to communicate with one another without depending on time-based schedules.

Sample Request Body to Publish A System Asset Event

{
  "tenantId":"tid",
  "assetType": "OBJECTS", //  DO NOT USE COLLECTION_MASTER
  "assetId": "Company", //ObjectName 
  "operationType": "DATA", //DATA, METADATA
  "operation": "UPSERT", //  INSERT, UPDATE, UPSERT,DELETE 
  "objectType": "CUSTOM",
  "objectName":"Company",
  "consumer": "BULK_API",
  "dbCollectionName": "salesReport_fdsgw45w45353fetrkgn4k56456",
  "dataStoreType": "REDSHIFT",
  "status": "PARTIAL_SUCCESS",
  "bucketName": "devs3_abcxyz",
  "successFilePath": "MDA-Data-Ingest/input/success/success.csv",
  "errorFilePath": "MDA-Data-Ingest/input/error/error.csv",
  "successCount": 5,
  "failureCount": 2,
  "totalCount": 7,
  "errorMessage": "",
  "jobId": "a3aa9b9f-7b9a-48f0-9fe8-2fe0f1b5a10b",
  "requestId": "",
  "consumerProperties": {
    "jobName": "load to sales",
    "s3FilePath": "",
    "operation": "UPSERT",
    "collectionId": "",
    "projectId": "",
    "uc_id": ""
  }
}

Parameters

Parameter

Data Type

Values

Description

assetType*

String

Objects/Rules/DD

A String value that contains an asset to configure the event.

assetId*

String

UniqueId for Asset

A String value that contains an AssetId which is the unique identification id of assetType.

operation*

String

INSERT,UPDATE,UPSERT,DELETE

A String value that indicates what kind of operation needs to be performed with the event request.

tenantId*

String

tenantId

A String value that contains the origin/tenantId/instanceId for which the event needs to configured for.

eventName*

String

eventName

A String value that contains the name of the event to be configured.

topicName*

String

topicName

A String value that contains the topic where the event is published.

eventVersion*

String

eventVersion

A String value that shows the version of the event. Use versioning to track changes and help systems understand it.

Sample Success Response

{
  "result": true,
  "data": {
    "eventId": "259d8882-8b13-4ded-b2b0-39c43359739d"
  },
  "message": "Successfully received event, please keep the event Id for further reference",
  "messages": [
    "Successfully received event, please keep the event Id for further reference"
  ]
}

Sample Failure Response

{
  "result": false,
  "errorCode": "1001",
  "errorDesc": "Oops, something went wrong! Please contact Tech Support to report. ",
  "requestId": "4e1f3665-eb88-4017-8dff-2c8d400c9111",
  "message": "Event is not registered",
  "messages": [
    "Event is not registered"
  ]
}

Error Codes

Error Code

Error Message

Reason

HTTP Status Code

1001

Oops, something went wrong! Please contact Tech Support to report.

Event is not registered

400