Events

Events provide a snapshot, or log, of important transactions in a study.

You can also be notified of these events via webhooks.

Get Events

Get a list of events for a study, optionally for a specific time frame (up to 24 hours), in the order they were reported to the system. By default, this endpoint returns events for the last 24 hours. Event types include:

  • STUDY_STARTED: A study was "started" via the BioStamp® nPoint™ Investigator Portal

  • SUBJECT_CREATED: A subject was added to a study

  • ACTIVITY_COMPLETED: A subject completed an activity

  • DIARY_COMPLETED: A subject completed a survey

  • RECORDING_UPLOADED: A subject uploaded a recording

  • METRICS_PROCESSED: The system produced metrics (analytics) for a subject

  • MESSAGE_POSTED: A message was written by a subject in the BioStamp® nPoint™ Link app or a user in the BioStamp® nPoint™ Investigator Portal

  • STUDY_STOPPED: A study was "stopped" via the BioStamp® nPoint™ Investigator Portal

URL

GET https://mc10cloud.com/api/v1/studies/{studyId}/events?from={from}&to={to}

Parameters

  • studyId: Study UUID

  • from: (Optional) Beginning timestamp (UTC), inclusive

  • to: (Optional) Ending timestamp (UTC), inclusive

Sample Response

The following example shows four different types of events.

The property actualTs is the actual time of the event, while reportedTs is the time the event was reported to the system. In many cases, these values will be the same. But in some cases, such as ACTIVITY_COMPLETED, the event might be reported to the system long after it occurred.

The property referenceId can be used to make subsequent requests to the API; its value depends on the type of event. For example, for STUDY_STARTED events, it refers to the study itself. For ACTIVITY_COMPLETED events, it refers to an activity, a type of annotation.

The property author, if present, refers to the subject or user who initiated the event.

{
"items": [
{
"accountId": "5d3b5950-1b00-11e7-8464-0a624d7022db",
"action": "STUDY_STARTED",
"actualTs": 1558108667896,
"author": {
"displayName": "Jane Doe",
"id": "b7c07724-4462-11e9-a70f-0637976ce150",
"parentId": "7aa46580-46b4-11e5-8080-808080808080",
"principalType": "USER"
},
"referenceId": "72f6c330-78bc-11e9-bb47-e9750c9818f0",
"reportedTs": 1558108667896,
"studyId": "72f6c330-78bc-11e9-bb47-e9750c9818f0"
},
{
"accountId": "5d3b5950-1b00-11e7-8464-0a624d7022db",
"action": "SUBJECT_CREATED",
"actualTs": 1558108677916,
"author": {
"displayName": "Jane Doe",
"id": "b7c07724-4462-11e9-a70f-0637976ce150",
"parentId": "7aa46580-46b4-11e5-8080-808080808080",
"principalType": "USER"
},
"referenceId": "8a30f5c0-78bc-11e9-bb47-e9750c9818f0",
"reportedTs": 1558108677916,
"studyId": "72f6c330-78bc-11e9-bb47-e9750c9818f0",
"subjectId": "8a30f5c0-78bc-11e9-bb47-e9750c9818f0"
},
{
"accountId": "5d3b5950-1b00-11e7-8464-0a624d7022db",
"action": "ACTIVITY_COMPLETED",
"actualTs": 1558126688150,
"author": {
"displayName": "S_000_001",
"id": "883042d0-b77d-11e9-a3df-e9750c9818f0",
"parentId": "7aa46580-46b4-11e5-8080-808080808080",
"principalType": "SUBJECT"
},
"referenceId": "f5106f50-5226-11e8-8695-028eb5a65596",
"reportedTs": 1558126690134,
"studyId": "72f6c330-78bc-11e9-bb47-e9750c9818f0",
"subjectId": "883042d0-b77d-11e9-a3df-e9750c9818f0"
},
{
"accountId": "5d3b5950-1b00-11e7-8464-0a624d7022db",
"action": "METRICS_PROCESSED",
"actualTs": 1558177108181,
"referenceId": "f5106f50-5226-11e8-8695-028eb5a65596",
"reportedTs": 1558177108181,
"studyId": "72f6c330-78bc-11e9-bb47-e9750c9818f0",
"subjectId": "883042d0-b77d-11e9-a3df-e9750c9818f0"
}
],
"size": 4
}