The following are the REST APIs that are implemented in WSO2 DAS 3.1.0.
Function | REST API |
---|---|
Checking if a table exists | GET /analytics/table_exists?table={tableName} |
Listing all tables | GET /analytics/tables |
Retrieving records of a table | GET /analytics/tables/{tableName}/{from}/{to}/{start}/{count}?columns={columns} |
Getting the record count of a table | GET /analytics/tables/{tableName}/recordcount |
Searching records of a table | POST /analytics/search |
Defining/updating the schema of a table | POST /analytics/tables/{tableName}/schema |
Getting the search record count of a table | POST /analytics/search_count |
Timing out the indexing process completion | GET/analytics/indexing_done?timeout=<long-value> |
Getting the schema of a table | GET /analytics/tables/{tableName}/schema |
Drilling down through hierarchical categories | POST /analytics/facets |
Retrieving matching records through a drill down search | POST /analytics/drilldown |
Retrieving the count of matching records through a drill down search | POST/analytics/drillDownScoreCount |
Retrieving records using given primary key value pairs | POST/analytics/tables/{tableName}/keyed_records |
Retrieving All Record Stores | GET /analytics/recordstores |
Retrieving the Record Store of a Given Table | GET /analytics/recordstore?table={tableName} |
Checking if the Given Records Store Supports Pagination | GET /analytics/pagination/<recordstore-name> |
Tracking the Indexing Process Completion of a Table | GET /analytics/indexing_done?maxWait=10&table={tableName} |
Retrieving Aggregated Values of Given Records | POST /analytics/aggregates |
Retrieving the Event Count of Range Facets | POST /analytics/rangecount |
Re-indexing the Records of a Given Table | POST /analytics/tables/{tableName}/{from}/{to} |
Clear Index Information of a Given Table via REST API | DELETE /analytics/tables/{tableName}/indexData |
Inferring the Actual Table Name from the Encoded Name | GET (with auth) https://<DAS_HOST>:9443/analytics/tables/<ENCODED_NAME> /actualName |
The REST APIs are secured with basic authentication. Therefore, follow the steps below to add a basic auth header when calling these methods.
- Build a string of the form username:password.
- Encode the string you created above using Base64. For encoding the above string using Base64, see Encode to Base64 format.
- Define an authorization header with the term "Basic_", followed by the encoded string. For example, the basic auth authorization header using "admin" as both username and password is as follows:
Authorization: Basic YWRtaW46YWRtaW4=
Cross-Origin Resource Sharing (CORS) should be enabled if you are using analytics REST API from outside the DAS domain, or if the REST API caller is situated in a machine with a different host/port configuration to WSO2 DAS. For more information, see CORS Settings for the Analytics REST API.