Categories
List Categories
GET /api/1.0/category?objectType=<objectType>
Parameter | Comments |
---|---|
objectType | Type of categories to list. Possible values: 1 (Dashboards), 2 (Charts), 4 (Queries) |
withSharing | Optional, value (boolean) true/false. The default value is false. If true, then the output will contain sharing information to which users and/or groups each category is shared |
Response
HTTP Status | Response |
---|---|
200 OK | Output example:
|
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:
|
Example
curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" <Add the URL here>
Share Category to Users/Groups
PUT /api/1.0/category/<objectId>/share?objectType=<objectType>
Parameter | Comments |
---|---|
objectId | Category id of Category to share |
objectType | Type of categories. Possible values: 1 (Dashboards), 2 (Charts), 4 (Queries) |
PUT JSON payload:
Parameter | Comments |
---|---|
shareProperties | Share properties json array. Available fields:
|
sso_user |
Optional bool. Set to `true` if sharing with the sso user. Example: [ |
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:
|
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 $bearer" -H "Content-Type: application/json" -X PUT -d "{\"shareProperties\" : [ { \"type\" : \"Users\", \"access_level\" : 1, \"name\" : \"shaunSSO@knowi.com\", \"ssoUser\" : true} ] }" "https://www.knowi.com/api/1.0/category/13993/share?objectType=1"
Create Category
POST /api/1.0/category?objectType=<objectType>
Parameter | Comments |
---|---|
objectType | Type of categories. Possible values: 1 (Dashboards), 2 (Charts), 4 (Queries) |
POST JSON payload:
Parameter | Comments |
---|---|
parentId | Id of a parent category. Set 0 to make the root category |
categoryName | Name of new category |
Response
HTTP Status | Response |
---|---|
200 OK | Return created Category json info. Output example:
{ |
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:
|
409 CONFLICT |
{ "message": <Error details>, "documentation_url": <Documentation link> } Error details:
|
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 POST -d "{\"parentId\":123,\"categoryName\":\"new name\"}" "https://www.knowi.com/api/1.0/category?objectType=2"
Delete Category
Query
DELETE /api/1.0/category/<objectId>?objectType=<objectType>
Parameter | Comments |
---|---|
objectId | Category id of category to delete |
objectType | Type of categories. Possible values: 1 (Dashboards), 2 (Charts), 4 (Queries) |
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" -X DELETE http://www.knowi.com/api/1.0/category/105?objectType=2
Edit Category
Query
PUT /api/1.0/category/<objectId>?objectType=<objectType>
Parameter | Comments |
---|---|
objectId | Category id of category to edit |
objectType | Type of categories. Possible values: 1 (Dashboards), 2 (Charts), 4 (Queries) |
PUT JSON payload:
Parameter | Comments |
---|---|
categoryName | New name of category |
parentId | New parent Id of category |
Response
HTTP Status | Response |
---|---|
200 OK | Return edited Category json info. Output example:
|
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:
|
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 "{\"categoryName\":\"updated category name\", \"parentId\": 123}" http://www.knowi.com/api/1.0/category/105?objectType=2
Assign Asset to Categories
Query
POST /api/1.0/category/assign?objectType=<objectType>
Parameter | Comments |
---|---|
objectType | Type of categories. Possible values: 1 (Dashboards), 2 (Charts), 4 (Queries) |
POST JSON payload:
Parameter | Comments |
---|---|
objectId | Asset id to assign categories to. This could be Dashboard id, Widget id or Query id, depending on objectType parameter. |
categories | Array of categories IDs to assign (replace). |
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:
|
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 POST -d "{\"objectId\":10050, \"categories\": [ 123, 456 ] }" http://www.knowi.com/api/1.0/category/assign?objectType=2
Add category to asset
Query
POST /api/1.0/category/add?objectType=<objectType>
Parameter | Comments |
---|---|
objectType | Type of categories. Possible values: 1 (Dashboards), 2 (Charts), 4 (Queries) |
POST JSON payload:
Parameter | Comments |
---|---|
objectId | Asset id to add category to. This could be Dashboard id, Widget id or Query id, depending on objectType parameter. |
category | Id of category to add. |
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:
|
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 POST -d "{ \"objectId\":10050, \"category\":123 }" http://www.knowi.com/api/1.0/category/add?objectType=2
Remove category from asset
POST /api/1.0/category/remove?objectType=<objectType>
Parameter | Comments |
---|---|
objectType | Type of categories. Possible values: 1 (Dashboards), 2 (Charts), 4 (Queries) |
POST JSON payload:
Parameter | Comments |
---|---|
objectId | Asset id to remove category from. This could be Dashboard id, Widget id or Query id, depending on objectType parameter. |
category | Id of category to remove. |
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:
|
404 NOT FOUND |
{ "message": <Error details>, "documentation_url": <Documentation link> } Error details:
|
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 POST -d "{ \"objectId\":10050, \"category\":123 }" http://www.knowi.com/api/1.0/category/remove?objectType=2
Copy a category
Copies category structure from source category to a destination category including assets association. The assets will not be cloned, only put into a new category structure.
Query
POST /api/1.0/category/copy?objectType=<objectType>
Parameter | Comments |
---|---|
objectType | Type of categories. Possible values: 1 (Dashboards), 2 (Charts), 4 (Queries) |
POST JSON payload:
Parameter | Comments |
---|---|
objectId | Asset id to add category to. This could be Dashboard id, Widget id or Query id, depending on objectType parameter. |
sourceCategoryId | Source category id to copy from |
targetParentCategoryId | Target category id to which put the copy of source category |
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:
|
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 POST -d "{ \"sourceCategoryId\":10050, \"targetParentCategoryId\":10025 }" http://www.knowi.com/api/1.0/category/copy?objectType=2