Downloaded endpoint
The downloaded endpoint allows you to track media consumption while a user is offline. When a user plays content from a device's storage using your app, you can store media session data on the device regardless of the device's connectivity. When the user finishes the playback session and the device returns online, you can use this endpoint to send the stored media session to Adobe in a single payload. Adobe dynamically assigns a session ID and processes the media session as if it was traditionally collected online.
downloaded
The downloaded endpoint represents a full media session from start to finish. Media sessions collected using this endpoint have the following properties:
- Each event in the
events[]payload represents a complete media session. You cannot append or prepend online data to downloaded media sessions. - Every media session using this endpoint must start with a media event type of
media.sessionStart. - Do not generate or include a session ID in the payload. Adobe automatically generates a session ID when ingesting the media session.
- If you omit the media event type
media.sessionCompletein a given session, Adobe automatically adds one. It uses the last media event timestamp in the payload, and also setsxdm.mediaReporting.sessionDetails.isCompletedtofalse. See Session Details Reporting data type in the Experience Data Model guide for more information.- In Adobe Analytics, downloaded media sessions missing
media.sessionCompletedo not increment the Content completes metric.
- In Adobe Analytics, downloaded media sessions missing
- Adobe automatically sets
xdm.mediaReporting.sessionDetails.isDownloadedtotruefor all media sessions using this endpoint. It is set on the same event asmedia.sessionStart. You can use this field to determine the ratio of online/downloaded media sessions, or create a segment that focuses on only downloaded media sessions.- Adobe Analytics users can assign the
a.media.downloadedcontext data variable to a dimension or metric using Processing rules to obtain this flag in reports.
- Adobe Analytics users can assign the
- If your datastream sends streaming media data to Adobe Analytics, make sure that the report suite has Timestamps optional enabled. Timestamps optional is enabled by default for all new report suites.
POST https://edge.adobedc.net/ee/va/v1/downloaded?configId={datastreamID}
The following example shows a payload of only sessionStart and sessionComplete media event types. See the API reference for an example using more media event types.
data-slots=heading, code
data-repeat=2
data-languages=CURL,JSON
Request
curl -X POST "https://edge.adobedc.net/ee/va/v1/downloaded?configId={datastreamID}" \
--header 'Content-Type: application/json' \
--data '{
"events": [
{
"xdm": {
"identityMap": {
"email": [
{
"id": "user@example.com",
"primary": true
}
]
},
"eventType": "media.downloaded",
"mediaDownloadedEvents": [
{
"mediaEventTimestamp": "YYYY-09-26T15:52:24+00:00",
"mediaEventType": "media.sessionStart",
"mediaCollection": {
"sessionDetails": {
"name": "Media Analytics API Sample",
"playerName": "sample-html5-api-player",
"contentType": "VOD",
"length": 60,
"channel": "sample-channel"
},
"playhead": 0
}
},
{
"mediaEventTimestamp": "YYYY-09-26T15:53:08+00:00",
"mediaEventType": "media.sessionComplete",
"mediaCollection": {
"playhead": 60
}
}
],
}
}
]
}'
Response
{
"requestId": "7b551[...]54492",
"handle": [
{
"type": "locationHint:result",
"payload": [
{
"scope": "Target",
"hint": "35",
"ttlSeconds": 1800
},
{
"scope": "AAM",
"hint": "9",
"ttlSeconds": 1800
},
{
"scope": "EdgeNetwork",
"hint": "or2",
"ttlSeconds": 1800
}
]
},
{
"type": "state:store",
"payload": [
{
"key": "kndctr_53A[...]C99_AdobeOrg_identity",
"value": "CiYy[...]ZpTM=",
"maxAge": 34128000
},
{
"key": "kndctr_53A[...]C99_AdobeOrg_cluster",
"value": "or2",
"maxAge": 1800
}
]
}
]
}
This endpoint requires the following payload properties within the events[].xdm object:
eventTypemedia.downloaded for this endpoint.mediaDownloadedEventsmediaEvent objects representing each media event within a session. See the table below.Each mediaEvent object within mediaDownloadedEvents requires several fields. See Media Event Information data type in the Experience Data Model guide for more information.
mediaEventTimestampmediaEventTypemedia.sessionStart, media.play, or media.error.mediaCollectionmediaEventType. See Media Collection Details data type in the Experience Data Model guide for more information.Response object
If successfully processed, the API returns an object with the following properties:
requestIdhandle[]locationHint:result and state:store.