historyItem resource type

Namespace: microsoft.graph

Important

APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.

Represents a history item for an activity in an app. User activities represent a single destination within your app; for example, a TV show, a document, or a current campaign in a video game. When a user engages with that activity, the engagement is captured as a history item that indicates the start and end time for that activity. As the user re-engages with that activity over time, multiple history items are recorded for a single user activity.

When an app creates a session, a historyItem object should be added to the activity object to reflect the period of user engagement. Each time a user re-engages with an activity, a new historyItem is added to the activity to accrue user engagement.

Methods

Method Return Type Description
Create or replace historyItem historyItem Create or replace an existing historyItem for that activity (upsert). The ID needs to be a GUID.
Delete a historyItem No Content Delete the specified historyItem for that activity.

Properties

Name Type Description
status string Set by the server. A status code used to identify valid objects. Values: active, updated, deleted, ignored.
userTimezone String Optional. The timezone in which the user's device used to generate the activity was located at activity creation time. Values supplied as Olson IDs in order to support cross-platform representation.
createdDateTime DateTimeOffset Set by the server. DateTime in UTC when the object was created on the server.
lastModifiedDateTime DateTimeOffset Set by the server. DateTime in UTC when the object was modified on the server.
id String Required. Client-set GUID for the historyItem object.
startedDateTime DateTimeOffset Required. UTC DateTime when the historyItem (activity session) was started. Required for timeline history.
lastActiveDateTime DateTimeOffset Optional. UTC DateTime when the historyItem (activity session) was last understood as active or finished - if null, historyItem status should be Ongoing.
expirationDateTime DateTimeOffset Optional. UTC DateTime when the historyItem will undergo hard-delete. Can be set by the client.
activeDurationSeconds int Optional. The duration of active user engagement. if not supplied, this is calculated from the startedDateTime and lastActiveDateTime.

Relationships

Relationship Type Description
activity userActivity Optional. NavigationProperty/Containment; navigation property to the associated activity.

JSON representation

The following is a JSON representation of the resource.

{
    "activeDurationSeconds":"int",
    "createdDateTime": "DateTimeOffset",
    "expirationDateTime": "DateTimeOffset",
    "id": "String",
    "lastActiveDateTime": "DateTimeOffset",
    "lastModifiedDateTime": "DateTimeOffset",
    "startedDateTime": "DateTimeOffset",
    "status": "String",
    "userTimezone": "String"
}