REST API - Retrieving a list of sessions for a given user after the fact

Not all support ticket tools make it easy to supply programmatic custom data at the time the ticket is created by your customers. As such, we provide a secure server side API for retrieving a list of sessions for a particular user.

Endpoints

/api/v1/sessions

This endpoint returns a list of session URLs for a given user’s email address. These requests are scoped to user in the context of a single Fullstory account. These URLs are only accessible by browsers who have logged in to the appropriate Fullstory account, and thus safe to share via email.

The parameters to this endpoint are:

Param name
Type
Description
limit
int
Optional. The max number of sessions to return (defaults to 20).
uid
string
The uid is your app's user id for the current user set via FS.identify.
email
string
The email address that you have associated with a FullStory session via FS.identify orFS.setUserVars.

Specifying both uid and email will return the union of matches for a given uid or email. An example request and response for an email only query with 1 result would look like:

curl -H "Authorization: Basic YOUR_API_KEY" https://www.fullstory.com/api/v1/sessions?email=john@example.com

[{
 "UserId": 1234567890,
 "SessionId": 1234567890,
 "CreatedTime": 1411492739,
 "FsUrl": "https://www.fullstory.com/ui/ORG_ID/discover/session/1234567890:1234567890"
}]

All requests must supply the required API token in the form of a custom request header.'Authorization': 'Basic [YOUR API TOKEN]'

The following is an example of how to set this head in Javascript code.

var xhr = new XMLHttpRequest();
 xhr.open("GET", "https://www.fullstory.com/api/v1/sessions?email=" + encodeURI("john@doe.com"), true);
 xhr.setRequestHeader('Content-Type', "application/json");
 xhr.setRequestHeader('Authorization', "Basic " + "YOUR_API_TOKEN_FROM_SETTINGS_PAGE");
 xhr.withCredentials = true

You can generate your integrations API token from your Settings Page in FullStory. This token also encodes your Fullstory account identifier, so no need to supply that separately.

By default the API returns the last 20 sessions the user has seen. Callers can change this value by supplying an optional limit parameter.

There are two ways to make requests to this endpoint:

  1. GET requests must supply arguments as simple URL query parameters. For example:
api/v1/sessions/?email=john@doe.com&limit=15
  • POST requests must submit arguments as part of a JSON encoded request body. An examplePOST request would be:
{
 limit: 20,
 email: john@doe.com
}

Third-Party Tools

These tools and libraries have been created by third-party developers for interacting with the FullStory REST API. While they have not been vetted by FullStory, we're providing them here for the benefit of other developers.

  • FullStory npm package for Node.js - The FullStory SDK for API version 1 supporting both Promise and Callback styles.

Was this article helpful?

/

Can’t find what you’re looking for?

The FullStory team awaits your every question.

Contact Us