Management API

Overview

Management API allows external services and apps to manage users and groups, datasources, queries, dashboards and widgets programmatically. The API is RESTful, and can be accessed via http://<service_host_and_port>/api/1.0/* url. Each request is stateless, with a response that includes an optional JSON object.

Enabling the Management API

To turn the API Management API, you must be an admin user and enable it. Navigate to the Settings (gear icon) -> User settings -> "Account settings" tab -> "Management API" row and click "Enable" to enable it. You will see your unique "client id" and "client secret", which you will need to access the system. Record and keep it securely.

Authentication

Overview

For authentication use OAuth 2.0 bearer access token in the HTTP headers of every request. Obtain a bearer token using your client id and client secret using the login end point. After the session, we also recommed using the logout end point to log out of the session. The default timeout for the bearer token is 1 hour, after which an UNAUTHORIZED (401) status code will be returned, at which point you will need again obtain new bearer access token using "login" command.

Typical workflow:

  • Obtain access token via login end point, keep the resulting bearer token in memory
  • Use the appropriate API end points as needed, passing in bearer token.
  • Call logout after use.

Login

To get bearer access token, turn on Management API in the User settings to obtan your "client id" and "client secret". Be sure to keep this in the safe place.

POST /api/1.0/login

Parameter Comments
client_id client_id is a part of credentials obtained from User settings.
client_secret client_secret is a part of credentials obtained from User settings.
HTTP Status Response
200 OK
{
  "access_token": <Access Token used for API calls>,
  "token_type": <Type of Token> ("Bearer" always),
  "expires_in": <Number of seconds before the token expires> (by default - 3600 seconds)
}
400 BAD_REQUEST
{ 
  "message": <Error details>, 
  "documentation_url": <Documentation link>
}

