This API allows clients to create and manage employee related datasets based on time series data periods (start-end dates).
The API consists of Datasets and associated data.
Throughout the API an 'api_id' is used. This can be specified by the client when creating a new Nudge via the API, if one is not specified during creation or a Nudge is created via a different method then the API ID can be obtained by querying the API.
Users can be created and managed using the Directory API: Users endpoints and will be referenced in this set of APIs.
POST /dataset/timeseries_dataset
Create a new dataset for this person and a specified name (such as EngagementScore).
Parameters
None
Request Body
{
[
{
api_id: string, // Optional, must be unique
person_api_id: string, // The person for this dataset
name: string // The name or reference for the dataset
}
]
}
Response
Returns an object including the created Dataset.
{
[
{
api_id: string, // Optional, must be unique
person_api_id: string, // The person for this dataset
name: string // The name or reference for the dataset
}
]
}
POST /dataset/timeseries_dataset/{api_id}/add_timeseries_value
Create or update a time series value for this dataset. When an existing end_date exists for the same dataset the API will overwrite the existing value and perform an update, otherwise a new entry will be made.
The URL should contain the api_id of the relevant dataset.
Parameters
None
Request Body
{
[
{
start_date: date, // The start date of this period (YYYY-MM-DD)
end_date: date, // The end date of this period (YYYY-MM-DD)
value: float // The data value for this time period
}
]
}
Response
Returns an object including the dataset and its list of current values.
{
api_id: string,
name: string,
values:
[
{
start_date: date, // The start date of this period (YYYY-MM-DD)
end_date: date, // The end date of this period (YYYY-MM-DD)
value: float // The data value for this time period
},....
]
}