Skip to main content

Metrics API

Use these endpoints to pull aggregate metrics per group or participant.

Get Number of Group Sessions

GET /metrics/groups/{groupID}/count

Get the number of sessions for a group.

Headers

{ "x-api-key": "YOUR_API_KEY" }

URL Parameters

  • groupID (required): The group ID of the group you want to view the count of.

Query String Parameters

  • from (optional): The start date for the range of sessions to count. Format: YYYY-MM-DD.
  • to (optional): The end date for the range of sessions to count. Format: YYYY-MM-DD.
  • groupBy (optional): The time period to group the sessions by. Options: day, week, month.

Example Call

await fetch(
"https://api.okaya.me/metrics/groups/123456/count?from=YYYY-MM-DD&to=YYYY-MM-DD&groupBy=day",
{
method: "GET",
headers: {
"x-api-key": "YOUR_API_KEY",
},
}
).then((response) => response.json());

Example Response

200

{
"all": 10
}

400

{ "error": "You are missing the path parameter groupID" | "groupID must be a number" }

401: Unauthorized

Get MHCI Metrics for a Group

GET /metrics/groups/{groupID}/mhci

Get MHCI metrics for a group.

Headers

{ "x-api-key": "YOUR_API_KEY" }

URL Parameters

  • groupID (required): The group ID of the group you want to view the count of.

Query String Parameters

  • from (optional): The start date for the range of sessions to count. Format: YYYY-MM-DD.
  • to (optional): The end date for the range of sessions to count. Format: YYYY-MM-DD.
  • groupBy (optional): The time period to group the sessions by. Options: day, week, month.

Example Call

await fetch(
"https://api.okaya.me/metrics/groups/123456/mhci?from=YYYY-MM-DD&to=YYYY-MM-DD&groupBy=day",
{
method: "GET",
headers: {
"x-api-key": "YOUR_API_KEY",
},
}
).then((response) => response.json());

Example Response

200

{
"all": {
"minMhci": 20.0,
"maxMhci": 80.0,
"avgMhci": 50.0,
"percentile25Mhci": 40.0,
"percentile50Mhci": 50.0,
"percentile75Mhci": 60.0
}
}

400

{ "error": "You are missing the path parameter groupID" | "groupID must be a number" }

401: Unauthorized

Get Wordcloud for a Group

GET /metrics/groups/{groupID}/wordcloud

Get frequency of each word from session transcripts for a group.

Headers

{ "x-api-key": "YOUR_API_KEY" }

URL Parameters

  • groupID (required): The group ID of the group you want to view the count of.

Query String Parameters

  • from (optional): The start date for the range of sessions to count. Format: YYYY-MM-DD.
  • to (optional): The end date for the range of sessions to count. Format: YYYY-MM-DD.
  • groupBy (optional): The time period to group the sessions by. Options: day, week, month.
  • top (optional): The number of top words to return. Must be an integer.

Example Call

await fetch(
"https://api.okaya.me/metrics/groups/123456/wordcloud?from=YYYY-MM-DD&to=YYYY-MM-DD&groupBy=day&top=1",
{
method: "GET",
headers: {
"x-api-key": "YOUR_API_KEY",
},
}
).then((response) => response.json());

Example Response

200

{
"all": {
"word1": 0.01,
"word2": 0.02,
"word3": 0.03,
...
}
}

400

{ "error": "You are missing the path parameter groupID" | "groupID must be a number" }

401: Unauthorized

Get Number of Participant Sessions

GET /metrics/participants/{externalID}/count

Get the number of sessions for a participant.

Headers

{ "x-api-key": "YOUR_API_KEY" }

URL Parameters

  • externalID (required): The external identifier for the participant.

Query String Parameters

  • from (optional): The start date for the range of sessions to count. Format: YYYY-MM-DD.
  • to (optional): The end date for the range of sessions to count. Format: YYYY-MM-DD.
  • groupBy (optional): The time period to group the sessions by. Options: day, week, month.

Example Call

await fetch(
"https://api.okaya.me/metrics/participants/ok_participant1/count?from=YYYY-MM-DD&to=YYYY-MM-DD&groupBy=day",
{
method: "GET",
headers: {
"x-api-key": "YOUR_API_KEY",
},
}
).then((response) => response.json());

Example Response

200

{
"all": 10
}

400

{ "error": "You are missing the path parameter externalID" }

401: Unauthorized

Get MHCI Metrics for a Participant

GET /metrics/participants/{externalID}/mhci

Get MHCI metrics for a participant.

Headers

{ "x-api-key": "YOUR_API_KEY" }

URL Parameters

  • externalID (required): The external identifier for the participant.

Query String Parameters

  • from (optional): The start date for the range of sessions to count. Format: YYYY-MM-DD.
  • to (optional): The end date for the range of sessions to count. Format: YYYY-MM-DD.
  • groupBy (optional): The time period to group the sessions by. Options: day, week, month.

Example Call

await fetch(
"https://api.okaya.me/metrics/participants/ok_participant1/mhci?from=YYYY-MM-DD&to=YYYY-MM-DD&groupBy=day",
{
method: "GET",
headers: {
"x-api-key": "YOUR_API_KEY",
},
}
).then((response) => response.json());

Example Response

200

{
"all": {
"minMhci": 20.0,
"maxMhci": 80.0,
"avgMhci": 50.0,
"percentile25Mhci": 40.0,
"percentile50Mhci": 50.0,
"percentile75Mhci": 60.0
}
}

400

{ "error": "You are missing the path parameter externalID" }

401: Unauthorized

Get Wordcloud for a Participant

GET /metrics/participants/{externalID}/wordcloud

Get frequency of each word from session transcripts for a participant.

Headers

{ "x-api-key": "YOUR_API_KEY" }

URL Parameters

  • externalID (required): The external identifier for the participant.

Query String Parameters

  • from (optional): The start date for the range of sessions to count. Format: YYYY-MM-DD.
  • to (optional): The end date for the range of sessions to count. Format: YYYY-MM-DD.
  • groupBy (optional): The time period to group the sessions by. Options: day, week, month.
  • top (optional): The number of top words to return. Must be an integer.

Example Call

await fetch(
"https://api.okaya.me/metrics/participants/ok_participant1/wordcloud?from=YYYY-MM-DD&to=YYYY-MM-DD&groupBy=day&top=1",
{
method: "GET",
headers: {
"x-api-key": "YOUR_API_KEY",
},
}
).then((response) => response.json());

Example Response

200

{
"all": {
"word1": 0.01,
"word2": 0.02,
"word3": 0.03,
...
}
}

400

{ "error": "You are missing the path parameter externalID" }

401: Unauthorized