Error details:
  • Invalid parameters - missed client_id
  • Invalid parameters - missed client_secret
  • Management API disabled for this account
  • 404 NOT_FOUND
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Invalid credentials
  • Bearer access token

    The returned by "login" bearer access token should be used in subsequent calls to the Management API in header named "Authorization":

    Authorization: Bearer 69EuuRHieoidfbth48ygR9843wrgw94930g39845

    curl -i -d "client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET" http://localhost:9090/api/1.0/login
    

    Logout

    Call this end point to destroy the bearer token. You can re-issue a bearer token using the login end point.

    DELETE /api/1.0/logout

    No parameters
    HTTP Status Response
    200 OK No response body
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -X DELETE http://localhost:9090/api/1.0/logout
    

    Users

    List Users

    GET /api/1.0/users

    No parameters
    HTTP Status Response
    200 OK Output example:
    {
       "list":[
          {
             "id":10077,
             "username":"someEmail1@someHost.com",
             "name":"Test8",
             "customerId":1033,
             "autocycle":false,
             "tempUser":false,
             "ssoUser":false,
             "newUser":false,
             "timeZone":"America/Los_Angeles",
             "userGroups":[
                {
                   "id":889,
                   "groupName":"Default"
                },
                {
                   "id":890,
                   "groupName":"group1"
                },
                {
                   "id":891,
                   "groupName":"group2"
                }
             ],
             "roles":[
                "admin"
             ],
             "free":false,
             "twoFactorAuth":false
          },
          {
             "id":10081,
             "username":"someEmail2@someHost.com",
             "customerId":1033,
             "autocycle":false,
             "tempUser":false,
             "ssoUser":false,
             "newUser":false,
             "timeZone":"America/Los_Angeles",
             "userGroups":[
                {
                   "id":890,
                   "groupName":"group1"
                }
             ],
             "roles":[
                "admin"
             ],
             "free":false,
             "twoFactorAuth":false
          }
       ]
    }
      
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER"  http://localhost:9090/api/1.0/users/
    

    Get User

    GET /api/1.0/users/<user_id>

    Parameter Comments
    user_id User id to get info about specified User
    HTTP Status Response
    200 OK Output example:
    {
       "id":10091,
       "username":"someEmail1@someHost.com",
       "customerId":1033,
       "autocycle":false,
       "tempUser":false,
       "ssoUser":false,
       "newUser":false,
       "timeZone":"America/Los_Angeles",
       "userGroups":[
          {
             "id":889,
             "groupName":"Default"
          }
       ],
       "roles":[
          "viewer"
       ],
       "free":false,
       "twoFactorAuth":false
    }
      
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to see specified user info
  • curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER"  http://localhost:9090/api/1.0/users/10001
    

    Create User

    POST /api/1.0/users/

    POST JSON payload:

    Parameter Comments
    username User name of new user, actually the existing email of new user
    password Password for new user
    phone Phone number for new user (required if using 2FA)
    userInviteJson JSON of "invite" properties which include: user role (possible values: user, viewer, admin), user groups to which user will belong, which include group id, access level (possible values: 1, 2, where 1 - Edit rights, 2 - Read-only rights). Example:
    {
      "userGroups":
        [
          {
            "id":889,
            "access_level":1
          }
        ],
      "userRole":"viewer"
    }
              
    HTTP Status Response
    200 OK Return created user json info (same as "Get user" command). Output example:
    {
       "id":10091,
       "username":"someEmail1@someHost.com",
       "customerId":1033,
       "autocycle":false,
       "tempUser":false,
       "ssoUser":false,
       "newUser":false,
       "timeZone":"America/Los_Angeles",
       "userGroups":[
          {
             "id":889,
             "groupName":"Default"
          }
       ],
       "roles":[
          "viewer"
       ],
       "free":false,
       "twoFactorAuth":false
    }
      
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Invalid userInviteJson specified
  • Specified group is not exists
  • Invalid group specified
  • Invalid user role specified
  • Common error creating user via management api - details in the log at server
  • User limit reached
  • Username parameter can't be empty
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 409 CONFLICT
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • User with such name already exists
  • 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.
    curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X POST -d "{\"username\":\"someEmail1@someHost.com\", \"password\":\"somePassword\", \"phone\":\"somePhone\", \"userInviteJson\": {\"userGroups\":[{\"id\":889,\"access_level\":1}],\"userRole\":\"viewer\"} }"  http://localhost:9090/api/1.0/users
    

    Delete User

    DELETE /api/1.0/users/<user_id>

    Parameter Comments
    user_id User id of User to delete
    HTTP Status Response
    200 OK No response body
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Invalid json properties
  • Missed 'username' field in json
  • Missed 'password' field in json
  • Missed 'userInviteJson' field in json
  • Missed 'phone' field in json
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to delete specified user or user is not found
  • curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -X DELETE http://localhost:9090/api/1.0/users/10084?move_to=10085
    

    Transfer User Assets to Another User

    PUT /api/1.0/users/<userId>/moveAssets?toUserId=123456

    Parameter Comments
    userId User id of source user to transfer assets from
    toUserId User id of destination user to transfer assets to
    HTTP Status Response
    200 OK No response body
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Invalid json properties
  • Missed 'username' field in json
  • Missed 'password' field in json
  • Missed 'userInviteJson' field in json
  • Missed 'phone' field in json
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to delete specified user or user is not found
  • curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -X PUT http://localhost:9090/api/1.0/users/10084/moveAssets?toUserId=10085
    

    Edit User

    PUT /api/1.0/users/<user_id>

    Parameter Comments
    user_id User id of the user to delete

    PUT JSON payload.
    Any of fields are optional here (e.g. you can edit only required fields of user).

    Parameter Comments
    name Name of user (this is not username)
    groups List of groups to which User is belongs, including access level (1 - Edit rights, 2 - read-only) Example of object: [{"name":"Default","id":889,"type":"Groups","access_level":1}]
    roles Role of the account, could be: admin, user, viewer or custom role
    contentFilters Optional (could be set to empty string), the content filters set to User. Example: [{"fieldName":"$c9_<field>$","type":"java.lang.String","values":["33"],"operator":"Equals"}]
    timezone String timezone of the user location, e.g.: America/Los_Angeles
    twoFactorAuth (BOOL value) Boolean value, if set to "true" then 2FA (two factor) authorisation is enabled for the account
    phone Phone number of the account. Mostly useful together with "twoFactorAuth" variable
    defaultDashboardId ID of dashboard to be shown whenever user login
    autoShareTo Automatically share all assets created by user to the selected groups. This is useful within a team setting to collaborate on assets created by one user to be shared to others automatically, without sharing indivudal assets explicity. Shared assets includes any datasources, queries, widgets and dashboards. Value is array of json objects (groups) with "id" field in each of group to autoshare-to. Example, to auto-share to group with id 902: [{\"id\": 902 }]
    HTTP Status Response
    200 OK Return created user json info (same as "Get user" command). Output example:
    {
       "id":10091,
       "username":"someEmail1@someHost.com",
       "customerId":1033,
       "autocycle":false,
       "tempUser":false,
       "ssoUser":false,
       "newUser":false,
       "timeZone":"America/Los_Angeles",
       "userGroups":[
          {
             "id":889,
             "groupName":"Default"
          }
       ],
       "roles":[
          "viewer"
       ],
       "free":false,
       "twoFactorAuth":false
    }
      
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Common error saving user - details in the server log
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to edit specified user
  • 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.
    curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X PUT -d "{\"name\":\"someName123\"}"  http://localhost:9090/api/1.0/users/10096
    

    Groups

    List Groups -- Current User

    GET /api/1.0/groups

    No parameters
    HTTP Status Response
    200 OK Output example:
    {
       "list":[
          {
             "id":889,
             "groupName":"Default"
          },
          {
             "id":890,
             "groupName":"group1"
          },
          {
             "id":891,
             "groupName":"group2"
          }
       ]
    }
      
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER"  http://localhost:9090/api/1.0/groups/
    

    List Groups - By User

    GET /api/1.0/users/<user_id>/groups

    Parameter Comments
    user_id User id of User to get Groups
    HTTP Status Response
    200 OK Output example:
    {
       "list":[
          {
             "id":889,
             "groupName":"Default"
          },
          {
             "id":890,
             "groupName":"group1"
          },
          {
             "id":891,
             "groupName":"group2"
          }
       ]
    }
      
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to see specified user info
  • curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER"  http://localhost:9090/api/1.0/users/10001/groups/
    

    Get Group Details (current user)

    GET /api/1.0/groups/<group_id>

    Parameter Comments
    group_id Group id of Group to get
    withSharing Optional query parameter, value (boolean) true/false. Default value is false. If true, then output will contain list of assets shared into group, and also autoShareUsers field with list of Users which autoShared into this group (only available if user have permissions to list Users of Customer).
    HTTP Status Response
    200 OK Output example:
    {
      "id":890,
      "groupName":"group1",
      "dashboards":[],
      "charts":[{"accessLevel":1,"name":"An Chart","objectId":26563}],
      "queries":[],
      "datasources":[],
      "autoShareUsers":[{"ssoUser":false,"name":"an user name","externalAuthId":0,"id":10093,"userName":"someEmail1@someHost.com"}]
    }
      
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to see specified group
  • curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER"  http://localhost:9090/api/1.0/groups/10001?withSharing=true
    

    Get Groups - By User

    GET /api/1.0/users/<user_id>/groups/<group_id>

    Parameter Comments
    userid User id of User to get specified Group in it
    group_id Group id of Group to get info about inside specified User
    withSharing Optional query parameter, value (boolean) true/false. Default value is false. If true, then output will contain list of assets shared into group, and also autoShareUsers field with list of Users which autoShared into this group (only available if user have permissions to list Users of Customer).
    HTTP Status Response
    200 OK Output example:
    {
      "id":890,
      "groupName":"group1",
      "dashboards":[],
      "charts":[{"accessLevel":1,"name":"An Chart","objectId":26563}],
      "queries":[],
      "datasources":[],
      "autoShareUsers":[{"ssoUser":false,"name":"an user name","externalAuthId":0,"id":10093,"userName":"someEmail1@someHost.com"}]
    }
      
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to see specified group
  • curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER"  http://localhost:9090/api/1.0/users/10001/groups/90002?withSharing=true
    

    Create Group within current user

    POST /api/1.0/groups/

    Parameter Comments
    groupName Group name of new group
    HTTP Status Response
    200 OK Return created group json info (same as "Get group" command). Output example:
    {
      "id":890,
      "groupName":"group1"
    }
      
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Missed groupName field
  • Common error creating user group - more details at server log
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -d "groupname=newGroupName1"  http://localhost:9090/api/1.0/groups
    

    Create Group inside specified user

    POST /api/1.0/users/<user_id>/groups/

    Parameter Comments
    userid User id of User to create Group in it
    groupName Group name of new group
    HTTP Status Response
    200 OK Return created group json info (same as "Get group" command). Output example:
    {
      "id":890,
      "groupName":"group1"
    }
      
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Missed groupName field
  • Common error creating user group - more details at server log
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to edit specified user info
  • curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -d "groupname=newGroupName1"  http://localhost:9090/api/1.0/users/10001/groups
    

    Delete Group of current User

    DELETE /api/1.0/groups/<group_id>

    Parameter Comments
    group_id Group id of Group to delete
    HTTP Status Response
    200 OK No response body
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Failed to remove group - more details at server log
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to delete specified group
  • curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -X DELETE http://localhost:9090/api/1.0/groups/895
    

    Delete Group of specified User

    DELETE /api/1.0/users/<user_id>/groups/<group_id>

    Parameter Comments
    userid User id of User to delete Group in it
    group_id Group id of Group to delete
    HTTP Status Response
    200 OK No response body
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Failed to remove group - more details at server log
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to delete specified group
  • curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -X DELETE http://localhost:9090/api/1.0/users/10001/groups/895
    

    Edit Group of current User

    PUT /api/1.0/groups/<group_id>

    Parameter Comments
    group_id Group id of Group to edit
    groupName New group name of Group
    HTTP Status Response
    200 OK Return updated group json info (same as "Get group" command). Output example:
    {
      "id":890,
      "groupName":"group1"
    }
      
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Missed groupName field
  • Failed to edit group - details saved at server log
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to edit specified group
  • curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -X PUT -d "groupName=updatedGroupName1"  http://localhost:9090/api/1.0/groups/897
    

    Edit Group of selected User

    PUT /api/1.0/users/<user_id>/groups/<group_id>

    Parameter Comments
    user_id User id where edit the Group
    group_id Group id of Group to edit
    groupName New group name of Group
    HTTP Status Response
    200 OK Return updated group json info (same as "Get group" command). Output example:
    {
      "id":890,
      "groupName":"group1"
    }
      
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Missed groupName field
  • Failed to edit group - details saved at server log
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to edit specified group
  • curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -X PUT -d "groupName=updatedGroupName1"  http://localhost:9090/api/1.0/users/10001/groups/897
    

    Dashboards

    List Dashboards

    GET /api/1.0/dashboards

    Parameter Comments
    byCategory Optional parameter. Comma separated list of categories IDs to filter by. Multiple categories applied as OR operator.
    HTTP Status Response
    200 OK Output example:
    {
       "list":[
          {
             "createdDate":1484118380000,
             "id":110634,
             "name":"Dashboard1",
             "userId":10077,
             "url":"eD8yPisWdcQhdOeip2IJii6Tip1dLNOlFJiiDHhW3iiqSHqtQie",
             "selected":true,
             "displayOrder":0,
             "screenAdjust":true,
             "screenWidth":1447,
             "screenHeight":908,
             "lastModDt":1492849740000,
             "lastAccessDt":1492849740000,
             "locked":false,
             "accessLevel":1,
             "showWidgetList":true
          },
          {
             "createdDate":1481572146000,
             "id":110617,
             "name":"Dashboard2",
             "userId":10077,
             "url":"m2a68Ahq9l9cNWKNQoqXipiirjzwiiUGPUis0QurjbHE5bIie",
             "selected":true,
             "displayOrder":0,
             "screenAdjust":false,
             "screenWidth":1680,
             "screenHeight":1050,
             "lastModDt":1492550129000,
             "lastAccessDt":1492550093000,
             "locked":false,
             "accessLevel":1,
             "showWidgetList":true,
          }
       ]
    }
      
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
    Error details:
  • Invalid category filter parameters
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER"  http://localhost:9090/api/1.0/dashboards?byCategory=123,642
    

    Get Dashboard Details by Id

    GET /api/1.0/dashboards/<objectId>

    Parameter Comments
    objectId Dashboard id to view Dashboard
    HTTP Status Response
    200 OK Output example:
    {
     "createdDate":1481572146000,
     "id":110617,
     "name":"Dashboard2",
     "userId":10077,
     "url":"m2a68Ahq9l9cNWKNQoqXipiirjzwiiUGPUis0QurjbHE5bIie",
     "selected":true,
     "displayOrder":0,
     "screenAdjust":false,
     "screenWidth":1680,
     "screenHeight":1050,
     "lastModDt":1492550129000,
     "lastAccessDt":1492550093000,
     "locked":false,
     "accessLevel":1,
     "showWidgetList":true,
    } 
      
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to access specified dashboard
  • curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER"  http://localhost:9090/api/1.0/dashboards/10001
    

    Get Dashboard share Url

    POST /api/1.0/dashboards/<objectId>/share/url

    Parameter Comments
    objectId Dashboard id to generate share url
    contentFilters Optional form parameter content filters
    HTTP Status Response
    200 OK Output example:
    {
     "shareUrl": "4PdpqevhrfPYxmof6t2mbRkzuzXcAbmxWJhtip38VmrQie?contentFilters=%5B%7B%22fieldName%22%3A%22Customer%22%2C%22values%22%3A%5B%22Facebook%22%5D%2C%22operator%22%3A%22%3D%22%7D%5D"
    } 
      

    Note: To construct the full url, prepend /d/ and the ?shareUrl? to the host name and port. For example: http://localhost:9090/d/4PdpqevhrfPYxmof6t2mbRkzuzXcAbmxWJhtip38VmrQie?contentFilters=%5B%7B%22fieldName%22%3A%22Customer%22%2C%22values%22%3A%5B%22Facebook%22%5D%2C%22operator%22%3A%22%3D%22%7D%5D
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Current user is not allowed to generate dashboard share url
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to generate dashboard share url
  • curl -X POST -i http://localhost:9090/api/1.0/dashboards/110865/share/url -H 'Authorization: Bearer HERE_IS_YOUR_BEARER' -H 'Content-Type: application/x-www-form-urlencoded' -d 'contentFilters=[{"fieldName":"Customer","values":["Facebook"],"operator":"="}]'
    

    Get Dashboard Secure Share Url

    POST /api/1.0/dashboards/<objectId>/share/url/secure

    Parameter Comments
    objectId Dashboard id to generate secure share url
    contentFilters Optional form parameter content filters
    HTTP Status Response
    200 OK Output example:
    {
     "secureShareUrl": "kN3Gj9jipB458gipMJ8EoaeC8rWfny3kp2XIPamz8V9PQie/dnqPwU7UF61jmT+rgIft4aEY1kWQ1B1V4FWGoIGITmZGl___n3P859PnDoJlcSiov6CIWd___8Dpvl5JH74SIhJxww=="
    } 
      

    Note: To construct the full url, prepend /share/secure/ and the ?secureShareUrl? to the host name and port. For example: http://localhost:9090/share/secure/kN3Gj9jipB458gipMJ8EoaeC8rWfny3kp2XIPamz8V9PQie/dnqPwU7UF61jmT+rgIft4aEY1kWQ1B1V4FWGoIGITmZGl___n3P859PnDoJlcSiov6CIWd___8Dpvl5JH74SIhJxww==
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Customer token is missing, can't encrypt content filters
  • Error details:
  • Current user is not allowed to generate dashboard secure share url
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to generate dashboard secure share url
  • curl -X POST -i http://localhost:9090/api/1.0/dashboards/110865/share/url/secure -H 'Authorization: Bearer HERE_IS_YOUR_BEARER' -H 'Content-Type: application/x-www-form-urlencoded' -d 'contentFilters=[{"fieldName":"Customer","values":["Facebook"],"operator":"="}]'
    

    Share Dashboard to Users/Groups

    PUT /api/1.0/dashboards/<objectId>/share

    Parameter Comments
    objectId Dashboard id of Dashboard to share
    sso_user Optional bool. Set to `true` if sharing to sso user

    PUT JSON payload:

    Parameter Comments
    shareProperties Share properties json array. Available fields:
  • Type: Users, Groups.
  • access_level: 1 - Edit rights, 2 - Read-only
  • name: the name of the User to share to
  • id: group id of the Group to share to.
    Example:
    [ 
      { 
        "type" : "Users", 
        "access_level" : 1, 
        "name" : "someUser1@host.com" 
      },
      { 
        "type" : "Groups", 
        "access_level" : 1, 
        "id" : 10001 
      } 
    ]
    
  • HTTP Status Response
    200 OK No response body
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Missed shareProperties field
  • shareProperties missed the type field
  • shareProperties missed the access_level field
  • shareProperties has invalid the type value
  • shareProperties has invalid the access_level value
  • shareProperties missed the id field
  • shareProperties missed the name field
  • shareProperties has invalid the name field
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to share specified dashboard
  • 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.
    curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X PUT -d "{\"shareProperties\" : [ { \"type\" : \"Users\", \"access_level\" : 1, \"name\" : \"someUser@host.com\" } ] }"  http://localhost:9090/api/1.0/dashboards/110643/share
    

    Create Dashboard

    POST /api/1.0/dashboards/

    POST JSON payload:

    Parameter Comments
    dashName Dashboard name
    screenWidth Dashboard screen width in pixels
    screenHeight Dashboard screen height in pixels
    HTTP Status Response
    200 OK Return created Dashboard json info (same as "Get Dashboard" command). Output example:
    {
     "createdDate":1481572146000,
     "id":110617,
     "name":"Dashboard2",
     "userId":10077,
     "url":"m2a68Ahq9l9cNWKNQoqXipiirjzwiiUGPUis0QurjbHE5bIie",
     "selected":true,
     "displayOrder":0,
     "screenAdjust":false,
     "screenWidth":1680,
     "screenHeight":1050,
     "lastModDt":1492550129000,
     "lastAccessDt":1492550093000,
     "locked":false,
     "accessLevel":1,
     "showWidgetList":true,
    } 
      
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Missed dashName field
  • Invalid screenWidth field
  • Invalid screenHeight field
  • Invalid group specified
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 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.
    curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X POST -d "{\"dashName\":\"dashboardName1\",\"screenWidth\":1000,\"screenHeight\":800}"  http://localhost:9090/api/1.0/dashboards
    

    Delete Dashboard

    DELETE /api/1.0/dashboards/<objectId>

    Parameter Comments
    objectId Id of Dashboard to delete
    HTTP Status Response
    200 OK No response body
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Error removing dashboard - more details at server log
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to delete specified dashboard
  • curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -X DELETE http://localhost:9090/api/1.0/dashboards/10084
    

    Edit Dashboard

    PUT /api/1.0/dashboards/<objectId>

    Parameter Comments
    objectId Dashboard id of Dashboard to edit

    PUT JSON payload:

    Parameter Comments
    dashName New Name of Dashboard
    categories Array list of categories IDs to assign
    HTTP Status Response
    200 OK Return edited Dashboard json info (same as "Get Dashboard" command). Output example:
    {
     "createdDate":1481572146000,
     "id":110617,
     "name":"Dashboard2",
     "userId":10077,
     "url":"m2a68Ahq9l9cNWKNQoqXipiirjzwiiUGPUis0QurjbHE5bIie",
     "selected":true,
     "displayOrder":0,
     "screenAdjust":false,
     "screenWidth":1680,
     "screenHeight":1050,
     "lastModDt":1492550129000,
     "lastAccessDt":1492550093000,
     "locked":false,
     "accessLevel":1,
     "showWidgetList":true,
    } 
      
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Missed dashName field
  • Missed categories field
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to edit specified dashboard
  • Current user is not allowed to add into category with id {id}
  • 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.
    curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X PUT -d "{\"dashName\":\"updatedDashboardName1\", \"categories\" : [ 123, 456 ]}"  http://localhost:9090/api/1.0/dashboards/10001
    

    Clone Dashboard

    POST /api/1.0/dashboards/<objectIdToClone>

    Parameter Comments
    objectIdToClone Dashboard id of Dashboard to clone

    POST JSON payload:

    Parameter Comments
    dashName New (cloned) Name of Dashboard
    screenWidth Cloned dashboard screen width in pixels
    screenHeight Cloned dashboard screen height in pixels
    HTTP Status Response
    200 OK Return cloned Dashboard json info (same as "Get Dashboard" command). Output example:
    {
     "createdDate":1481572146000,
     "id":110617,
     "name":"Dashboard2",
     "userId":10077,
     "url":"m2a68Ahq9l9cNWKNQoqXipiirjzwiiUGPUis0QurjbHE5bIie",
     "selected":true,
     "displayOrder":0,
     "screenAdjust":false,
     "screenWidth":1680,
     "screenHeight":1050,
     "lastModDt":1492550129000,
     "lastAccessDt":1492550093000,
     "locked":false,
     "accessLevel":1,
     "showWidgetList":true,
    } 
      
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Error cloning dashboard - no any additional info available
  • Missed dashName field
  • Missed screenWidth field
  • Missed screenHeight field
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to clone specified dashboard
  • 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.
    curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X POST -d "{\"dashName\":\"clonedDashboardName1\",\"screenWidth\":1000,\"screenHeight\":800}" http://localhost:9090/api/1.0/dashboards/110643
    

    List Widgets in Dashboard

    GET /api/1.0/dashboards/<objectId>/widgets?byCategory=<byCategory>

    Parameter Comments
    objectId Dashboard id in which to get widgets list
    byCategory Optional parameter. Category id to filter by.
    HTTP Status Response
    200 OK Output example:
    {
       "list":[
          {
             "id":25901,
             "name":"test5",
             "userId":10077,
             "customerId":1033,
             "datasetId":15150,
             "type":2,
             "description":null,
             "urlString":"02SscJ",
             "access":0,
             "refreshChartMillis":-1,
             "createdDate":1492282355000,
             "jsonConfig":null,
             "queryId":-1,
             "queryStr":null,
             "adhocQuery":null,
             "category":"All",
             "drilldown":false,
             "dataset":{
                "createdDate":1492282355000,
                "lastModDate":1492282355000,
                "id":15150,
                "metadataConfig":"{\"fieldNames\":[\"id_0\",\"id\",\"geometry\",\"properties\"],\"dataTypes\":{\"id_0\":\"java.lang.String\",\"id\":\"java.lang.String\",\"geometry\":\"java.util.Map\",\"properties\":\"java.util.Map\"}}",
                "mongoId":null,
                "mongoConnectUri":"localhost:27017/Some_a3PNFK",
                "customerId":1033,
                "datasetName":"test5",
                "identifier":null,
                "userId":0,
                "customer":null,
                "metaData":{
                   "fieldNames":[
                      "id_0",
                      "id",
                      "geometry",
                      "properties"
                   ],
                   "dataTypes":{
                      "id_0":"java.lang.String",
                      "id":"java.lang.String",
                      "geometry":"java.util.Map",
                      "properties":"java.util.Map"
                   }
                }
             },
             "position":{
                "chartId":25901,
                "width":-1,
                "height":-1,
                "originalScreenWidth":-1,
                "originalScreenHeight":-1,
                "col":1,
                "row":13,
                "id":25901,
                "xpos":0,
                "ypos":0,
                "size_x":12,
                "size_y":12
             },
             "associations":null,
             "queryModified":false,
             "updateFilters":false,
             "dataFields":[
    
             ],
             "transientChartFilters":null,
             "typeModified":false,
             "lastSyncDate":1492282355000,
             "viewOnly":false,
             "truncated":false,
             "processedName":"test5",
             "widgetConfig":null,
             "chartProperties":{
                "chart.type":"datagrid"
             },
             "statusIndColumns":[
    
             ],
             "gridBean":null,
             "dataRow":null,
             "text":"",
             "colNames":null,
             "dataRows":null,
             "live":false,
             "filters":null,
             "widgetType":"DATA_GRID",
             "macros":null,
             "strictFilters":null,
             "dbFields":[
    
             ],
             "widgetTypeStr":"datagrid",
             "filterFieldDataTypes":{
                "geometry":"java.util.Map",
                "id":"java.lang.String",
                "id_0":"java.lang.String",
                "properties":"java.util.Map"
             },
             "allFilters":[
    
             ],
             "processedFilters":[
    
             ]
          }
       ]
    }
      
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
    Error details:
  • Invalid category filter parameters
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to get widgets of specified dashboard
  • curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER"  http://localhost:9090/api/1.0/dashboards/10001/widgets?byCategory=123,642
    

    Export dashboard to PDF

    GET /api/1.0/dashboards/<objectId>/export/pdf

    Parameter Comments
    objectId Dashboard id to export to PDF
    HTTP Status Response
    200 OK Output example:
    Pdf binary content.
      
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to access specified dashboard
  • curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER"  http://localhost:9090/api/1.0/dashboards/10001/export/pdf > file1.pdf
    

    List user Filter sets

    GET /api/1.0/dashboards/filterset

    HTTP Status Response
    200 OK Output example:
    [
        {
            "createdDate": null,
            "lastModDate": 1565638416000,
            "id": 102092,
            "userId": 1214,
            "name": "filterset",
            "accessLevel": 1,
            "filters": [
                {
                    "fieldName": "Customer",
                    "values": [
                        "Costco",
                        "Facebook",
                        "Macy's"
                    ],
                    "operator": "Equals",
                    "type": "java.lang.String",
                    "enabled": true,
                    "visible": true,
                    "transientFilter": false,
                    "fieldType": "java.lang.String"
                }
            ]
        }
    ]
      
    401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to see list of filter sets
  • curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER"  http://localhost:9090/api/1.0/dashboards/filterset
    

    Share Filter set to Users/Groups

    PUT /api/1.0/dashboards/filterset/<objectId>/share

    Parameter Comments
    objectId Filter set id to share

    POST JSON payload:

    Parameter Comments
    shareProperties Share properties json array. Available fields:
  • Type: Users, Groups.
  • access_level: 1 - Edit rights, 2 - Read-only
  • name: the name of the User to share to
  • sso_user: Optional bool. Set to `true` if sharing to sso user
  • id: group id of the Group to share to.
    Example:
    [ 
      { 
        "type" : "Users", 
        "access_level" : 1, 
        "name" : "someUser1@host.com",
        "sso_user": true
      },
      { 
        "type" : "Groups", 
        "access_level" : 1, 
        "id" : 10001 
      } 
    ]
    
  • HTTP Status Response
    200 OK No response body
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Missed shareProperties field
  • shareProperties missed the type field
  • shareProperties missed the access_level field
  • shareProperties has invalid the type value
  • shareProperties has invalid the access_level value
  • shareProperties missed the id field
  • shareProperties missed the name field
  • shareProperties has invalid the name field
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 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.
    curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X PUT -d "{\"shareProperties\" : [ { \"type\" : \"Users\", \"access_level\" : 1, \"name\" : \"someUser@host.com\", \"sso_user\" : true } ] }"  http://localhost:9090/api/1.0/dashboards/filterset/102093/share
    

    Delete Filter set

    DELETE /api/1.0/dashboards/filterset/<objectId>

    Parameter Comments
    objectId Filter set id to delete
    HTTP Status Response
    200 OK No response body
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to delete filter sets
  • curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -X DELETE http://localhost:9090/api/1.0/dashboards/filterset/102093
    

    Widgets

    List Widgets

    GET /api/1.0/widgets?byCategory=<byCategory>

    Parameter Comments
    byCategory Optional parameter. Comma separated list of categories IDs to filter by. Multiple categories applied as OR operator.
    HTTP Status Response
    200 OK Output example:
    {
       "list":[
          {
             "id":25901,
             "name":"test5",
             "userId":10077,
             "customerId":1033,
             "datasetId":15150,
             "type":2,
             "description":null,
             "urlString":"02SscJ",
             "access":0,
             "refreshChartMillis":-1,
             "createdDate":1492282355000,
             "jsonConfig":null,
             "queryId":-1,
             "queryStr":null,
             "adhocQuery":null,
             "category":"All",
             "drilldown":false,
             "dataset":{
                "createdDate":1492282355000,
                "lastModDate":1492282355000,
                "id":15150,
                "metadataConfig":"{\"fieldNames\":[\"id_0\",\"id\",\"geometry\",\"properties\"],\"dataTypes\":{\"id_0\":\"java.lang.String\",\"id\":\"java.lang.String\",\"geometry\":\"java.util.Map\",\"properties\":\"java.util.Map\"}}",
                "mongoId":null,
                "mongoConnectUri":"localhost:27017/Some_a3PNFK",
                "customerId":1033,
                "datasetName":"test5",
                "identifier":null,
                "userId":0,
                "customer":null,
                "metaData":{
                   "fieldNames":[
                      "id_0",
                      "id",
                      "geometry",
                      "properties"
                   ],
                   "dataTypes":{
                      "id_0":"java.lang.String",
                      "id":"java.lang.String",
                      "geometry":"java.util.Map",
                      "properties":"java.util.Map"
                   }
                }
             },
             "position":{
                "chartId":25901,
                "width":-1,
                "height":-1,
                "originalScreenWidth":-1,
                "originalScreenHeight":-1,
                "col":1,
                "row":13,
                "id":25901,
                "xpos":0,
                "ypos":0,
                "size_x":12,
                "size_y":12
             },
             "associations":null,
             "queryModified":false,
             "updateFilters":false,
             "dataFields":[
    
             ],
             "transientChartFilters":null,
             "typeModified":false,
             "lastSyncDate":1492282355000,
             "viewOnly":false,
             "truncated":false,
             "processedName":"test5",
             "widgetConfig":null,
             "chartProperties":{
                "chart.type":"datagrid"
             },
             "statusIndColumns":[
    
             ],
             "gridBean":null,
             "dataRow":null,
             "text":"",
             "colNames":null,
             "dataRows":null,
             "live":false,
             "filters":null,
             "widgetType":"DATA_GRID",
             "macros":null,
             "strictFilters":null,
             "dbFields":[
    
             ],
             "widgetTypeStr":"datagrid",
             "filterFieldDataTypes":{
                "geometry":"java.util.Map",
                "id":"java.lang.String",
                "id_0":"java.lang.String",
                "properties":"java.util.Map"
             },
             "allFilters":[
    
             ],
             "processedFilters":[
    
             ]
          }
       ]
    }
      
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
    Error details:
  • Invalid category filter parameters
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER"  http://localhost:9090/api/1.0/widgets?byCategory=123,642
    

    Get Widget Details by Id

    GET /api/1.0/widgets/<objectId>

    Parameter Comments
    objectId Widget id to view
    HTTP Status Response
    200 OK Output example:
    {
     "id":25901,
     "name":"test5",
     "userId":10077,
     "customerId":1033,
     "datasetId":15150,
     "type":2,
     "description":null,
     "urlString":"02SscJ",
     "access":0,
     "refreshChartMillis":-1,
     "createdDate":1492282355000,
     "jsonConfig":null,
     "queryId":-1,
     "queryStr":null,
     "adhocQuery":null,
     "category":"All",
     "drilldown":false,
     "dataset":{
        "createdDate":1492282355000,
        "lastModDate":1492282355000,
        "id":15150,
        "metadataConfig":"{\"fieldNames\":[\"id_0\",\"id\",\"geometry\",\"properties\"],\"dataTypes\":{\"id_0\":\"java.lang.String\",\"id\":\"java.lang.String\",\"geometry\":\"java.util.Map\",\"properties\":\"java.util.Map\"}}",
        "mongoId":null,
        "mongoConnectUri":"localhost:27017/Some_a3PNFK",
        "customerId":1033,
        "datasetName":"test5",
        "identifier":null,
        "userId":0,
        "customer":null,
        "metaData":{
           "fieldNames":[
              "id_0",
              "id",
              "geometry",
              "properties"
           ],
           "dataTypes":{
              "id_0":"java.lang.String",
              "id":"java.lang.String",
              "geometry":"java.util.Map",
              "properties":"java.util.Map"
           }
        }
     },
     "position":{
        "chartId":25901,
        "width":-1,
        "height":-1,
        "originalScreenWidth":-1,
        "originalScreenHeight":-1,
        "col":1,
        "row":13,
        "id":25901,
        "xpos":0,
        "ypos":0,
        "size_x":12,
        "size_y":12
     },
     "associations":null,
     "queryModified":false,
     "updateFilters":false,
     "dataFields":[
    
     ],
     "transientChartFilters":null,
     "typeModified":false,
     "lastSyncDate":1492282355000,
     "viewOnly":false,
     "truncated":false,
     "processedName":"test5",
     "widgetConfig":null,
     "chartProperties":{
        "chart.type":"datagrid"
     },
     "statusIndColumns":[
    
     ],
     "gridBean":null,
     "dataRow":null,
     "text":"",
     "colNames":null,
     "dataRows":null,
     "live":false,
     "filters":null,
     "widgetType":"DATA_GRID",
     "macros":null,
     "strictFilters":null,
     "dbFields":[
    
     ],
     "widgetTypeStr":"datagrid",
     "filterFieldDataTypes":{
        "geometry":"java.util.Map",
        "id":"java.lang.String",
        "id_0":"java.lang.String",
        "properties":"java.util.Map"
     },
     "allFilters":[
    
     ],
     "processedFilters":[
    
     ]
    } 
      
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to see specified widget
  • curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER"  http://localhost:9090/api/1.0/widgets/10001
    

    Get Widget Share Url

    POST /api/1.0/widgets/<objectId>/share/url

    Parameter Comments
    objectId Widget id to generate share url
    contentFilters Optional form parameter content filters
    HTTP Status Response
    200 OK Output example:
    {
     "shareUrl": "Zar1OtKVb7iiiiV6Ufa8VJ25Wo3jvrPI1aySdisvceplMEie?contentFilters=%5B%7B%22fieldName%22%3A%22Customer%22%2C%22values%22%3A%5B%22Facebook%22%5D%2C%22operator%22%3A%22%3D%22%7D%5D"
    } 
      

    Note: To construct the full url, prepend /w/ and the ?shareUrl? to the host name and port. For example: http://localhost:9090/w/Zar1OtKVb7iiiiV6Ufa8VJ25Wo3jvrPI1aySdisvceplMEie?contentFilters=%5B%7B%22fieldName%22%3A%22Customer%22%2C%22values%22%3A%5B%22Facebook%22%5D%2C%22operator%22%3A%22%3D%22%7D%5D
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Current user is not allowed to generate widget share url
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to generate widget share url
  • curl -X POST -i http://localhost:9090/api/1.0/widgets/3528/share/url -H 'Authorization: Bearer HERE_IS_YOUR_BEARER' -H 'Content-Type: application/x-www-form-urlencoded' -d 'contentFilters=[{"fieldName":"Customer","values":["Facebook"],"operator":"="}]'
    

    Get Widget Secure Share Url

    POST /api/1.0/widgets/<objectId>/share/url/secure

    Parameter Comments
    objectId Widget id to generate secure share url
    contentFilters Optional form parameter content filters
    HTTP Status Response
    200 OK Output example:
    {
     "secureShareUrl": "S0jBEWZ2WLNCCe8pXQYtTbip3zrq3oaM8iplCQDzEhpEkie/dnqPwU7UF61jmT+rgIft4aEY1kWQ1B1V4FWGoIGITmZGl___n3P859PnDoJlcSiov6CIWd___8Dpvl5JH74SIhJxww=="
    } 
      

    Note: To construct the full url, prepend /w-secure/ and the ?secureShareUrl? to the host name and port. For example: http://localhost:9090/w-secure/S0jBEWZ2WLNCCe8pXQYtTbip3zrq3oaM8iplCQDzEhpEkie/dnqPwU7UF61jmT+rgIft4aEY1kWQ1B1V4FWGoIGITmZGl___n3P859PnDoJlcSiov6CIWd___8Dpvl5JH74SIhJxww==
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Customer token is missing, can't encrypt content filters
  • Error details:
  • Current user is not allowed to generate widget secure share url
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to generate widget secure share url
  • curl -X POST -i http://localhost:9090/api/1.0/widgets/3528/share/url/secure -H 'Authorization: Bearer HERE_IS_YOUR_BEARER' -H 'Content-Type: application/x-www-form-urlencoded' -d 'contentFilters=[{"fieldName":"Customer","values":["Facebook"],"operator":"="}]'
    

    Share Widget to Users/Groups

    PUT /api/1.0/widgets/<objectId>/share

    Parameter Comments
    objectId Widget id of Widget to share
    sso_user Optional bool. Set to `true` if sharing to sso user

    PUT JSON payload:

    Parameter Comments
    shareProperties Share properties json array. Available fields:
  • Type: Users, Groups.
  • access_level: 1 - Edit rights, 2 - Read-only
  • name: the name of the User to share to
  • id: group id of the Group to share to.
    Example:
    [ 
      { 
        "type" : "Users", 
        "access_level" : 1, 
        "name" : "someUser1@host.com" 
      },
      { 
        "type" : "Groups", 
        "access_level" : 1, 
        "id" : 10001 
      } 
    ]
    
  • HTTP Status Response
    200 OK No response body
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Missed shareProperties field
  • shareProperties missed the type field
  • shareProperties missed the access_level field
  • shareProperties has invalid the type value
  • shareProperties has invalid the access_level value
  • shareProperties missed the id field
  • shareProperties missed the name field
  • shareProperties has invalid the name field
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to share specified widget
  • 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.
    curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X PUT -d "{\"shareProperties\" : [ { \"type\" : \"Users\", \"access_level\" : 1, \"name\" : \"someUser@host.com\" } ] }"  http://localhost:9090/api/1.0/widgets/110643/share
    

    Create Widget

    POST /api/1.0/widgets/

    POST JSON payload:

    Parameter Comments
    datasetId Id of Dataset to use to create Widget
    widgetName (String) Widget name
    widgetType Optional integer. Widget type. It is works togeter with "chart.type" parameter inside chartProperties to set actual chart kind.
    chartProperties Optional string. JSON with all chart properties. To get an example of this JSON you can get example of your chart properties from your existing widget (using Get Widget Details command), which contains chartProperties field.
    HTTP Status Response
    200 OK Return created Widget json info (same as "Get widget" command). Output example:
    {
     "id":25901,
     "name":"test5",
     "userId":10077,
     "customerId":1033,
     "datasetId":15150,
     "type":2,
     "description":null,
     "urlString":"02SscJ",
     "access":0,
     "refreshChartMillis":-1,
     "createdDate":1492282355000,
     "jsonConfig":null,
     "queryId":-1,
     "queryStr":null,
     "adhocQuery":null,
     "category":"All",
     "drilldown":false,
     "dataset":{
        "createdDate":1492282355000,
        "lastModDate":1492282355000,
        "id":15150,
        "metadataConfig":"{\"fieldNames\":[\"id_0\",\"id\",\"geometry\",\"properties\"],\"dataTypes\":{\"id_0\":\"java.lang.String\",\"id\":\"java.lang.String\",\"geometry\":\"java.util.Map\",\"properties\":\"java.util.Map\"}}",
        "mongoId":null,
        "mongoConnectUri":"localhost:27017/Some_a3PNFK",
        "customerId":1033,
        "datasetName":"test5",
        "identifier":null,
        "userId":0,
        "customer":null,
        "metaData":{
           "fieldNames":[
              "id_0",
              "id",
              "geometry",
              "properties"
           ],
           "dataTypes":{
              "id_0":"java.lang.String",
              "id":"java.lang.String",
              "geometry":"java.util.Map",
              "properties":"java.util.Map"
           }
        }
     },
     "position":{
        "chartId":25901,
        "width":-1,
        "height":-1,
        "originalScreenWidth":-1,
        "originalScreenHeight":-1,
        "col":1,
        "row":13,
        "id":25901,
        "xpos":0,
        "ypos":0,
        "size_x":12,
        "size_y":12
     },
     "associations":null,
     "queryModified":false,
     "updateFilters":false,
     "dataFields":[
    
     ],
     "transientChartFilters":null,
     "typeModified":false,
     "lastSyncDate":1492282355000,
     "viewOnly":false,
     "truncated":false,
     "processedName":"test5",
     "widgetConfig":null,
     "chartProperties":{
        "chart.type":"datagrid"
     },
     "statusIndColumns":[
    
     ],
     "gridBean":null,
     "dataRow":null,
     "text":"",
     "colNames":null,
     "dataRows":null,
     "live":false,
     "filters":null,
     "widgetType":"DATA_GRID",
     "macros":null,
     "strictFilters":null,
     "dbFields":[
    
     ],
     "widgetTypeStr":"datagrid",
     "filterFieldDataTypes":{
        "geometry":"java.util.Map",
        "id":"java.lang.String",
        "id_0":"java.lang.String",
        "properties":"java.util.Map"
     },
     "allFilters":[
    
     ],
     "processedFilters":[
    
     ]
    }
      
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Missed datasetId field
  • Missed widgetName field
  • Wrong chartProperties format
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to add widget using specified dataset
  • Have no permissions to add new widget
  • Widget limit reached
  • 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.
    curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X POST -d "{\"datasetId\":15134,\"widgetName\":\"newWidgetName1\"}" http://localhost:9090/api/1.0/widgets
    

    Delete Widget

    DELETE /api/1.0/widgets/<objectId>

    Parameter Comments
    objectId Widget id to delete
    HTTP Status Response
    200 OK No response body
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to delete specified widget
  • curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -X DELETE http://localhost:9090/api/1.0/widgets/25902
    

    Edit Widget

    PUT /api/1.0/widgets/<objectId>

    Parameter Comments
    objectId Widget id of Widget to edit

    PUT JSON payload:

    Parameter Comments
    widgetName Optional string. Widget name
    widgetType Optional integer. Widget type. It is works togeter with "chart.type" parameter inside chartProperties to set actual chart kind.
    chartProperties Optional string. JSON with all chart properties. To get an example of this JSON you can get example of your chart properties from your existing widget (using Get Widget Details command), which contains chartProperties field.
    HTTP Status Response
    200 OK Return edited Widget json info (same as "Get Widget" command). Output example:
    {
     "id":25901,
     "name":"test5",
     "userId":10077,
     "customerId":1033,
     "datasetId":15150,
     "type":2,
     "description":null,
     "urlString":"02SscJ",
     "access":0,
     "refreshChartMillis":-1,
     "createdDate":1492282355000,
     "jsonConfig":null,
     "queryId":-1,
     "queryStr":null,
     "adhocQuery":null,
     "category":"All",
     "drilldown":false,
     "dataset":{
        "createdDate":1492282355000,
        "lastModDate":1492282355000,
        "id":15150,
        "metadataConfig":"{\"fieldNames\":[\"id_0\",\"id\",\"geometry\",\"properties\"],\"dataTypes\":{\"id_0\":\"java.lang.String\",\"id\":\"java.lang.String\",\"geometry\":\"java.util.Map\",\"properties\":\"java.util.Map\"}}",
        "mongoId":null,
        "mongoConnectUri":"localhost:27017/Some_a3PNFK",
        "customerId":1033,
        "datasetName":"test5",
        "identifier":null,
        "userId":0,
        "customer":null,
        "metaData":{
           "fieldNames":[
              "id_0",
              "id",
              "geometry",
              "properties"
           ],
           "dataTypes":{
              "id_0":"java.lang.String",
              "id":"java.lang.String",
              "geometry":"java.util.Map",
              "properties":"java.util.Map"
           }
        }
     },
     "position":{
        "chartId":25901,
        "width":-1,
        "height":-1,
        "originalScreenWidth":-1,
        "originalScreenHeight":-1,
        "col":1,
        "row":13,
        "id":25901,
        "xpos":0,
        "ypos":0,
        "size_x":12,
        "size_y":12
     },
     "associations":null,
     "queryModified":false,
     "updateFilters":false,
     "dataFields":[
    
     ],
     "transientChartFilters":null,
     "typeModified":false,
     "lastSyncDate":1492282355000,
     "viewOnly":false,
     "truncated":false,
     "processedName":"test5",
     "widgetConfig":null,
     "chartProperties":{
        "chart.type":"datagrid"
     },
     "statusIndColumns":[
    
     ],
     "gridBean":null,
     "dataRow":null,
     "text":"",
     "colNames":null,
     "dataRows":null,
     "live":false,
     "filters":null,
     "widgetType":"DATA_GRID",
     "macros":null,
     "strictFilters":null,
     "dbFields":[
    
     ],
     "widgetTypeStr":"datagrid",
     "filterFieldDataTypes":{
        "geometry":"java.util.Map",
        "id":"java.lang.String",
        "id_0":"java.lang.String",
        "properties":"java.util.Map"
     },
     "allFilters":[
    
     ],
     "processedFilters":[
    
     ]
    }
      
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Wrong chartProperties format
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to edit specified widget
  • 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.
    curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X PUT -d "{\"widgetName\":\"updatedWidgetName1\"}"  http://localhost:9090/api/1.0/widgets/123
    
    curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X PUT -d "{\"chartProperties\":{\"chart.type\":\"datagrid2\",\"font.size\":\"25\",\"grid.resetColumnWidth\":\"false\",\"grid.collapsible\":\"false\",\"chart.quickpickers\":\"0\"}}"  http://localhost:9090/api/1.0/widgets/123
    

    Clone Widget

    POST /api/1.0/widgets/<objectIdToClone>

    Parameter Comments
    objectIdToClone Widget id of Widget to clone

    POST JSON payload:

    Parameter Comments
    widgetName New (cloned) Name of Widget
    HTTP Status Response
    200 OK Return cloned Widget json info (same as "Get Widget" command). Output example:
    {
     "id":25901,
     "name":"test5",
     "userId":10077,
     "customerId":1033,
     "datasetId":15150,
     "type":2,
     "description":null,
     "urlString":"02SscJ",
     "access":0,
     "refreshChartMillis":-1,
     "createdDate":1492282355000,
     "jsonConfig":null,
     "queryId":-1,
     "queryStr":null,
     "adhocQuery":null,
     "category":"All",
     "drilldown":false,
     "dataset":{
        "createdDate":1492282355000,
        "lastModDate":1492282355000,
        "id":15150,
        "metadataConfig":"{\"fieldNames\":[\"id_0\",\"id\",\"geometry\",\"properties\"],\"dataTypes\":{\"id_0\":\"java.lang.String\",\"id\":\"java.lang.String\",\"geometry\":\"java.util.Map\",\"properties\":\"java.util.Map\"}}",
        "mongoId":null,
        "mongoConnectUri":"localhost:27017/Some_a3PNFK",
        "customerId":1033,
        "datasetName":"test5",
        "identifier":null,
        "userId":0,
        "customer":null,
        "metaData":{
           "fieldNames":[
              "id_0",
              "id",
              "geometry",
              "properties"
           ],
           "dataTypes":{
              "id_0":"java.lang.String",
              "id":"java.lang.String",
              "geometry":"java.util.Map",
              "properties":"java.util.Map"
           }
        }
     },
     "position":{
        "chartId":25901,
        "width":-1,
        "height":-1,
        "originalScreenWidth":-1,
        "originalScreenHeight":-1,
        "col":1,
        "row":13,
        "id":25901,
        "xpos":0,
        "ypos":0,
        "size_x":12,
        "size_y":12
     },
     "associations":null,
     "queryModified":false,
     "updateFilters":false,
     "dataFields":[
    
     ],
     "transientChartFilters":null,
     "typeModified":false,
     "lastSyncDate":1492282355000,
     "viewOnly":false,
     "truncated":false,
     "processedName":"test5",
     "widgetConfig":null,
     "chartProperties":{
        "chart.type":"datagrid"
     },
     "statusIndColumns":[
    
     ],
     "gridBean":null,
     "dataRow":null,
     "text":"",
     "colNames":null,
     "dataRows":null,
     "live":false,
     "filters":null,
     "widgetType":"DATA_GRID",
     "macros":null,
     "strictFilters":null,
     "dbFields":[
    
     ],
     "widgetTypeStr":"datagrid",
     "filterFieldDataTypes":{
        "geometry":"java.util.Map",
        "id":"java.lang.String",
        "id_0":"java.lang.String",
        "properties":"java.util.Map"
     },
     "allFilters":[
    
     ],
     "processedFilters":[
    
     ]
    }
      
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Missed widgetName field
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to clone specified widget
  • 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.
    curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X POST -d "{\"widgetName\":\"clonedWidgetName1\"}"  http://localhost:9090/api/1.0/widgets/12345
    

    Datasources

    List Datasources

    GET /api/1.0/datasources

    No parameters
    HTTP Status Response
    200 OK Output example:
    {
       "list":[
          {
             "createdDate":1492025827000,
             "lastModDate":1492060895000,
             "strId":"hXlIbZ",
             "op":2,
             "connectorAssignee":null,
             "connectorSyncStatus":1,
             "lastSyncDate":null,
             "connector":null,
             "id":3144,
             "name":"\"someName\"",
             "datasource":"mongo",
             "userId":10077,
             "customerId":1033,
             "connectorId":1,
             "accessLevel":1
          }
       ]
    }
      
    NOTE: from entity output excluded the "jsonConfig" field.
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER"  http://localhost:9090/api/1.0/datasources
    

    Get Datasource

    GET /api/1.0/datasources/<datasourceId>

    Parameter Comments
    datasourceId Datasource ID to view
    HTTP Status Response
    200 OK Output example:
    {
       "createdDate":1492025827000,
       "lastModDate":1492060895000,
       "strId":"hXlIbZ",
       "op":2,
       "connectorAssignee":null,
       "connectorSyncStatus":1,
       "lastSyncDate":null,
       "connector":null,
       "id":3144,
       "name":"\"someName\"",
       "datasource":"mongo",
       "userId":10077,
       "customerId":1033,
       "connectorId":1,
       "accessLevel":1
    }
      
    NOTE: from entity output excluded the "jsonConfig" field.
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to see specified datasource
  • curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER"  http://localhost:9090/api/1.0/datasources/123
    

    Create Datasource

    POST /api/1.0/datasources/

    POST JSON payload.

    SubfieldTypeDescription
    nameStringDatasource name
    datasourceStringDatasource type: bigquery, cloud9charts, cloudant, couchbase, datastax, elasticsearch, ga, hana, hive, influxdb, logsene, marklogic, mongo, mysql, omniture, oracle, orientdb, phoenix, postgresql, presto, salesforce, redshift, restapi, snowflake, spark, sqlserver, teradata
    privateConnectorNumberID of private connector (only if "privateDatasource" field is set to true)
    privateDatasourceBooleantrue if this datasource is using private connector; false otherwise
    tunnelAddressStringSSH tunnel connect string in the form of cloud9@<tunnel-host>:@<tunnel-port>
    Standard datasource properties
    dataverseString(couchbase) Dataverse which should only be set for Couchbase Analytics
    dbNameString(cloudant, couchbase, datastax, hana, hive, influxdb, marklogic, mongo, mysql, oracle, orientdb, phoenix, postgresql, presto, redshift, snowflake, spark, sqlserver, teradata) Database, Bucket, or Keyspace name
    dbPropertiesString(datastax, elasticsearch, hana, hive, marklogic, mongo, mysql, oracle, postgresql, presto, redshift, snowflake, spark, sqlserver) Database specific properties in datasource specific format such as headers, query string, etc
    hostString(couchbase, datastax, hana, hive, influxdb, marklogic, mongo, mysql, oracle, orientdb, phoenix, postgresql, presto, redshift, snowflake, spark, sqlserver, teradata) Database host(s)
    passwordString(cloudant, couchbase, datastax, elasticsearch, hana, hive, influxdb, logsene, marklogic, mongo, mysql, oracle, orientdb, phoenix, postgresql, presto, redshift, restapi, snowflake, spark, sqlserver, teradata) User password
    portNumber(datastax, hana, hive, marklogic, mongo, mysql, oracle, phoenix, postgresql, presto, redshift, snowflake, spark, sqlserver, teradata) Database port
    urlString(cloudant, elasticsearch, logsene, restapi) Database URL
    userIdString(cloudant, couchbase, datastax, elasticsearch, hana, hive, influxdb, logsene, marklogic, mongo, mysql, oracle, orientdb, phoenix, postgresql, presto, redshift, restapi, snowflake, spark, sqlserver, teradata) User ID
    schemaString(hana, hive, mysql, oracle, phoenix, postgresql, presto, redshift, snowflake, spark, sqlserver, teradata) Schema name
    warehouseString(snowflake) Snowflake warehouse
    OAuth datasource properties
    authRefreshTokenString(bigquery, ga, salesforce) OAuth refresh token
    authTokenString(bigquery, ga, salesforce) OAuth token
    projectIdString(bigquery) Project ID
    gaProfileIDString(ga) Google analytic profile ID
    sfInstanceURLString(salesforce) Salesforce instance URL
    Other datasource properties
    omSecretString(omniture) Omniture secret
    omUsernameString(omniture) Omniture username
    authHeadersString(restapi) REST auth headers
    authEndPointString(restapi) REST auth endpoint
    authPostPayloadString(restapi) REST auth POST payload
    authUrlParamsString(restapi) REST URL
    Example:
    {
       "name":"Mongo Database Test",
       "host":"some.host.com",
       "port":10642,
       "dbName":"someDbName",
       "userId":"someUserId",
       "password":"somePwd12345",
       "dbProperties":"",
       "privateDatasource":false,
       "privateConnector":479,
       "tunnel":false,
       "tunnelAddress":"",
       "datasource":"mongo"
    }
    
    HTTP Status Response
    200 OK Return created Datasource json info (same as "Get Datasource" command). Output example:
    {
       "createdDate":1492025827000,
       "lastModDate":1492060895000,
       "strId":"hXlIbZ",
       "op":2,
       "connectorAssignee":null,
       "connectorSyncStatus":1,
       "lastSyncDate":null,
       "connector":null,
       "id":3144,
       "name":"\"someName\"",
       "datasource":"mongo",
       "userId":10077,
       "customerId":1033,
       "connectorId":1,
       "accessLevel":1
    }
      
    NOTE: from entity output excluded the "jsonConfig" field.
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Error processing properties to create new datasource - more details at server log
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 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.
    curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X POST -d "{\"name\":\"Mongo Database Test\", \"host\":\"some.host.com\", \"port\":10642, \"dbName\":\"someDbName\", \"userId\":\"someUserId\", \"password\":\"somePwd12345\", \"dbProperties\":\"\", \"privateDatasource\": false, \"privateConnector\":479, \"tunnel\":false, \"tunnelAddress\":\"\", \"datasource\":\"mongo\"}" http://localhost:9090/api/1.0/datasources
    

    Edit Datasource

    PUT /api/1.0/datasources/<objectId>

    Parameter Comments
    objectId ID of Datasource to edit

    PUT JSON payload.

    SubfieldTypeDescription
    nameStringDatasource name
    datasourceStringDatasource type: bigquery, cloud9charts, cloudant, couchbase, datastax, elasticsearch, ga, hana, hive, influxdb, logsene, marklogic, mongo, mysql, omniture, oracle, orientdb, phoenix, postgresql, presto, salesforce, redshift, restapi, snowflake, spark, sqlserver, teradata
    privateConnectorNumberID of private connector (only if "privateDatasource" field is set to true)
    privateDatasourceBooleantrue if this datasource is using private connector; false otherwise
    tunnelAddressStringSSH tunnel connect string in the form of cloud9@<tunnel-host>:@<tunnel-port>
    Standard datasource properties
    dataverseString(couchbase) Dataverse which should only be set for Couchbase Analytics
    dbNameString(cloudant, couchbase, datastax, hana, hive, influxdb, marklogic, mongo, mysql, oracle, orientdb, phoenix, postgresql, presto, redshift, snowflake, spark, sqlserver, teradata) Database, Bucket, or Keyspace name
    dbPropertiesString(datastax, elasticsearch, hana, hive, marklogic, mongo, mysql, oracle, postgresql, presto, redshift, snowflake, spark, sqlserver) Database specific properties in datasource specific format such as headers, query string, etc
    hostString(couchbase, datastax, hana, hive, influxdb, marklogic, mongo, mysql, oracle, orientdb, phoenix, postgresql, presto, redshift, snowflake, spark, sqlserver, teradata) Database host(s)
    passwordString(cloudant, couchbase, datastax, elasticsearch, hana, hive, influxdb, logsene, marklogic, mongo, mysql, oracle, orientdb, phoenix, postgresql, presto, redshift, restapi, snowflake, spark, sqlserver, teradata) User password
    portNumber(datastax, hana, hive, marklogic, mongo, mysql, oracle, phoenix, postgresql, presto, redshift, snowflake, spark, sqlserver, teradata) Database port
    urlString(cloudant, elasticsearch, logsene, restapi) Database URL
    userIdString(cloudant, couchbase, datastax, elasticsearch, hana, hive, influxdb, logsene, marklogic, mongo, mysql, oracle, orientdb, phoenix, postgresql, presto, redshift, restapi, snowflake, spark, sqlserver, teradata) User ID
    schemaString(hana, hive, mysql, oracle, phoenix, postgresql, presto, redshift, snowflake, spark, sqlserver, teradata) Schema name
    warehouseString(snowflake) Snowflake warehouse
    OAuth datasource properties
    authRefreshTokenString(bigquery, ga, salesforce) OAuth refresh token
    authTokenString(bigquery, ga, salesforce) OAuth token
    projectIdString(bigquery) Project ID
    gaProfileIDString(ga) Google analytic profile ID
    sfInstanceURLString(salesforce) Salesforce instance URL
    Other datasource properties
    omSecretString(omniture) Omniture secret
    omUsernameString(omniture) Omniture username
    authHeadersString(restapi) REST auth headers
    authEndPointString(restapi) REST auth endpoint
    authPostPayloadString(restapi) REST auth POST payload
    authUrlParamsString(restapi) REST URL
    Example:
    {
       "name":"Mongo Database Test",
       "host":"some.host.com",
       "port":10642,
       "dbName":"someDbName",
       "userId":"someUserId",
       "password":"somePwd12345",
       "dbProperties":"",
       "privateDatasource":false,
       "privateConnector":479,
       "tunnel":false,
       "tunnelAddress":"",
       "datasource":"mongo"
    }
    
    HTTP Status Response
    200 OK Return edited Datasource json info (same as "Get Datasource" command). Output example:
    {
       "createdDate":1492025827000,
       "lastModDate":1492060895000,
       "strId":"hXlIbZ",
       "op":2,
       "connectorAssignee":null,
       "connectorSyncStatus":1,
       "lastSyncDate":null,
       "connector":null,
       "id":3144,
       "name":"\"someName\"",
       "datasource":"mongo",
       "userId":10077,
       "customerId":1033,
       "connectorId":1,
       "accessLevel":1
    }
      
    NOTE: from entity output excluded the "jsonConfig" field.
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Failed to update datasource - more details at server log
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to edit specified datasource
  • 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.
    curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X PUT -d "{\"name\":\"Mongo Database Test\", \"host\":\"some.host.com\", \"port\":10642, \"dbName\":\"someDbName\", \"userId\":\"someUserId\", \"password\":\"somePwd12345\", \"dbProperties\":\"\", \"privateDatasource\": false, \"privateConnector\":479, \"tunnel\":false, \"tunnelAddress\":\"\", \"datasource\":\"mongo\"}"  http://localhost:9090/api/1.0/datasources/123
    

    Delete Datasource

    DELETE /api/1.0/datasources/<objectId>

    Parameter Comments
    objectId Id of Datasource to delete
    HTTP Status Response
    200 OK No response body
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to delete specified datasource
  • curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -X DELETE http://localhost:9090/api/1.0/datasources/123
    

    Share Datasource to Users/Groups

    PUT /api/1.0/datasources/<objectId>/share

    Parameter Comments
    objectId Id of Datasource to share
    sso_user Optional bool. Set to `true` if sharing to sso user

    PUT JSON payload:

    Parameter Comments
    shareProperties JSON array of objects
    SubfieldTypeDescription
    typeStringShare type: Users or Groups
    access_levelNumber1 = Edit rights
    2 = Read-only
    nameStringName of the user to share to
    idNumberGroup id of the group to share to
    Example:
    [ 
      { 
        "type" : "Users", 
        "access_level" : 1, 
        "name" : "someUser1@host.com" 
      },
      { 
        "type" : "Groups", 
        "access_level" : 1, 
        "id" : 10001 
      } 
    ]
    
    HTTP Status Response
    200 OK No response body
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Missed shareProperties field
  • shareProperties missed the type field
  • shareProperties missed the access_level field
  • shareProperties has invalid the type value
  • shareProperties has invalid the access_level value
  • shareProperties missed the id field
  • shareProperties missed the name field
  • shareProperties has invalid the name field
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to edit specified datasource
  • 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.
    curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X PUT -d "{\"shareProperties\":[ { \"type\" : \"Users\", \"access_level\" : 1, \"name\" : \"someUser@host.com\" } ] }"  http://localhost:9090/api/1.0/datasources/110643/share
    

    Clone Datasource

    POST /api/1.0/datasources/<objectIdToClone>

    Parameter Comments
    objectIdToClone Datasource id of Datasource to clone

    POST JSON payload:

    Parameter Comments
    datasourceName New (cloned) Name of Datasource
    HTTP Status Response
    200 OK Return cloned Datasource json info (same as "Get Datasource" command). Output example:
    {
       "createdDate":1492025827000,
       "lastModDate":1492060895000,
       "strId":"hXlIbZ",
       "op":2,
       "connectorAssignee":null,
       "connectorSyncStatus":1,
       "lastSyncDate":null,
       "connector":null,
       "id":3144,
       "name":"\"someName\"",
       "datasource":"mongo",
       "userId":10077,
       "customerId":1033,
       "connectorId":1,
       "accessLevel":1
    }
      
    NOTE: from entity output excluded the "jsonConfig" field.
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Error cloning datasource - more details at server log
  • Missed datasourceName field
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to clone specified datasource
  • 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.
    curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -d "{\"datasourceName\":\"newName\"}"  http://localhost:9090/api/1.0/datasources/12345
    

    Queries

    List Queries

    GET /api/1.0/queries

    Parameter Comments
    byCategory Optional parameter. Comma separated list of categories IDs to filter by. Multiple categories applied as OR operator.
    HTTP Status Response
    200 OK Output example:
    {
       "list":[
          {
             "createdDate":1492400077000,
             "lastModDate":1492400077000,
             "jsonConfig":"{\n  \"entityName\" : \"test123\",\n  \"queryStr\" : \"db[someTable].find().limit(10000)\",\n  \"datasourceId\" : 1427,\n  \"discovery\" : {\n    \"tableName\" : \"someTable\",\n    \"limit\" : 10000\n  },\n  \"direct\" : false,\n  \"triggered\" : false,\n  \"overrideVals\" : {\n    \"replaceAll\" : true\n  }\n}",
             "strId":"pvH8wk",
             "op":1,
             "connectorSyncStatus":1,
             "id":2017,
             "entityName":"test123",
             "datasourceId":1427,
             "userId":10077,
             "customerId":1033,
             "queryStr":"db[someTable].find().limit(10000)",
             "identifier":"kVrQip",
             "status":0,
             "triggerDatasetId":0,
             "discovery":{
                "tableName":"someTable",
                "limit":10000
             },
             "accessLevel":1,
             "triggered":false
          }
       ]
    }
      
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
    Error details:
  • Invalid category filter parameters
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER"  http://localhost:9090/api/1.0/queries?byCategory=123,642
    

    Get Query

    GET /api/1.0/queries/<queryId>?loadJoinDataSources=true

    Parameter Comments
    queryId Query ID (integer) to view or Query Identifier (string)
    loadJoinDataSources Optional query parameter. If set to true, then also joined Queries will be loaded associated with selected query/td>
    HTTP Status Response
    200 OK Output example:
    {
       "createdDate":1492400077000,
       "lastModDate":1492400077000,
       "lastUpdateDate":1538086002000,
       "jsonConfig":"{\n  \"entityName\" : \"test123\",\n  \"queryStr\" : \"db[someTable].find().limit(10000)\",\n  \"datasourceId\" : 1427,\n  \"discovery\" : {\n    \"tableName\" : \"someTable\",\n    \"limit\" : 10000\n  },\n  \"direct\" : false,\n  \"triggered\" : false,\n  \"overrideVals\" : {\n    \"replaceAll\" : true\n  }\n}",
       "strId":"pvH8wk",
       "op":1,
       "connectorSyncStatus":1,
       "id":2017,
       "entityName":"test123",
       "datasourceId":1427,
       "userId":10077,
       "customerId":1033,
       "queryStr":"db[someTable].find().limit(10000)",
       "identifier":"kVrQip",
       "status":0,
       "triggerDatasetId":0,
       "discovery":{
          "tableName":"someTable",
          "limit":10000
       },
       "accessLevel":1,
       "triggered":false
    }
      
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to see specified query
  • curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER"  http://localhost:9090/api/1.0/queries/123
    

    Create Query

    POST /api/1.0/queries/

    POST JSON payload:

    Parameter Comments
    runNow boolean -- True to save and run query
    properties JSON properties
    SubfieldTypeDescription
    categoriesStringComma seperated list of 1 or more categories
    c9QLFilterStringC9QL query
    datasourceIdNumberDatasource ID
    directBooleanIs direct query
    entityNameStringQuery name
    frequencyNumberSchedule frequency
    frequencyTypeStringSchedule frequency type: minute, hours,
    joinQueriesArrayArray of <JoinQuery> type objects
    <JoinQuery>.c9QLFilterStringC9QL query
    <JoinQuery>.datasourceIdNumberDatasource ID
    <JoinQuery>.joinKeysMapMap of join key fields where for each entry of the map, key represents the left handside fieldname and value represents right handside fieldname.
    <JoinQuery>.joinTypeStringJoin type: BLEND, INNER JOIN, OUTER JOIN, LEFT OUTER JOIN, RIGHT OUTER JOIN, LOOP JOIN
    <JoinQuery>.queryStrStringDatasource specific proprietary query
    overrideValsStringOverride strategy which can be:
    1. <Empty>: append mode
    2. "All": replace all
    3. <Comma seperated list of 1 or more fields>: replace based on combination of fields
    queryStrStringDatasource specific proprietary query
    startTimeStringSchedule start time time which can be in one of the following formats:
        MM-dd-yyyy HH:mm:ssXXX
        MM-dd-yyyy HH:mm:ss
        MM/dd/yyyy HH:mm:ssXXX
        MM/dd/yyyy HH:mm:ss
        MM/dd/yyyy HH:mmXXX
        MM/dd/yyyy HH:mm
        MM/dd/yy HH:mm:ssXXX
        MM/dd/yy HH:mm:ss
        MM/dd/yy HH:mmXXX
        MM/dd/yy HH:mm
        MM/dd/yyyyXXX
        MM/dd/yyyy
        MM/dd/yyXXX
        MM/dd/yy
        HH:mm:ssXXX
        HH:mm:ss
        HH:mmXXX
        HH:mm
        mmXXX
        mm
    triggeredBooleanIs triggered query
    c9ExportDatasetNumber(cloud9charts) Source dataset ID
    Example:
    {
       "entityName":"test123",
       "queryStr":"db['someTable'].find().limit(10000)",
       "c9QLFilter":"",
       "datasourceId":1427,
       "datasource":"mongo",
       "dsName":"LocalMongo",
       "direct":false,
       "triggered":false,
       "overrideVals":"All"
    }
    
    HTTP Status Response
    200 OK Output example:
    {
       "createdDate":1492400077000,
       "lastModDate":1492400077000,
       "jsonConfig":"{\n  \"entityName\" : \"test123\",\n  \"queryStr\" : \"db[someTable].find().limit(10000)\",\n  \"datasourceId\" : 1427,\n  \"discovery\" : {\n    \"tableName\" : \"someTable\",\n    \"limit\" : 10000\n  },\n  \"direct\" : false,\n  \"triggered\" : false,\n  \"overrideVals\" : {\n    \"replaceAll\" : true\n  }\n}",
       "strId":"pvH8wk",
       "op":1,
       "connectorSyncStatus":1,
       "id":2017,
       "entityName":"test123",
       "datasourceId":1427,
       "userId":10077,
       "customerId":1033,
       "queryStr":"db[someTable].find().limit(10000)",
       "identifier":"kVrQip",
       "status":0,
       "triggerDatasetId":0,
       "discovery":{
          "tableName":"someTable",
          "limit":10000
       },
       "accessLevel":1,
       "triggered":false
    }
      
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Missed properties field
  • Error processing properties to create new query - more details at server log
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 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.
    curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X POST -d "{\"properties\":{\"entityName\":\"test123\", \"queryStr\":\"db['someTable'].find().limit(10000)\", \"c9QLFilter\":\"\", \"datasourceId\":1427, \"datasource\":\"mongo\", \"dsName\":\"LocalMongo\", \"direct\":false, \"triggered\":false, \"overrideVals\":\"All\"} }" http://localhost:9090/api/1.0/queries
    

    Refresh Query

    POST /api/1.0/queries/<queryId>/refreshQuery

    Parameter Comments
    queryId ID of query to be refreshed
    HTTP Status Response
    200 OK No response body
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Error refreshing query - more details at server log
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to refresh specified query
  • 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.
    curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -X POST http://localhost:9090/api/1.0/queries/20038/refreshQuery
    

    Edit Query

    PUT /api/1.0/queries/<queryId>

    Parameter Comments
    queryId ID of query to be edited

    POST JSON payload:

    ParameterComments
    properties JSON properties
    SubfieldTypeDescription
    categoriesStringComma seperated list of 1 or more categories
    c9QLFilterStringC9QL query
    datasourceIdNumberDatasource ID
    directBooleanIs direct query
    entityNameStringQuery name
    frequencyNumberSchedule frequency
    frequencyTypeStringSchedule frequency type: minute, hours,
    joinQueriesArrayArray of <JoinQuery> type objects
    <JoinQuery>.c9QLFilterStringC9QL query
    <JoinQuery>.datasourceIdNumberDatasource ID
    <JoinQuery>.joinKeysMapMap of join key fields where for each entry of the map, key represents the left handside fieldname and value represents right handside fieldname.
    <JoinQuery>.joinTypeStringJoin type: BLEND, INNER JOIN, OUTER JOIN, LEFT OUTER JOIN, RIGHT OUTER JOIN, LOOP JOIN
    <JoinQuery>.queryStrStringDatasource specific proprietary query
    overrideValsStringOverride strategy which can be:
    1. <Empty>: append mode
    2. "All": replace all
    3. <Comma seperated list of 1 or more fields>: replace based on combination of fields
    queryStrStringDatasource specific proprietary query
    startTimeStringSchedule start time time which can be in one of the following formats:
        MM-dd-yyyy HH:mm:ssXXX
        MM-dd-yyyy HH:mm:ss
        MM/dd/yyyy HH:mm:ssXXX
        MM/dd/yyyy HH:mm:ss
        MM/dd/yyyy HH:mmXXX
        MM/dd/yyyy HH:mm
        MM/dd/yy HH:mm:ssXXX
        MM/dd/yy HH:mm:ss
        MM/dd/yy HH:mmXXX
        MM/dd/yy HH:mm
        MM/dd/yyyyXXX
        MM/dd/yyyy
        MM/dd/yyXXX
        MM/dd/yy
        HH:mm:ssXXX
        HH:mm:ss
        HH:mmXXX
        HH:mm
        mmXXX
        mm
    triggeredBooleanIs triggered query
    c9ExportDatasetNumber(cloud9charts) Source dataset ID
    Example:
    {
       "entityName":"test123",
       "queryStr":"db['someTable'].find().limit(10000)",
       "c9QLFilter":"",
       "datasourceId":1427,
       "datasource":"mongo",
       "dsName":"LocalMongo",
       "direct":false,
       "triggered":false,
       "overrideVals":"All"
    }
    
    HTTP StatusResponse
    200 OK Output example:
    {
       "createdDate":1492400077000,
       "lastModDate":1492400077000,
       "jsonConfig":"{\n  \"entityName\" : \"test123\",\n  \"queryStr\" : \"db[someTable].find().limit(10000)\",\n  \"datasourceId\" : 1427,\n  \"discovery\" : {\n    \"tableName\" : \"someTable\",\n    \"limit\" : 10000\n  },\n  \"direct\" : false,\n  \"triggered\" : false,\n  \"overrideVals\" : {\n    \"replaceAll\" : true\n  }\n}",
       "strId":"pvH8wk",
       "op":1,
       "connectorSyncStatus":1,
       "id":2017,
       "entityName":"test123",
       "datasourceId":1427,
       "userId":10077,
       "customerId":1033,
       "queryStr":"db[someTable].find().limit(10000)",
       "identifier":"kVrQip",
       "status":0,
       "triggerDatasetId":0,
       "discovery":{
          "tableName":"someTable",
          "limit":10000
       },
       "accessLevel":1,
       "triggered":false
    }
      
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Missed properties field
  • Error processing properties to create new query - more details at server log
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 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.
    curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X PUT -d "{\"properties\":{\"entityName\":\"test123\", \"queryStr\":\"db['someTable'].find().limit(10000)\", \"c9QLFilter\":\"\", \"datasourceId\":1427, \"datasource\":\"mongo\", \"dsName\":\"LocalMongo\", \"discovery\":{\"tableName\":\"someTable\", \"metrics\":[], \"dimensions\":[], \"sort\":[], \"limit\":10000, \"filters\":[], \"datasourceId\":1427, \"datasource\":\"mongo\", \"dsName\":\"LocalMongo\"}, \"direct\":false, \"triggered\":false, \"overrideVals\":\"All\"} }"  http://localhost:9090/api/1.0/queries/20050
    

    Delete Query

    DELETE /api/1.0/queries/<queryId>

    Parameter Type Comments
    queryId Integer ID of query to be deleted
    removeWidgets Boolean Delete any associated widgets
    HTTP Status Response
    200 OK No response body
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Error deleting query - more details at server log
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to delete specified query
  • 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.
    curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -X DELETE http://localhost:9090/api/1.0/queries/20038
    

    Share Query to Users/Groups

    PUT /api/1.0/queries/<queryId>/query

    Parameter Comments
    queryId Id of Query to edit
    sso_user Optional bool. Set to `true` if sharing to sso user

    JSON PUT payload:

    Parameter Comments
    shareProperties JSON array of objects
    SubfieldTypeDescription
    typeStringShare type: Users or Groups
    access_levelNumber1 = Edit rights
    2 = Read-only
    nameStringName of the user to share to
    idNumberGroup id of the group to share to
    Example:
    [ 
      { 
        "type" : "Users", 
        "access_level" : 1, 
        "name" : "someUser1@host.com" 
      },
      { 
        "type" : "Groups", 
        "access_level" : 1, 
        "id" : 10001 
      } 
    ]
    
    HTTP Status Response
    200 OK No response body
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Missed shareProperties field
  • shareProperties missed the type field
  • shareProperties missed the access_level field
  • shareProperties has invalid the type value
  • shareProperties has invalid the access_level value
  • shareProperties missed the id field
  • shareProperties missed the name field
  • shareProperties has invalid the name field
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to edit specified query
  • 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.
    curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X PUT -d "{\"shareProperties\": [ { \"type\" : \"Users\", \"access_level\" : 1, \"name\" : \"someUser@host.com\" } ] }"  http://localhost:9090/api/1.0/queries/105530
    

    Clone Query

    POST /api/1.0/queries/<objectIdToClone>

    Parameter Comments
    objectIdToClone Query id of Query to clone

    POST JSON payload:

    Parameter Comments
    clonedQueryName New (cloned) Name of Query
    HTTP Status Response
    200 OK Return cloned Query json info (same as "Get Query" command). Output example:
    {
       "createdDate":1492400077000,
       "lastModDate":1492400077000,
       "jsonConfig":"{\n  \"entityName\" : \"test123\",\n  \"queryStr\" : \"db[someTable].find().limit(10000)\",\n  \"datasourceId\" : 1427,\n  \"discovery\" : {\n    \"tableName\" : \"someTable\",\n    \"limit\" : 10000\n  },\n  \"direct\" : false,\n  \"triggered\" : false,\n  \"overrideVals\" : {\n    \"replaceAll\" : true\n  }\n}",
       "strId":"pvH8wk",
       "op":1,
       "connectorSyncStatus":1,
       "id":2017,
       "entityName":"test123",
       "datasourceId":1427,
       "userId":10077,
       "customerId":1033,
       "queryStr":"db[someTable].find().limit(10000)",
       "identifier":"kVrQip",
       "status":0,
       "triggerDatasetId":0,
       "discovery":{
          "tableName":"someTable",
          "limit":10000
       },
       "accessLevel":1,
       "triggered":false
    }
      
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Error cloning query - more details at server log
  • Missed clonedQueryName field
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to clone specified query
  • 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.
    curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X POST -d "{\"clonedQueryName\":\"newName123\"}"  http://localhost:9090/api/1.0/queries/12345
    

    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. Default value is false. If true, then output will contain sharing information to which users and/or groups each category is shared
    HTTP Status Response
    200 OK Output example:
    {
       "list":[
          {
             "createdDate":null,
             "lastModDate":null,
             "userId":10077,
             "id":16,
             "parentId":0,
             "ownerUserName":"someUser@host.com",
             "accessLevel":1,
             "name":"name2"
          }
       ]
    }
      
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to see the list of categories
  • curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER"  http://localhost:9090/api/1.0/category?objectType=2
    

    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)
    sso_user Optional bool. Set to `true` if sharing to sso user

    PUT JSON payload:

    Parameter Comments
    shareProperties Share properties json array. Available fields:
  • Type: Users, Groups.
  • access_level: 1 - Edit rights, 2 - Read-only, 5 - Deny (Exclude).
  • name: the name of the User to share to
  • id: group id of the Group to share to.
    Example:
    [ 
      { 
        "type" : "Users", 
        "access_level" : 1, 
        "name" : "someUser1@host.com" 
      },
      { 
        "type" : "Groups", 
        "access_level" : 1, 
        "id" : 10001 
      } 
    ]
    
  • HTTP Status Response
    200 OK No response body
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Missed shareProperties field
  • shareProperties missed the type field
  • shareProperties missed the access_level field
  • shareProperties has invalid the type value
  • shareProperties has invalid the access_level value
  • shareProperties missed the id field
  • shareProperties missed the name field
  • shareProperties has invalid the name field
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to share specified category
  • 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.
    curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X PUT -d "{\"shareProperties\" : [ { \"type\" : \"Users\", \"access_level\" : 1, \"name\" : \"someUser@host.com\" } ] }"  http://localhost:9090/api/1.0/category/510/share?objectType=2
    

    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
    HTTP Status Response
    200 OK Return created Category json info. Output example:
    {
             "createdDate":1481572146000,
             "lastModDate":null,
             "userId":10077,
             "id":16,
             "parentId":0,
             "ownerUserName":"someUser@host.com",
             "accessLevel":1,
             "name":"name2"
    }
      
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Missed parentId field
  • Invalid categoryName field
  • Category name is empty
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to create a category
  • Have no rights to add into parent category
  • 409 CONFLICT
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Provided category name already exists
  • 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.
    curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X POST -d "{\"parentId\":123,\"categoryName\":\"new name\"}"  http://localhost:9090/api/1.0/category?objectType=2
    

    Delete Category

    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)
    HTTP Status Response
    200 OK No response body
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Error removing category - more details at server log
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to delete a category
  • No rights to delete selected category
  • Error removing category - more details at server log
  • curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -X DELETE http://localhost:9090/api/1.0/category/105?objectType=2
    

    Edit Category

    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
    HTTP Status Response
    200 OK Return edited Category json info. Output example:
    {
             "createdDate":1481572146000,
             "lastModDate":null,
             "userId":10077,
             "id":16,
             "parentId":0,
             "ownerUserName":"someUser@host.com",
             "accessLevel":1,
             "name":"name2"
    } 
      
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Missed parentId field
  • Missed categoryName field
  • Category name is empty
  • Parent id should not equal current object id
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to edit a category
  • No rights to edit this category
  • No rights to add into parent category
  • 409 CONFLICT
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • New category name already exists in destination parent category
  • 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.
    curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X PUT -d "{\"categoryName\":\"updated category name\", \"parentId\": 123}"  http://localhost:9090/api/1.0/category/105?objectType=2
    

    Assign Asset to Categories

    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).
    HTTP Status Response
    200 OK No response body
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Missed objectId field
  • Missed categories field
  • Invalid object type
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to edit a category
  • No rights to asset
  • 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.
    curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X POST -d "{\"objectId\":10050, \"categories\": [ 123, 456 ] }"  http://localhost:9090/api/1.0/category/assign?objectType=2
    

    Add category to asset

    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.
    HTTP Status Response
    200 OK No response body
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Invalid object type
  • Missed objectId field
  • Missed category field
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to edit a category
  • No rights to asset
  • No rights to edit this category
  • 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.
    curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X POST -d "{ \"objectId\":10050, \"category\":123 }"  http://localhost:9090/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.
    HTTP Status Response
    200 OK No response body
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Invalid object type
  • Missed objectId field
  • Missed category field
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to edit a category
  • No rights to asset
  • No rights to edit this category
  • 404 NOT FOUND
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • No category to delete
  • 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.
    curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X POST -d "{ \"objectId\":10050, \"category\":123 }"  http://localhost:9090/api/1.0/category/remove?objectType=2
    

    Copy a category

    Copies category structure from source category to an destination category including assets association. The assets will not be cloned, only put into new category structure.

    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
    HTTP Status Response
    200 OK No response body
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Error details:
  • Missed sourceCategoryId field
  • Missed targetParentCategoryId field
  • Error removing category - more details at server log
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Error details:
  • Current user is not allowed to edit a category
  • No rights to copy source category
  • No edit rights to paste into destination category
  • 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.
    curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X POST -d "{ \"sourceCategoryId\":10050, \"targetParentCategoryId\":10025 }"  http://localhost:9090/api/1.0/category/copy?objectType=2
    

    NLP

    The NLP API lets you develop applications to list query suggestions and retrieve the associated response from the query. With this API, you can make NLP requests to search across datasets within a given user's account.

    The result of NLP query is a JSON object that includes query suggestions with matching datasetId or the parsed results from the NLP query.

    List suggestions

    Get query suggestions with keyword searches

    GET /api/1.0/nlp/suggestions?query=average

    Parameter Comments
    query Query which will be used for generation of autosuggestions
    HTTP Status Response
    200 OK Output example:
    [
        {
            "query": "average conversions",
            "datasetId": "16042",
            "datasetName": "report 2"
        },
        {
            "query": "average spam",
            "datasetId": "16041",
            "datasetName": "report 1"
        },
        {
            "query": "average unitprice",
            "datasetId": "16037",
            "datasetName": "Online_Retail_2"
        },
        {
            "query": "average customerid",
            "datasetId": "16036",
            "datasetName": "Online_Retail_1"
        },
        {
            "query": "average opened",
            "datasetId": "16042",
            "datasetName": "report 2"
        }
    ]
      
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    {
        "message": "Current user is not allowed to use natural language processing",
        "documentation_url": "https://knowi.com/docs/managementAPI.html"
    }
      

    Common error details:
  • Current user is not allowed to use natural language processing
  • curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -X GET "http://localhost:9090/api/1.0/nlp/suggestions?query=aver"
    

    Parse suggestion

    Returns results of parsed NLP query

    POST /api/1.0/nlp/query/parse

    Parameter Required Comments
    query Yes Query to process
    datasetId Yes Dataset that your query relates to
    format Yes Format of the response (json, txt). Defaults to json
    HTTP Status Response
    200 OK Output example:
    [
        {
            "Average Conversions": 3295.814814814815
        }
    ]
    
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • Something went wrong during the nlp processing
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • 403 FORBIDDEN
    {
        "message": "Current user is not allowed to use natural language processing",
        "documentation_url": "https://knowi.com/docs/managementAPI.html"
    }
      

    Common error details:
  • Current user is not allowed to use natural language processing
  • curl -i -H "Authorization: Bearer HEREISYOUR_BEARER" -H "Content-Type: application/x-www-form-urlencoded" -d "datasetId=16040&query=average%20conversions&format=json"

    Datasets

    Get data

    Access data for a widget/dataset defined in Knowi. This supports cached query results and direct query. The query identifier or widget/dataset entityName is used to determine with data to pull. Only one is needed.

    GET /api/1.0/datasets

    Parameter Type Comments
    entityName String Name of the dataset/widget to load data. Example: Regional Sales
    identifier String The query identifier to load data. Example: 78SDD2 To obtain:
  • From UI: To retrieve the identifier, go to queries page then query status. Examples: http://recordit.co/TAWtyDCBKS
  • From Management API: the identifier will be called "urlString" in the response properties.
  • c9SqlFilter String (Optional) SQL like Filter to manipulate the data returned. See #Cloud9QL documentation for supported functions. Example: select * where salesDate > $c9_today
    exportFormat String (Optional) Data format to return. Options are (json, csv). Defaults to json if blank.
    optimized Boolean (Optional) If True, outputs as 'json' compressed with GZIP. Defaults to False
    limit integer (Optional) Number of records to return
    runtimeTokens Array of JSON (Optional) Passing runtime tokens for direct queries e.g. `$c9_fieldName1=value1`. Should be urlencoded json of tokens. Example of json:
                [{"parameterName":"$c9_hitsParam$", "parameterValue":3}, {...}]
            
    Urlencoded:
              %5B%7B%22parameterName%22%3A%22%24c9_hitsParam%24%22%2C%20%22parameterValue%22%3A3%7D%5D
            
    version integer (Optional) Version of output. Applicable when 'optimized' set to True. Defaults to 0. Supported values 0 and 1. When set to 0 - the compressed output will contain data, when set to 1 - the compressed output will contain data and column types.
    HTTP Status Response
    200 OK Output example:
    [
      {"name":"shop1","visitors":25},
      {"name":"shop2","visitors":103}
    ]
      
    400 BAD_REQUEST
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Missing Authorization header
  • Invalid count of Authorization headers
  • Bearer token missing
  • 401 UNAUTHORIZED
    { "message": <Error details>, "documentation_url": <Documentation link> }

    Common error details:
  • Bearer token is not found or expired
  • Authorization issue or user does not exist
  • curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" 
    "http://localhost:9090/api/1.0/datasets?identifier=eQzNis&
    runtimeTokens=%5B%7B%22parameterName%22%3A%22%24c9_hitsParam%24%22%2C%20%22parameterValue%22%3A3%7D%5D"