{"_id":"564b59baee12850d00958656","category":{"_id":"563a252e50bf950d00e0979c","project":"563a252d50bf950d00e09798","pages":["563a252f50bf950d00e0979e","563a35ac1846790d0089532c","563d1407d8f2d20d00448d3c","563d1d3f9799fb0d0004776a","564509aa2c74cf1900da48c7","56453b7e9f3f550d00fa3c7b","564b498aeed7de0d003672c3","564b523ce5d9d61700d580e0","564b58ea1a8e610d006bfd49","564b59baee12850d00958656","564b6773d969330d00aba984","564b69b2d7b95d0d00ed050f","564b7fa8cc472d0d00da9447","564b905fa8a0ba21002ad6b1","564ba051288b1a2b00b3ae83","564ba6275cc43717009bcff1","564bb2138841060d00abb2e0","564bb74e05c99e1700161dd1","564c8ad60ddedc210051e582","564cca42d0c5b42b002305e8","564cca8ecfa4452b0019926d","564ce34f404ce53500fdb255","564cea76404ce53500fdb272","564cedb77d4d31170028dd2e","564cefc1bc81632100b10468","564cf17d1f42792b00820515","564cf5462248461700bd4017","564ddd49a8671617004e7b90","564ddf9ead1d5217003e2e18","564de1dea8671617004e7b99","564de3c11133043500f4bf96","564de669e39c4435005a1f65","564df3f16eaa3a2100868961","5655d3519347d30d00d7e8e2"],"version":"563a252d50bf950d00e0979b","__v":34,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-11-04T15:33:02.244Z","from_sync":false,"order":9999,"slug":"documentation","title":"Documentation"},"version":{"_id":"563a252d50bf950d00e0979b","__v":7,"project":"563a252d50bf950d00e09798","createdAt":"2015-11-04T15:33:01.701Z","releaseDate":"2015-11-04T15:33:01.701Z","categories":["563a252e50bf950d00e0979c","563a2a691846790d008952fe","563a3394daf1c00d00136d9b","563a3467d25e8919005f3f0c","563a347850bf950d00e097b4","570e5cec10aa423200391fb5","5890d358d6cb8e2500a3f311"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"user":"54c7fdeae317000d007c2765","__v":10,"parentDoc":null,"project":"563a252d50bf950d00e09798","updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-11-17T16:45:46.826Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":14,"body":"[block:api-header]\n{\n  \"type\": \"get\",\n  \"title\": \"GET /datasource-instances\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"Description\",\n    \"0-1\": \"Get a list of all the datasource-instances to which the user has access.\",\n    \"1-0\": \"Permissions\",\n    \"2-0\": \"Resource URL\",\n    \"3-0\": \"Parameters\",\n    \"4-0\": \"Response codes\",\n    \"4-1\": \"401 — Access to this datasource-instance is denied\\n404 — Data source instance not found\",\n    \"3-1\": \"client_id={id}\",\n    \"2-1\": \"https://app.klipfolio.com/api/1.0/datasource-instances\",\n    \"1-1\": \"dashboard.library\"\n  },\n  \"cols\": 2,\n  \"rows\": 5\n}\n[/block]\n##Example Request\nGET https://app.klipfolio.com/api/1/datasource-instances?client_id=0123456789abcdef0123cdef\n\n##Example Response\n```\n{\n  \"meta\": {\n    \"success\": true,\n    \"status\": 200,\n    \"count\": 4,\n    \"total\": 4\n  \"data\": {\n    \"datasources\": [\n      {\n        \"id\": \"4928fb1d95bfb4e05012de483c7761a5\",\n        \"name\": \"2014 World GDP and Population (Static)\",\n        \"description\": \"Fake data used in Klip samples. Originates from the Gallery.\",\n        \"refresh_interval\": 14400,\n        \"date_last_refresh\": \"2016-06-20T11:56:08Z\",\n        \"is_dynamic\": false\n      }]\n    }\n}\n```\n[block:api-header]\n{\n  \"type\": \"get\",\n  \"title\": \"GET /datasource-instances/{id}\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"Description\",\n    \"0-1\": \"Get the details for the specific data source ID. \\n*Note: dates are returned in UTC time.*\",\n    \"3-1\": \"id={datasource id}\",\n    \"2-1\": \"https://app.klipfolio.com/api/1.0/datasource-instances/{id}\",\n    \"1-1\": \"dashboard.library\",\n    \"1-0\": \"Permissions\",\n    \"2-0\": \"Resource URL\",\n    \"3-0\": \"Parameters\"\n  },\n  \"cols\": 2,\n  \"rows\": 4\n}\n[/block]\n##Example Request\nGET https://app.klipfolio.com/api/1/datasource-instances/0123456789abcdef0123456789abcdef\n\n##Example Response\n```\n{\n\"data\": {\n    \"id\":\"0123456789abcdef0123456789abcdef\"\n    \"datasource_id\":\"0123456789abcdef0123456789abcdef\",\n    \"datasource_name\":\"Sample data\",\n    \"date_last_refresh\":\"2014-11-18T19:34:36Z\",\n    \"date_next_refresh\":\"2014-11-18T20:34:36Z\",\n    \"refresh_fail_count\":0,\n    \"data_size\":14050\n},\n\"meta\": {\n   \"status\": 200,\n   \"success\": true\n}\n}\n```\n[block:api-header]\n{\n  \"type\": \"post\",\n  \"title\": \"POST /datasource-instances\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"Description\",\n    \"0-1\": \"Create a new data source instance based on a data source (specified as “datasource_id” in the post data).  Data source instance properties can optionally be specified in the post data.\",\n    \"1-0\": \"Permissions\",\n    \"2-0\": \"Resource URL\",\n    \"3-0\": \"Parameters\",\n    \"1-1\": \"datasource.create\",\n    \"2-1\": \"https://app.klipfolio.com/api/1.0/datasource-instances\",\n    \"3-1\": \"no_refresh\\nNote: The no_refresh parameter creates a data source with no instance, then creates an instance that doesn't refresh and then push data to it.\"\n  },\n  \"cols\": 2,\n  \"rows\": 4\n}\n[/block]\n##Example Request\nPOST https://app.klipfolio.com/api/1/datasource-instances -d {'datasource_id': '2342d101cee439562b794b07e9ebe9e2', 'properties': {'example': 'test', ...}}\n\n##Example Response\n```\n{\n\"meta\": {\n   \"status\": 200,\n   \"success\": true\n\n}\n}\n```\n[block:api-header]\n{\n  \"type\": \"delete\",\n  \"title\": \"DELETE /datasource-instances\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"Description\",\n    \"0-1\": \"Delete instances related to a specific data source.\",\n    \"3-1\": \"\",\n    \"2-1\": \"https://app.klipfolio.com/api/1.0/datasource-instances/{id}\",\n    \"1-1\": \"datasource.delete\",\n    \"1-0\": \"Permissions\",\n    \"2-0\": \"Resource URL\",\n    \"3-0\": \"Parameters\"\n  },\n  \"cols\": 2,\n  \"rows\": 4\n}\n[/block]\n##Example Request\n`DELETE https://app.klipfolio.com/api/1/datasource-instances/2342d101cee439562b794b07e9ebe9e2`\n\n##Example Response\n```\n{\n\"meta\": {\n   \"status\": 200,\n   \"success\": true\n}\n}\n```","excerpt":"A data source may have more than one instance associated with it. If the data source is a dynamic data source, it will have more than one instance associated with it. Other data sources have one instance, and the ID in this case is the same as the data source ID.","slug":"data-source-instances","type":"basic","title":"Data Source Instances"}

Data Source Instances

A data source may have more than one instance associated with it. If the data source is a dynamic data source, it will have more than one instance associated with it. Other data sources have one instance, and the ID in this case is the same as the data source ID.

[block:api-header] { "type": "get", "title": "GET /datasource-instances" } [/block] [block:parameters] { "data": { "0-0": "Description", "0-1": "Get a list of all the datasource-instances to which the user has access.", "1-0": "Permissions", "2-0": "Resource URL", "3-0": "Parameters", "4-0": "Response codes", "4-1": "401 — Access to this datasource-instance is denied\n404 — Data source instance not found", "3-1": "client_id={id}", "2-1": "https://app.klipfolio.com/api/1.0/datasource-instances", "1-1": "dashboard.library" }, "cols": 2, "rows": 5 } [/block] ##Example Request GET https://app.klipfolio.com/api/1/datasource-instances?client_id=0123456789abcdef0123cdef ##Example Response ``` { "meta": { "success": true, "status": 200, "count": 4, "total": 4 "data": { "datasources": [ { "id": "4928fb1d95bfb4e05012de483c7761a5", "name": "2014 World GDP and Population (Static)", "description": "Fake data used in Klip samples. Originates from the Gallery.", "refresh_interval": 14400, "date_last_refresh": "2016-06-20T11:56:08Z", "is_dynamic": false }] } } ``` [block:api-header] { "type": "get", "title": "GET /datasource-instances/{id}" } [/block] [block:parameters] { "data": { "0-0": "Description", "0-1": "Get the details for the specific data source ID. \n*Note: dates are returned in UTC time.*", "3-1": "id={datasource id}", "2-1": "https://app.klipfolio.com/api/1.0/datasource-instances/{id}", "1-1": "dashboard.library", "1-0": "Permissions", "2-0": "Resource URL", "3-0": "Parameters" }, "cols": 2, "rows": 4 } [/block] ##Example Request GET https://app.klipfolio.com/api/1/datasource-instances/0123456789abcdef0123456789abcdef ##Example Response ``` { "data": { "id":"0123456789abcdef0123456789abcdef" "datasource_id":"0123456789abcdef0123456789abcdef", "datasource_name":"Sample data", "date_last_refresh":"2014-11-18T19:34:36Z", "date_next_refresh":"2014-11-18T20:34:36Z", "refresh_fail_count":0, "data_size":14050 }, "meta": { "status": 200, "success": true } } ``` [block:api-header] { "type": "post", "title": "POST /datasource-instances" } [/block] [block:parameters] { "data": { "0-0": "Description", "0-1": "Create a new data source instance based on a data source (specified as “datasource_id” in the post data). Data source instance properties can optionally be specified in the post data.", "1-0": "Permissions", "2-0": "Resource URL", "3-0": "Parameters", "1-1": "datasource.create", "2-1": "https://app.klipfolio.com/api/1.0/datasource-instances", "3-1": "no_refresh\nNote: The no_refresh parameter creates a data source with no instance, then creates an instance that doesn't refresh and then push data to it." }, "cols": 2, "rows": 4 } [/block] ##Example Request POST https://app.klipfolio.com/api/1/datasource-instances -d {'datasource_id': '2342d101cee439562b794b07e9ebe9e2', 'properties': {'example': 'test', ...}} ##Example Response ``` { "meta": { "status": 200, "success": true } } ``` [block:api-header] { "type": "delete", "title": "DELETE /datasource-instances" } [/block] [block:parameters] { "data": { "0-0": "Description", "0-1": "Delete instances related to a specific data source.", "3-1": "", "2-1": "https://app.klipfolio.com/api/1.0/datasource-instances/{id}", "1-1": "datasource.delete", "1-0": "Permissions", "2-0": "Resource URL", "3-0": "Parameters" }, "cols": 2, "rows": 4 } [/block] ##Example Request `DELETE https://app.klipfolio.com/api/1/datasource-instances/2342d101cee439562b794b07e9ebe9e2` ##Example Response ``` { "meta": { "status": 200, "success": true } } ```