List Datasources
This endpoint is for returning a listing of all the datasources
Query
GET /api/1.0/datasources
No parameters |
---|
Response
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:
|
401 UNAUTHORIZED |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
Example
curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER"
https://www.knowi.com/api/1.0/datasources
Get Datasource
This endpoint is for returning a datasource of a given datasource id
Query
GET /api/1.0/datasources/<objectId>
Parameter | Comments |
---|---|
objectId | Datasource id to view Datasource |
Response
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:
|
401 UNAUTHORIZED |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
403 FORBIDDEN |
{ "message": <Error details>, "documentation_url": <Documentation link> } Error details:
|
Example
curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER"
https://www.knowi.com/api/1.0/datasources/123
Share Datasource to Users/Groups
This endpoint is for sharing the datasources with users and groups of a given datasource id
Query
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 | Share properties json array. Available fields:
|
Response
HTTP Status | Response |
---|---|
200 OK | No response body |
400 BAD_REQUEST |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
401 UNAUTHORIZED |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
403 FORBIDDEN |
{ "message": <Error details>, "documentation_url": <Documentation link> } Error details:
|
415 UNSUPPORTED_MEDIA_TYPE | Cannot consume content type - The server refused this request because the request entity is in a format not supported by the requested resource for the requested method. |
Example
curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X PUT -d "{\"shareProperties\":[ { \"type\" : \"Users\", \"access_level\" : 1, \"name\" : \"someUser@host.com\" } ] }"
https://www.knowi.com/api/1.0/datasources/110643/share
Create Datasource
This endpoint is for creating a new datasource
Query
POST /api/1.0/datasources/
POST JSON payload.
Subfield | Type | Description |
---|---|---|
name | String | Datasource name |
datasource | String | Datasource 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 |
privateConnector | Number | ID of private connector (only if "privateDatasource" field is set to true) |
privateDatasource | Boolean | true if this datasource is using private connector; false otherwise |
tunnelAddress | String | SSH tunnel connect string in the form of cloud9@<tunnel-host>:@<tunnel-port> |
Standard datasource properties | ||
dataverse | String | (couchbase) Dataverse which should only be set for Couchbase Analytics |
dbName | String | (cloudant, couchbase, datastax, hana, hive, influxdb, marklogic, mongo, mysql, oracle, orientdb, phoenix, postgresql, presto, redshift, snowflake, spark, sqlserver, teradata) Database, Bucket, or Keyspace name |
dbProperties | String | (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 |
host | String | (couchbase, datastax, hana, hive, influxdb, marklogic, mongo, mysql, oracle, orientdb, phoenix, postgresql, presto, redshift, snowflake, spark, sqlserver, teradata) Database host(s) |
password | String | (cloudant, couchbase, datastax, elasticsearch, hana, hive, influxdb, logsene, marklogic, mongo, mysql, oracle, orientdb, phoenix, postgresql, presto, redshift, restapi, snowflake, spark, sqlserver, teradata) User password |
port | Number | (datastax, hana, hive, marklogic, mongo, mysql, oracle, phoenix, postgresql, presto, redshift, snowflake, spark, sqlserver, teradata) Database port |
url | String | (cloudant, elasticsearch, logsene, restapi) Database URL |
userId | String | (cloudant, couchbase, datastax, elasticsearch, hana, hive, influxdb, logsene, marklogic, mongo, mysql, oracle, orientdb, phoenix, postgresql, presto, redshift, restapi, snowflake, spark, sqlserver, teradata) User ID |
schema | String | (hana, hive, mysql, oracle, phoenix, postgresql, presto, redshift, snowflake, spark, sqlserver, teradata) Schema name |
warehouse | String | (snowflake) Snowflake warehouse |
OAuth datasource properties | ||
authRefreshToken | String | (bigquery, ga, salesforce) OAuth refresh token |
authToken | String | (bigquery, ga, salesforce) OAuth token |
projectId | String | (bigquery) Project ID |
gaProfileID | String | (ga) Google analytic profile ID |
sfInstanceURL | String | (salesforce) Salesforce instance URL |
Other datasource properties | ||
omSecret | String | (omniture) Omniture secret |
omUsername | String | (omniture) Omniture username |
authHeaders | String | (restapi) REST auth headers |
authEndPoint | String | (restapi) REST auth endpoint |
authPostPayload | String | (restapi) REST auth POST payload |
authUrlParams | String | (restapi) REST URL |
Example of object:
{ "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:
|
401 UNAUTHORIZED |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
415 UNSUPPORTED_MEDIA_TYPE | Cannot consume content type - The server refused this request because the request entity is in a format not supported by the requested resource for the requested method. |
Example
curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X POST -d "{\"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\"}"
https://www.knowi.com/api/1.0/datasources
Delete Datasource
This endpoint is for deleting a datasource of a given datasource id
Query
DELETE /api/1.0/datasources/<objectId>
Parameter | Comments |
---|---|
objectId | Id of Datasource to delete |
Response
HTTP Status | Response |
---|---|
200 OK | No response body |
400 BAD_REQUEST |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
401 UNAUTHORIZED |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
403 FORBIDDEN |
{ "message": <Error details>, "documentation_url": <Documentation link> } Error details:
|
Example
curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -X DELETE
https://www.knowi.com/api/1.0/datasources/123
Edit Datasource
This endpoint is for updating/modifying a datasource of a given datasource id
Query
PUT /api/1.0/datasources/<objectId>
Parameter | Comments |
---|---|
objectId | If of Datasource to edit |
PUT JSON payload. Json object containing edited properties of datasource. Example of object:
{ "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" }
Response
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:
|
401 UNAUTHORIZED |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
403 FORBIDDEN |
{ "message": <Error details>, "documentation_url": <Documentation link> } Error details:
|
415 UNSUPPORTED_MEDIA_TYPE | Cannot consume content type - The server refused this request because the request entity is in a format not supported by the requested resource for the requested method. |
Example
curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -X PUT -d "{\"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\"}"
https://www.knowi.com/api/1.0/datasources/123
Clone Datasource
This endpoint is for cloning the datasource of a given datasource id
Query
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 |
Response
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:
|
401 UNAUTHORIZED |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
403 FORBIDDEN |
{ "message": <Error details>, "documentation_url": <Documentation link> } Error details:
|
415 UNSUPPORTED_MEDIA_TYPE | Cannot consume content type - The server refused this request because the request entity is in a format not supported by the requested resource for the requested method. |
Example
curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -H "Content-Type: application/json" -d "{\"datasourceName\":\"newName\"}"
https://www.knowi.com/api/1.0/datasources/12345