GameBench Session Data API

Main workflow

  1. Request an API authorisation token (/v1/Auth/login)
  2. Search for sessions (/v1/sessions)
  3. Get session details by session id (/v1/sessions/{sessionId})

Request an API authorisation token

curl -X POST "https://api.production.gamebench.net/v1/Auth/login" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"username\":\"john.smith@example.com\",\"password\":\"password\"}"

This API request returns an authorisation token

{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiSm9obiBTbWl0aCJ9.Pal-pduYcZ54HqMINX8zMwrzeEEidnMpuc_HpAjhHBQ"
}

You should use the above token in all sequential requests to the Gamebench API. You may request an authorisation token once and store it for all future API requests. Note: You need to generate a new token after changing the account password.

In order to make authorized API requests, there must be an Authorization header added to your request as below:

Authorization: JWT {token}

Where {token} is the token value from the /v1/Auth/login request response.

Search for sessions

Get the last 15 sessions recorded by any user within your company

This will show any session that was recorded by any user within the company.

curl -X POST "https://api.production.gamebench.net/v1/sessions?company=QcBvM2IB0D53NS9vlGcH&pageSize=15&sort=timePushed%3Adesc" -H "accept: application/json" -H "Authorization: JWT <token>" -H "Content-Type: application/json" -d "{\"apps\":[], \"devices\":[], \"manufacturers\":[]}"

Get the last 15 sessions recorded by the authenticated user

This will show only sessions that were recorded by the user whose details were used to generate the authorisation token.

curl -X POST "https://api.production.gamebench.net/v1/sessions?pageSize=15&sort=timePushed%3Adesc" -H "accept: application/json" -H "Authorization: JWT <token>" -H "Content-Type: application/json" -d "{\"apps\":[], \"devices\":[], \"manufacturers\":[]}"

Search for filter keywords

The below example returns an array of keyword objects based on the query parameter Ether

curl -X POST "https://api.production.gamebench.net/v1/sessions/typeahead" -H "accept: application/json" -H "Authorization: JWT <token>" -H "Content-Type: application/json" -d "{\"query\":[\"Ether\"]}"

The response looks like:

[
  {
    "key": "EtherPad",
    "doc_count": 3,
    "type": "app"
  },
  {
    "key": "STF-L09",
    "doc_count": 138,
    "type": "device"
  },
  {
    "key": "Huawei",
    "doc_count": 4827,
    "type": "manufacturer"
  }
]

The key values in the above response can be used as keywords in the session search API as below.

Get the last 15 sessions filtered by app, device, and manufacturer keywords

This request will return sessions recorded by any user in the company that match the specified keywords

curl -X POST "https://api.production.gamebench.net/v1/sessions?company=QcBvM2IB0D53NS9vlGcH&pageSize=15&sort=timePushed%3Adesc" -H "accept: application/json" -H "Authorization: JWT <token>" -H "Content-Type: application/json" -d "{\"apps\":[\"EtherPad\"],\"devices\":[\"STF-L09\"],\"manufacturers\":[\"HUAWEI\"]}"

Get session details by session id

For all requests as below, you must replace {sessionId} with a valid session ID. A session ID can be obtained from the session search results or from the URL of a session in your GameBench web dashboard.

Get session details

This response contains the session summary information as well as general app and device details.

curl -X GET "https://api.production.gamebench.net/v1/sessions/{sessionId}" -H "accept: application/json" -H "Authorization: JWT <token>"

Get session battery data in a time-series format

curl -X GET "https://api.production.gamebench.net/v1/sessions/{sessionId}/battery" -H "accept: application/json" -H "Authorization: JWT <token>"

Get session CPU core frequency data in a time-series format

curl -X GET "https://api.production.gamebench.net/v1/sessions/{sessionId}/corefreq" -H "accept: application/json" -H "Authorization: JWT <token>"

Get session CPU utilisation data in a time-series format

curl -X GET "https://api.production.gamebench.net/v1/sessions/{sessionId}/cpu" -H "accept: application/json" -H "Authorization: JWT <token>"

Get session energy data in a time-series format

curl -X GET "https://api.production.gamebench.net/v1/sessions/{sessionId}/energy" -H "accept: application/json" -H "Authorization: JWT <token>"

Get session FPS data in a time-series format

curl -X GET "https://api.production.gamebench.net/v1/sessions/{sessionId}/fps" -H "accept: application/json" -H "Authorization: JWT <token>"

Get session FPS stability distribution data

curl -X GET "https://api.production.gamebench.net/v1/sessions/{sessionId}/fpsStability" -H "accept: application/json" -H "Authorization: JWT <token>"

Get session GPU utilisation data for Imagination Technologies GPUs in a time-series format

curl -X GET "https://api.production.gamebench.net/v1/sessions/{sessionId}/gpu/img" -H "accept: application/json" -H "Authorization: JWT <token>"

Get session GPU utilisation data for all other GPU manufacturers in a time-series format

curl -X GET "https://api.production.gamebench.net/v1/sessions/{sessionId}/gpu/other" -H "accept: application/json" -H "Authorization: JWT <token>"

Get session janks data in a time-series format

curl -X GET "https://api.production.gamebench.net/v1/sessions/{sessionId}/janks" -H "accept: application/json" -H "Authorization: JWT <token>"

Get an array of session markers

curl -X GET "https://api.production.gamebench.net/v1/sessions/{sessionId}/markers" -H "accept: application/json" -H "Authorization: JWT <token>"

Get session memory data in a time-series format

curl -X GET "https://api.production.gamebench.net/v1/sessions/{sessionId}/memory" -H "accept: application/json" -H "Authorization: JWT <token>"

Get session network data in a time-series format

curl -X GET "https://api.production.gamebench.net/v1/sessions/{sessionId}/network" -H "accept: application/json" -H "Authorization: JWT <token>"

