List Reports
This endpoint returns a listing of all reports
Query
GET /api/1.0/reports
No parameters |
---|
Response
HTTP Status | Response |
---|---|
200 OK | Output example:
{ "list": [ { "createdDate": 1648071581000, "lastModDate": null, "id": 72, "scheduleId": 95, "userId": 10077, "status": 1, "name": "rep2022-03-22-17-11", "text": "Email report |
400 BAD_REQUEST |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
401 UNAUTHORIZED |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
403 FORBIDDEN |
{ "message": <Error details>, "documentation_url": <Documentation link> } Error details:
|
Example
curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X GET http://localhost:9090/api/1.0/reports
View Reports
This endpoint returns report details for a given report id
Query
GET /api/1.0/reports/<objectId>
Parameter | Comments |
---|---|
objectId | Report id to view Report |
Response
HTTP Status | Response |
---|---|
200 OK | Output example:
{ "createdDate": 1648071581000, "lastModDate": null, "id": 72, "scheduleId": 95, "userId": 10077, "status": 1, "name": "rep2022-03-22-17-11", "text": "Email report |
400 BAD_REQUEST |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
401 UNAUTHORIZED |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
403 FORBIDDEN |
{ "message": <Error details>, "documentation_url": <Documentation link> } Error details:
|
Example
curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X GET http://localhost:9090/api/1.0/reports/70
Create Report
This endpoint is for creating a new report
Query
POST /api/1.0/reports/
No parameters |
---|
POST JSON payload:
Sample with "Run As" (reportAs field is id of other user), and with content filters (reportContentFilters field).
{ "startTime": null, "frequency": 1, "frequencyType": "days", "subject": "subj1", "name": "rep2022-03-22-17-11", "text": "Email report |
Response
HTTP Status | Response |
---|---|
200 OK | Output created entity |
400 BAD REQUEST |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
401 UNAUTHORIZED |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
403 FORBIDDEN |
{ "message": <Error details>, "documentation_url": <Documentation link> } Error details:
|
Example
curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X POST -d '{"startTime":null,"frequency":1,"frequencyType":"days","subject":"subj1","name":"rep2022-03-22-17-11","text":"<span>Email report</span><br><br>Knowi Team<br>support@knowi.com","from":null,"sendTo":"some@some.com","cc":null,"bcc":null,"dashIds":[111012],"datasets":"[]","reportAs":10222,"scheduleId":90,"reportContentFilters":"[{\"fieldName\":\"param1\",\"type\":\"java.lang.String\",\"values\":[\"val1\"],\"operator\":\"Equals\"},{\"fieldName\":\"param2\",\"type\":\"java.lang.String\",\"values\":[\"val2\"],\"operator\":\"Equals\"}]","webhooks":[],"slacks":[],"teams":[],"executionReport":null,"nlpQuery":null,"contextPath":null,"nlpDatasetId":null,"datasetReports":null,"reportContentFiltersArr":null,"dashboards":null,"testRun":false}' http://localhost:9090/api/1.0/reports
Edit Report
This endpoint is for updating/modifying the reports
Query
PUT /api/1.0/reports
No parameters |
---|
PUT JSON payload:
Sample with "Run As" (reportAs field is id of other user), and with content filters (reportContentFilters field). Note that id of email report is within POST data as json field "emailReportId". { "emailReportId": 68, "startTime": null, "frequency": 1, "frequencyType": "days", "subject": "subj1", "name": "rep1", "text": "Email report |
Response
HTTP Status | Response |
---|---|
200 OK | Output edited entity |
400 BAD REQUEST |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
401 UNAUTHORIZED |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
403 FORBIDDEN |
{ "message": <Error details>, "documentation_url": <Documentation link> } Error details:
|
Example
curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X PUT -d '{"emailReportId":68,"startTime":null,"frequency":1,"frequencyType":"days","subject":"subj1","name":"rep1","text":"<span>Email report</span><br><br>Knowi Team<br>support@knowi.com","from":null,"sendTo":"some@some.com","cc":null,"bcc":null,"dashIds":[111012],"datasets":"[]","reportAs":10222,"scheduleId":90,"reportContentFilters":"[{\"fieldName\":\"param1\",\"type\":\"java.lang.String\",\"values\":[\"val1\"],\"operator\":\"Equals\"},{\"fieldName\":\"param2\",\"type\":\"java.lang.String\",\"values\":[\"val2\"],\"operator\":\"Equals\"}]","webhooks":[],"slacks":[],"teams":[],"executionReport":null,"nlpQuery":null,"contextPath":null,"nlpDatasetId":null,"datasetReports":null,"reportContentFiltersArr":null,"dashboards":null,"testRun":false}' http://localhost:9090/api/1.0/reports
Run Report
This endpoint is for running all the reports
Query
POST /api/1.0/reports/run
No parameters |
---|
POST JSON payload:
Sample with "Run As" (reportAs field is id of other user), and with content filters (reportContentFilters field).
{ "subject": "subj1", "name": "rep2022-11-22-15-54", "text": "Email report |
Response
HTTP Status | Response |
---|---|
200 OK | Output created entity |
400 BAD REQUEST |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
401 UNAUTHORIZED |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
403 FORBIDDEN |
{ "message": <Error details>, "documentation_url": <Documentation link> } Error details:
|
Example
curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X POST -d '{"subject":"subj1","name":"rep2022-11-22-15-54","text":"<span>Email report</span><br><br>Knowi Team<br>support@knowi.com","from":null,"sendTo":"some@some.com","cc":null,"bcc":null,"dashIds":[111012],"datasets":"[]","reportAs":10222,"scheduleId":90,"reportContentFilters":"[{\"fieldName\":\"param1\",\"type\":\"java.lang.String\",\"values\":[\"val1\"],\"operator\":\"Equals\"},{\"fieldName\":\"param2\",\"type\":\"java.lang.String\",\"values\":[\"val2\"],\"operator\":\"Equals\"}]","webhooks":[],"slacks":[],"teams":[],"executionReport":null,"nlpQuery":null,"contextPath":null,"nlpDatasetId":null,"datasetReports":null,"reportContentFiltersArr":null,"dashboards":null}' http://localhost:9090/api/1.0/reports/run
Share the reports
This endpoint is for sharing the reports with users and groups of a given report id
Query
PUT /reports/<objectId>/share
Parameter | Comments |
---|---|
objectId | Report id to share |
POST JSON payload:
Parameter | Comments |
---|---|
shareProperties | Share properties json array. Available fields:
|
Response
HTTP Status | Response |
---|---|
200 OK | No response body |
400 BAD_REQUEST |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
401 UNAUTHORIZED |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
403 FORBIDDEN |
{ "message": <Error details>, "documentation_url": <Documentation link> } |
415 UNSUPPORTED_MEDIA_TYPE | Cannot consume content type - The server refused this request because the request entity is in a format not supported by the requested resource for the requested method. |
Example
curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X PUT -d "{\"shareProperties\" : [ { \"type\" : \"Users\", \"access_level\" : 1, \"name\" : \"some@some.com\", \"sso_user\" : true } ] }" http://localhost:9090/api/1.0/reports/70/share
Delete Report
This endpoint for deleting the report of a given id
Query
DELETE /reports/<objectId>
Parameter | Comments |
---|---|
objectId | Report id to delete |
Response
HTTP Status | Response |
---|---|
200 OK | No response body |
400 BAD REQUEST |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
401 UNAUTHORIZED |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
403 FORBIDDEN |
{ "message": <Error details>, "documentation_url": <Documentation link> } Error details:
|
Example
curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X DELETE http://localhost:9090/api/1.0/reports/68