-
-
Notifications
You must be signed in to change notification settings - Fork 2
Insights
Insights are provided for application developers that use the Hasheous service. Basic details such as unique users, unique users per country, total requests, average response time, and unique users per client API key.
Collection of Insights is enabled on the following endpoints:
- Lookup
/api/v1/Lookup/ByHash/api/v1/Lookup/ByHash/crc/{crc}/api/v1/Lookup/ByHash/md5/{md5}/api/v1/Lookup/ByHash/sha1/{sha1}/api/v1/Lookup/Platforms
- MetadataProxy
/api/v1/MetadataProxy/
- Submissions
/api/v1/Submissions/FixMatch
Requests sent to the server with the X-Client-API-Key header will record an event in the Insights database that stores data related to that request.
Insights collects the following data:
| Data type | How is it stored? | Reason for use |
|---|---|---|
| Date and time | DATETIME | The event time stamp is used to select events in the last 30 days for reporting purposes, and to select which events should be automatically deleted. |
| Insight Type | INTEGER | Stores what type of insight is being stored: 0 = Undefined, 1 = HashLookup, 2 = HashSubmission, 3 = MetadataProxy, 10 = HashLookupDeprecated (used to measure number of users still using the deprecated lookup end point) |
| User IP | MD5 Hash String | The IP address is collected only for detecting unique users. As it's only required to detect uniqueness, the IP is hashed as an MD5 as a privacy measure to prevent storage of the actual IP address. |
| Execution Time | INTEGER | This value is calculated on the server side |
| Country | STRING | This value is provided by CloudFlare, and provides the ability to report on which countries Hasheous users are from. Country is the highest precision location value that is stored. |
| User Account | STRING | Links the event to a specific user if signed into Hasheous, or using the account API key. |
| Client API Key | LONG | This links the request to the app API key |
Adding a header named X-Insight-Opt-Out with a comma separated list from the following table allows customising the opt out method:
| Rule | Description |
|---|---|
NotOptedOut |
(Default) Allows all Insights to be recorded |
BlockIP |
Blocks the IP from being processed and stored |
BlockUser |
Blocks logging the user account with the request |
BlockLocation |
Blocks storing the country from which the request was initiated. This value is provided by CloudFlare and is not calculated by Hasheous. Using the BlockIP rule will not prevent the location from being stored. |
BlockAll |
Blocks storing the entire Insight event |
It is recommended that developers using the Hasheous API provide opt-out options to end users as part of their app configuration.
Insights data is only available to signed in app owners using the web interface, or via the API endpoint at /api/v1/Insights/app/{Id}/Insights when signed into the Hasheous web site. Currently the end point cannot be access via an API key.
Sample output from the API endpoint:
{
"unique_visitors": 1,
"unique_visitors_per_country": [
{
"country": "",
"unique_visitors": 1
}
],
"total_requests": 1,
"average_response_time": 168,
"unique_visitors_per_api_key": [
{
"client_apikey_id": "Test",
"unique_visitors": 1
}
]
}