The discovery API offers a RESTful API for discovering CoolaData’s metadata. Developers can use this API to check which of the platform’s resources are available and get details about those resources (JSON):

Setup for all APIs

Endpoint
All APIs use the same URI:

https://app.cooladata.com/api/v3

Header
All APIs require the following authentication to be included in the request header. Replace [User_API_Token] with the user API token found in the user profile side-bar:

Authorization: Token {User_API_Token}

Method: GET
All the APIs use the method GET.

 

Projects

Returns a list of all the projects the user has permissions for.
Full URI:

https://app.cooladata.com/api/v3/projects

Response:

[
  {
    "id": [project_id],
    "name": [project_name],
    "token": [project_token]
  },
  ...
]

 

Example

Query:

https://app.cooladata.com/api/v3/projects
Authorization: Token IrdY70oSJL3pbsidnQyJTRaclLmg75DGVFIUfpFL

Response:

[
  {
    "id": 123456,
    "name": "My First Project",
    "token": "qh9d70mh9aa4xol6ondekeff4dhq2w0u"
  }
]

 

Events

Returns a list of all the events in the project and their corresponding category. See the overview section for more information on events and properties.

Full URI:

https://app.cooladata.com/api/v3/projects/{project_id}/events

Replace {project_id} with the ID of the specific project.

Response:

[{
   "name": "event_name",
   "category": "event_category"
},
...
]

 

Example

Query:

https://app.cooladata.com/api/v3/projects/123456/events
Authorization: Token IrdY70oSJL3pbsidnQyJTRaclLmg75DGVFIUfpFL

Response:

[{
    "name": "signup",
    "category": "onboarding"
},
...
]

 

Properties (Data Columns)

Returns a list of all the properties in the project and their corresponding details. See the overview section for more information on events and properties.

Full URI:

https://app.cooladata.com/api/v3/projects/{project_id}/cql/columns

Replace {project_id} with the ID of the specific project.

Response:

The following fields are returned in the response:

[{
    "created": [epoch timestamp in miliseconds],
    "modified": [epoch timestamp in miliseconds],
    "id": 123456,
    "source": "[string]",
    "name": "[string]",
    "scope": "[string]",
    "configJson": "{}",
    "candidate": [boolean],
    "lookupsCupSize": [integer],
    "data_type": "[string]",
    "virtual": [boolean],
    "classifications": ["string",...],
    "refreshing": [boolean]
},
...
]

 

Example

Query:

https://app.cooladata.com/api/v3/projects/123456/cql/columns
Authorization: Token IrdY70oSJL3pbsidnQyJTRaclLmg75DGVFIUfpFL

Response:

[{
    "created": 1425385386000,
    "modified": 1425385386000,
    "id": 124018,
    "source": "session_os",
    "name": "device_os",
    "scope": "SESSION",
    "configJson": "{}",
    "candidate": false,
    "lookupsCupSize": 300,
    "data_type": "STRING",
    "virtual": false,
    "classifications": ["DIMENSION"],
    "refreshing": false
},
...
]

 

Lookup

Returns a list of all the values in the property’s (column’s) auto-complete list.
Full URI:

https://app.cooladata.com/api/v3/projects/{project_id}/{column_id}/lookup

Replace {project_id} with the ID of the specific project and [column_id] with the ID of the specific property (column) from the property discovery API.
Response:

{
  "lookupsValuesAlphabetical": [
    "[string]",
    ...
  ]
}

 

Example

Query:

https://app.cooladata.com/api/v3/projects/123456/654321/lookup
Authorization: Token IrdY70oSJL3pbsidnQyJTRaclLmg75DGVFIUfpFL

Response:

{
  "lookupsValuesAlphabetical": [
    "Antalya",
    "Barcelona",
    "Dubai",
    "Guangzhou",
    "Kuala Lumpur",
    "London"
    "Miami",
    "New York",
    "Taipei"
  ]
}

 

Views

Returns a list of all the tables the user can query in the project.
Full URI:

https://app.cooladata.com/api/v3/projects/{project_id}/views

Replace {project_id} with the ID of the specific project.
Response:

Currently the response only includes CoolaData’s default database (does not include Aggregation Tables and external data sources).

[
  {
    "name": "[project_name]"
  },
  ...
]

 

Example

Query:

https://app.cooladata.com/api/v3/projects/123456/views
Authorization: Token IrdY70oSJL3pbsidnQyJTRaclLmg75DGVFIUfpFL

Response:

[{
    "name": "CoolaData"
   }
]

 

Linked Data Sources

Returns a list of all the external data sources linked to the project.
Full URI:

https://app.cooladata.com/api/v3/projects/{project_id}/linked_data_sources

Replace {project_id} with the ID of the specific project.
Response:

[{
    "id": ,
    "name": "",
    "type": "",
    "connection": ,
    "description": "",
    "properties": ,
    "googleBucket": "",
    "googleProjectName": "",
    "googleDataSet": ""
}, ...
]

Example

Query:

https://app.cooladata.com/api/v3/projects/123456/linked_data_sources
Authorization: Token IrdY70oSJL3pbsidnQyJTRaclLmg75DGVFIUfpFL

Response:

The following example response includes an example of each type of data sources currently available. The actual response will only include the data sources set up in the project.

[{
    "id": 1,
    "name": "MySQL",
    "type": "MYSQL",
    "connection": null,
    "description": "example external MySQL",
    "properties": null,
    "googleBucket": "",
    "googleProjectName": "",
    "googleDataSet": ""
}, {
    "id": 2,
    "name": "MsSQL",
    "type": "SQL_SERVER",
    "connection": "jdbc:sqlserver://URL;DatabaseName=DATABASE_NAME;user=USER_NAME;password=PASSWORD",
    "description": "null",
    "properties": null,
    "googleBucket": "",
    "googleProjectName": "",
    "googleDataSet": ""
}, {
    "id": 3,
    "name": "RedShift",
    "type": "REDSHIFT",
    "connection": "username:password@host:port/database",
    "description": "null",
    "properties": null,
    "googleBucket": "",
    "googleProjectName": "",
    "googleDataSet": ""
}, {
    "id": 4,
    "name": "BigQuery",
    "type": "EXTERNAL_BIG_QUERY",
    "connection": "",
    "description": "",
    "properties": null,
    "googleBucket": null,
    "googleProjectName": "example_project",
    "googleDataSet": "example_dataset"
}, {
    "id": 5,
    "name": "GoogleBucket",
    "type": "GOOGLE_BUCKET",
    "connection": "",
    "description": "",
    "properties": null,
    "googleBucket": "project-bucketId",
    "googleProjectName": "",
    "googleDataSet": ""
}]

Tables

Returns a list of all data tables per specific external data source:

https://app.cooladata.com/api/v3/projects/{project_id}/{dataSourceId}/sys_tables

Data Columns

Returns a list of all data columns per specific external data source table:

https://app.cooladata.com/api/v3/projects/{project_id}/{dataSourceId}/{tableName}/sys_columns
Print Friendly, PDF & Email