Statistic
stat
This relation targets the entry point resource for the statistic API. This API does not require API authentication.
4.43.0+
hits
This relation allow statistic hit creation.
Create hit
A statistic hit can be created by sending POST request on the hits resource with the representation of a statistic hit.
Sample request:
POST /api/stat/hits
Content-Type: application/json
{
"date": "2020-07-15T10:00:00",
"type": "CONNECTION",
"origin": 0,
"sessionId": "7e7f6d22f75d2cc4b9ed5fe907dd7461",
"ip": "127.0.0.1",
"users": [
{
"userId": "1"
}
],
"connection": {
"mode": "CLASSIC",
"success": true
}
}
You can indicate an interface id (origin field) or a clientId (X-KPK-CLIENT-ID header) but one of them is required.
The JSON content must comply with statistic hit type JSON Schema.
In case of download hit, a download media usage will be automatically added. To disable it, set the query parameter disableUsage to true.
Example:
POST /api/stat/hits?disableUsage=true
Content-Type: application/json
[...]
4.43.0+
hit-types
This relation targets a list of statistic hit types
4.43.0+
hit-type
This relation targets the canonical resource representing a hit type.
4.43.0+
schema
This relation returns a JSON Schema representing a statistic hit type structure to comply with when creating a statistic hit.
4.43.0+
search-hit
This relation targets the resource representing a statistic hit search result. Because some researches can return many of results, a cache is used and 10 researches to the maximum can be launch in parallel. By default, 1 000 000 results to the maximum can be returns. This can be increase but it can degrade the results.
4.46.0+
Syntax
Search syntax is defined with query strings:
Query parameter | Description | Arity |
---|---|---|
fq | Filter query parameter. Search terms (f or q parameters) only applies against filtered documents. | [0-n] |
page | The requested page number in the result list. | [0-1] |
size | Number of media to return per page. | [0-1] |
Search examples
-
GET /api/stat/search/hit?fq=type:view
return all view statistics (Type possible values : view, connection, download, upload, play and search) -
GET /api/stat/search/hit?fq=type:view&fq=date:[2018-12-10 TO 2018-10-11]
return all view statistics between two dates -
GET /api/stat/search/hit?fq=type:view&fq=mediaId:12
return all view statistics for a media -
GET /api/stat/search/hit?fq=type:view&fq=folderId:(12 15)
return all view statistics on media in folders with id 12 or 15 -
GET /api/stat/search/hit?fq=type:view&fq=folderId:(12 15) subtree
return all view statistics on media in folders with id 12 or 15 ans theirs sub folders -
GET /api/stat/search/hit?fq=type:view&fq=profileId:(2 5)
return all view statistics generate by users in profiles with id 2 or 5 -
GET /api/stat/search/hit?fq=type:view&fq=formId:(1 2)
return all view statistics on media with metamodel id 1 or 2 -
GET /api/stat/search/hit?fq=type:view&fq=interface:(0 1)
return all view statistics generate from back office (id 0) or front with id 1 -
GET /api/stat/search/hit?fq=type:view&fq=referrer:direct
return all view statistics without referrer -
GET /api/stat/search/hit?fq=type:view&fq=referrer:external
return all view statistics with external referrer -
GET /api/stat/search/hit?fq=type:view&fq=referrer:domain:keepeek
return all view statistics with 'keepeek' in domain referrer -
GET /api/stat/search/hit?fq=type:search&fq=success:true
return all search statistics that returns at least one result -
GET /api/stat/search/hit?fq=type:search&fq=searchType:(text advanced)
return all text and advanced searches statistics (Search type possible values : text, folder, advanced, kpk360, form, list, geoloc and individual)