Get an array of session notes

curl -X GET "https://api.production.gamebench.net/v1/sessions/{sessionId}/notes" -H "accept: application/json" -H "Authorization: JWT <token>"

Get session power data in a time-series format

curl -X GET "https://api.production.gamebench.net/v1/sessions/{sessionId}/power" -H "accept: application/json" -H "Authorization: JWT <token>"

Version: 1.0.0

Contact information:
support@gamebench.net

/v1/Auth/login


POST

Summary: generates auth token

Description: By passing in the valid username and password pair, you can get authorization token that can be used in subsequential requests

Responses

Code Description
200 token for API access

/v1/sessions


POST

Summary: searches for latest session

Description: By passing in the appropriate options, you can search for available sessions in the system

Parameters

Name Located in Description Required Schema
company query perform the search in the scope of the company; if not specified then search will be in the scope of the user Yes string
page query number of requested page (starts from 0) No integer
pageSize query maximum number of records to return on pne page No integer
sort query ordering setting (:) No string

Responses

Code Description
200 search results matching criteria

Security

Security Schema Scopes
jwtAuth

/v1/sessions/typeahead


POST

Summary: searches for keywords

Description: By passing in the appropriate request body, you can search for available session keywords in the system that can be used in the session search request

Responses

Code Description
200 search results matching criteria

Security

Security Schema Scopes
jwtAuth

/v1/sessions/{sessionId}


GET

Summary: Retrieves session data by session id

Parameters

Name Located in Description Required Schema
sessionId path session id Yes string

Responses

Code Description
200 session data

Security

Security Schema Scopes
jwtAuth

/v1/sessions/{sessionId}/battery


GET

Summary: Retrieves time-series formatted battery data for a specific session

Parameters

Name Located in Description Required Schema
sessionId path session id Yes string

Responses

Code Description
200 session battery data

Security

Security Schema Scopes
jwtAuth

/v1/sessions/{sessionId}/corefreq


GET

Summary: Retrieves time-series formatted CPU core frequency data for a specific session

Parameters

Name Located in Description Required Schema
sessionId path session id Yes string

Responses

Code Description
200 session core frequencies data

Security

Security Schema Scopes
jwtAuth

/v1/sessions/{sessionId}/cpu


GET

Summary: Retrieves time-series formatted CPU data for a specific session

Parameters

Name Located in Description Required Schema
sessionId path session id Yes string

Responses

Code Description
200 session CPU data

Security

Security Schema Scopes
jwtAuth

/v1/sessions/{sessionId}/energy


GET

Summary: Retrieves time-series formatted energy data for a specific session

Parameters

Name Located in Description Required Schema
sessionId path session id Yes string

Responses

Code Description
200 session energy data

Security

Security Schema Scopes
jwtAuth

/v1/sessions/{sessionId}/fps


GET

Summary: Retrieves time-series formatted FPS data for a specific session

Parameters

Name Located in Description Required Schema
sessionId path session id Yes string

Responses

Code Description
200 session FPS data

Security

Security Schema Scopes
jwtAuth

/v1/sessions/{sessionId}/fpsStability


GET

Summary: Retrieves distribution formatted FPS stability data for a specific session

Parameters

Name Located in Description Required Schema
sessionId path session id Yes string

Responses

Code Description
200 session FPS stability data

Security

Security Schema Scopes
jwtAuth

/v1/sessions/{sessionId}/gpu/img


GET

Summary: Retrieves time-series formatted GPU data for a specific session on a device with an Imagination Technology GPU

Parameters

Name Located in Description Required Schema
sessionId path session id Yes string

Responses

Code Description
200 session Imagination Tech GPU data

Security

Security Schema Scopes
jwtAuth

/v1/sessions/{sessionId}/gpu/other


GET

Summary: Retrieves time-series formatted GPU data for a specific session on a device with any non-Imagination Technologies GPU

Parameters

Name Located in Description Required Schema
sessionId path session id Yes string

Responses

Code Description
200 session GPU data

Security

Security Schema Scopes
jwtAuth

/v1/sessions/{sessionId}/janks


GET

Summary: Retrieves time-series formatted janks data for a specific session

Parameters

Name Located in Description Required Schema
sessionId path session id Yes string

Responses

Code Description
200 session janks data

Security

Security Schema Scopes
jwtAuth

/v1/sessions/{sessionId}/markers


GET

Summary: Retrieves a list of markers for a specific session

Parameters

Name Located in Description Required Schema
sessionId path session id Yes string

Responses

Code Description
200 session markers

Security

Security Schema Scopes
jwtAuth

/v1/sessions/{sessionId}/memory


GET

Summary: Retrieves time-series formatted memory data for a specific session

Parameters

Name Located in Description Required Schema
sessionId path session id Yes string

Responses

Code Description
200 session memory data

Security

Security Schema Scopes
jwtAuth

/v1/sessions/{sessionId}/network


GET

Summary: Retrieves time-series formatted network data for a specific session

Parameters

Name Located in Description Required Schema
sessionId path session id Yes string

Responses

Code Description
200 session network data

Security

Security Schema Scopes
jwtAuth

/v1/sessions/{sessionId}/notes


GET

Summary: Retrieves a list of notes for a specific session

Parameters

Name Located in Description Required Schema
sessionId path session id Yes string

Responses

Code Description
200 session notes

Security

Security Schema Scopes
jwtAuth

/v1/sessions/{sessionId}/power


GET

Summary: Retrieves time-series formatted power data for a specific session

Parameters

Name Located in Description Required Schema
sessionId path session id Yes string

Responses

Code Description
200 session power data

Security

Security Schema Scopes
jwtAuth
Still need help? Get in touch!
Last updated on 31st Oct 2018