Back to the list of all defined endpoints
POST /api/statistics/viewevents
To track a page view, make an HTTP POST request to this endpoint.
The sections below describe the parameters for a page view event. All other information about the interaction can be derived from the request itself.
targetId
: The id of the object the user viewedtargetType
: The type of the object the user viewed
referrer
: The referrer of the object the user viewed. When this value is not present, it will be derived from the request instead.
201
Created: if the operation succeeded400
Bad request: if any of the parameters are missing or invalid.422
Unprocessable Entity: if the parameters don't refer to a valid object.
{
"targetId": "43f9bb3e-f90d-458f-9858-7e4589481d18",
"targetType": "item",
"referrer": "https://demo7.dspace.org/search"
}
POST /api/statistics/searchevents
To track a search, make an HTTP POST request to this endpoint.
The sections below describe the parameters for a search event. All other information about the interaction can be derived from the request itself.
query
: The discovery search string.page
: An object that describes the pagination status. For more information take a look at the pagination documentation.sort
: An object that describes the sort status. For more information take a look at the pagination documentation.
dsoType
: Limits the search to a specific DSpace Object type. Possible values:all
item
community
collection
scope
: The UUID of a specific DSpace container (site, community or collection) to which the search has to be limited.configuration
: The name of a Discovery configuration that was used by the search.appliedFilters
: An array of search filters used to filter the result set. For more information take a look at the search documentation.
201
Created: if the operation succeeded400
Bad request: if any of the required parameters are missing, or any parameters are invalid.
{
"query": "Lorem ipsum",
"scope": "a3e80c6d-a83f-4c35-9f27-8718598c6c17",
"configuration": "default",
"appliedFilters": [
{
"filter" : "title",
"operator" : "notcontains",
"value" : "dolor sit",
"label" : "dolor sit"
},
{
"filter" : "author",
"operator" : "authority",
"value" : "9zvxzdm4qru17or5a83wfgac",
"label" : "Amet, Consectetur"
}
],
"sort" : {
"by" : "dc.date.issued",
"order" : "asc"
},
"page": {
"size": 5,
"totalElements": 14,
"totalPages": 3,
"number": 0
}
}
Statistics for file downloads are being generated by REST directly. The actual download is always known in REST, while the UI is not involved if the file download originated from e.g. a direct link from google.
Workflow action statistics are also already being generated by the internal workflow directly.