Gainsight - Huddle/huddle-apis GitHub Wiki

Summary

The Gainsight endpoint returns the GainsightPX configuration and identity data for the current user, so a client can decide whether to load GainsightPX and how to identify the user to it.

The response is driven by a server-side feature flag and the user's account eligibility:

  • Disabled — when the Gainsight.IsGainsightEnabled server config flag is off, the account is a FedRamp account, or the account has no valid Ideagen Account ID (IAID), only isGainsightEnabled: false is returned.
  • Enabled — when the feature is on and the account is eligible, the full identity payload (PX tag, hashed email, account/plan identifiers) is returned.

The endpoint also inspects the X-Client-App request header to return the GainsightPX tag appropriate to the calling client (web, mobile, or desktop). See Client type resolution.

Note: This endpoint is served by the legacy trunk REST API and is mounted under /rest. It is scoped to the authenticated caller — there are no path or query parameters.

Operations

Method Path Purpose Details
GET /rest/gainsight Get the current user's Gainsight configuration and identity Jump

Get Gainsight data

Returns the GainsightPX configuration for the authenticated user. Requires a valid authorization token; the user is taken from the security context (no user identifier is passed in the request).

The GainsightPX tag returned depends on the X-Client-App header (see Client type resolution). All other fields are derived from the user's eligible account.

Client type resolution

X-Client-App value Client type Config key used for gainsightPXTag
huddle-android-app3, huddle-iphone-app Mobile GainsightPXTagForMobile
HuddleDesktopPC, HuddleDesktopMac Desktop GainsightPXTagForDesktop
Any other value, or header absent Web GainsightPXTag

JSON Example

Request

GET /rest/gainsight HTTP/1.1
Accept: application/vnd.huddle.data+json
X-Client-App: huddle-iphone-app
Authorization: Bearer frootymcnooty/vonbootycherooty

Response

HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+json
{
  "isGainsightEnabled": true,
  "gainsightPXTag": "AP-XXXXXXXXXXXX-2",
  "emailAddress": "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8",
  "userLicenseType": "Enterprise",
  "userRole": "WorkspaceManager",
  "salesforceAccountId": "0011234567|PLAN_GOLD|SKU-HUDDLE-01",
  "accountName": "Acme Corporation",
  "parentGroupId": "0011234567",
  "plan": "PLAN_GOLD",
  "ideagenSku": "SKU-HUDDLE-01",
  "sfdcId": "0011234567"
}

When Gainsight is not enabled for the user, only the flag is returned:

HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+json
{
  "isGainsightEnabled": false
}

XML Example

Request

GET /rest/gainsight HTTP/1.1
Accept: application/vnd.huddle.data+xml
X-Client-App: HuddleDesktopPC
Authorization: Bearer frootymcnooty/vonbootycherooty

Response

HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+xml
<?xml version="1.0" encoding="utf-8"?>
<Gainsight xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <isGainsightEnabled>true</isGainsightEnabled>
  <gainsightPXTag>AP-XXXXXXXXXXXX-3</gainsightPXTag>
  <emailAddress>5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8</emailAddress>
  <userLicenseType>Enterprise</userLicenseType>
  <userRole>WorkspaceManager</userRole>
  <salesforceAccountId>0011234567|PLAN_GOLD|SKU-HUDDLE-01</salesforceAccountId>
  <accountName>Acme Corporation</accountName>
  <parentGroupId>0011234567</parentGroupId>
  <plan>PLAN_GOLD</plan>
  <ideagenSku>SKU-HUDDLE-01</ideagenSku>
  <sfdcId>0011234567</sfdcId>
</Gainsight>

When Gainsight is not enabled, only the flag element is returned:

<?xml version="1.0" encoding="utf-8"?>
<Gainsight xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <isGainsightEnabled>false</isGainsightEnabled>
</Gainsight>

Properties

Name Description
isGainsightEnabled Whether GainsightPX should be loaded for this user. When false, all other fields are omitted.
gainsightPXTag The GainsightPX product tag to initialise, chosen by client type (see Client type resolution).
emailAddress SHA-256 hash of the user's email address (the raw email is never returned).
userLicenseType The account's package/licence name.
userRole The user's role within the account.
salesforceAccountId The Ideagen Account ID (IAID), of the form `{parentGroupId}
accountName The account name. On the US instance (TopLevelDomain = com) this is US_{accountId} instead of the display name.
parentGroupId First segment of the IAID — the parent (Salesforce) group identifier.
plan Second segment of the IAID — the plan code.
ideagenSku Third segment of the IAID — the Ideagen SKU.
sfdcId The Salesforce identifier (same value as parentGroupId).

IAID format: salesforceAccountId must contain at least three |-separated segments, each at least two characters long, otherwise the account is treated as ineligible and isGainsightEnabled: false is returned.

Response codes

Code Description
200 OK Configuration returned. Inspect isGainsightEnabled to determine whether the identity fields are present.
401 Unauthorized Invalid or missing authorization token.

See also

⚠️ **GitHub.com Fallback** ⚠️