Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change REST Contract for statistics reports #75

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion statistics.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Collecting user interactions
# Collecting/Reporting user interactions
[Back to the list of all defined endpoints](endpoints.md)

## View events endpoint
Expand Down Expand Up @@ -26,7 +26,30 @@ The sections below describe the parameters for a page view event. All other info
"targetType": "item"
}
```
## Report View Events endpoint
**GET /api/statistics/viewevents**
Copy link
Member

@artlowel artlowel Sep 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this endpoint is the right place for statistics reports. Since you use it to POST one event at a time, you would expect to GET events with the same level of detail, and that's not very useful for a report. Reports are usually about a combination of a few aspects of a number of events at the same time. e.g. the most popular items in the repository, where we need to facet the view events on item id.

I envision reports will get a dedicated endpoint e.g. /api/statistics/reports that will return data in some json equivalent of a table format

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. That was my mistake to leave the endpoint as is. I will change it.


To get a report for the usage statistics of a page view, make an HTTP GET request to this endpoint.

The sections below describe the parameters for a page view event report.

### Required Parameters

### Status codes:

- `200` Succes: 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:


```json
{

}

```

## Search events Endpoint
**POST /api/statistics/searchevents**
Expand Down