Skip to content

Latest commit

 

History

History
96 lines (75 loc) · 3.11 KB

statistics.md

File metadata and controls

96 lines (75 loc) · 3.11 KB

Collecting user interactions

Back to the list of all defined endpoints

View events endpoint

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.

Required Parameters

  • targetId: The id of the object the user viewed
  • targetType: The type of the object the user viewed

Status codes:

  • 201 Created: if the operation succeeded
  • 400 Bad request: if any of the parameters are missing or invalid.
  • 422 Unprocessable Entity: if the parameters don't refer to a valid object.

Example item page view:

{
  "targetId": "43f9bb3e-f90d-458f-9858-7e4589481d18",
  "targetType": "item"
}

Search events Endpoint

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.

Required Parameters

  • 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.

Optional Parameters

  • 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.

Status codes:

  • 201 Created: if the operation succeeded
  • 400 Bad request: if any of the required parameters are missing, or any parameters are invalid.

Example search:

{
  "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
  }
}

Downloads and workflow

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.