{"__v":5,"_id":"5537e26349a5800d00a28e56","category":{"__v":7,"_id":"542ac32254d88d140075fc3a","pages":["542ac32254d88d140075fc3c","55369f1f6fd3c40d00334978","5537e1563faac70d00ff6da6","5537e1f63e785d0d00be3feb","5537e22249a5800d00a28e54","5537e24b3faac70d00ff6da8","5537e26349a5800d00a28e56"],"project":"542ac32254d88d140075fc36","version":"542ac32254d88d140075fc39","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-09-30T14:50:10.530Z","from_sync":false,"order":0,"slug":"documentation","title":"Documentation"},"project":"542ac32254d88d140075fc36","user":"542ac2d054d88d140075fc29","version":{"__v":4,"_id":"542ac32254d88d140075fc39","project":"542ac32254d88d140075fc36","createdAt":"2014-09-30T14:50:10.500Z","releaseDate":"2014-09-30T14:50:10.500Z","categories":["542ac32254d88d140075fc3a","542af0fd54d88d140075ff1b","542af128cedcfc140004b8d0","5537e2870899730d0081368d"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-04-22T18:03:15.542Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":3,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"POST /dataset/delete\"\n}\n[/block]\n**Delete specific data points**. Requires the _id of the specific data point (which is part of the information returned by any dataset query). Returns a record of the data points that have been deleted. All changes are tracked and can be reverted through the web interface.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"parameter\",\n    \"h-1\": \"value\",\n    \"0-0\": \"access_token\",\n    \"0-1\": \"The access token provided by OAuth authentication. Can also be generated directly on Exversion's web platform if you only want to access your own account.\",\n    \"1-0\": \"deletes\",\n    \"1-1\": \"An array of objects specifying which data points to delete from which datasets\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"The Delete Data Point Object\",\n  \"body\": \"Each deleted data point is an object with the following attributes:\\n- **dataset**: the ID of the dataset being changed\\n- **_id**: the ID of the specific data point being changed\"\n}\n[/block]\n**Example Requests**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"import requests\\nimport json\\n\\nurl = 'https://www.exversion.com/api/v1/dataset/delete/'\\npayload = {'access_token':[YOUR ACCESS TOKEN], 'deletes':[{'dataset':[DATASET ID], '_id':[DATA POINT ID]}]}\\nr = requests.post(url, data=json.dumps(payload))\",\n      \"language\": \"python\"\n    },\n    {\n      \"code\": \"<?php\\n\\t$post = json_encode(\\n    array('access_token'=>[YOUR ACCESS TOKEN],\\n          'deletes'=>array(\\n            array('dataset'=>[DATASET ID],\\n                  '_id'=>[DATA POINT ID])))\\n  );\\n\\t\\t\\n\\t$ch = curl_init('https://www.exversion.com/api/v1/dataset/delete/');\\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \\\"POST\\\");\\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $post);\\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\\ncurl_setopt($ch, CURLOPT_HTTPHEADER, array(\\n  'Content-Type: application/json',\\n  'Content-Length: ' . strlen($post))\\n           );\\n$result = json_decode(curl_exec($ch));\\n?>\",\n      \"language\": \"php\"\n    },\n    {\n      \"code\": \"require 'unirest'\\nresponse = Unirest.post \\\"https://www.exversion.com/api/v1/dataset/delete/\\\", \\n\\t\\theaders:{ \\\"Accept\\\" => \\\"application/json\\\" }, \\n    parameters:{'access_token'=>[YOUR ACCESS TOKEN],\\n          'deletes'=>[{'dataset'=>[DATASET ID],\\n           '_id'=>[DATA POINT ID]}]}\",\n      \"language\": \"ruby\"\n    }\n  ]\n}\n[/block]\n**Example Response**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\\"status\\\":200,\\n \\\"message\\\":\\\"Success\\\",\\n \\\"body\\\":[\\n   {\\\"test\\\":\\\"1\\\",\\\"gender\\\":\\\"f\\\",\\\"name\\\":\\\"Tal\\\",\\\"age\\\":25}\\n ]\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"POST /dataset/clear\"\n}\n[/block]\nThis endpoint will clear the dataset of all data, but not remove the dataset itself. Data can then be re-added back into the dataset. All changes are tracked and can be reverted through the web interface.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"parameter\",\n    \"h-1\": \"value\",\n    \"0-0\": \"access_token\",\n    \"0-1\": \"The access token provided by OAuth authentication. Can also be generated directly on Exversion's web platform if you only want to access your own account.\",\n    \"1-0\": \"dataset\",\n    \"1-1\": \"ID of the dataset to clear\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n**Example Requests**\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"import requests\\nimport json\\n\\nurl = 'https://www.exversion.com/api/v1/dataset/clear/'\\npayload = {'access_token':[YOUR ACCESS TOKEN], 'dataset':[DATASET ID]}\\nr = requests.post(url, data=json.dumps(payload))\\n\",\n      \"language\": \"python\"\n    },\n    {\n      \"code\": \"<?php\\n\\t$post = json_encode(\\n    array('access_token'=>[YOUR ACCESS TOKEN],\\n          'dataset'=>[DATASET ID])\\n  );\\n\\t\\t\\n\\t$ch = curl_init('https://www.exversion.com/api/v1/dataset/clear/');\\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \\\"POST\\\");\\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $post);\\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\\ncurl_setopt($ch, CURLOPT_HTTPHEADER, array(\\n  'Content-Type: application/json',\\n  'Content-Length: ' . strlen($post))\\n           );\\n$result = json_decode(curl_exec($ch));\\n?>\",\n      \"language\": \"php\"\n    },\n    {\n      \"code\": \"require 'unirest'\\nresponse = Unirest.post \\\"https://www.exversion.com/api/v1/dataset/clear/\\\", \\n\\t\\theaders:{ \\\"Accept\\\" => \\\"application/json\\\" }, \\n    parameters:{'access_token'=>[YOUR ACCESS TOKEN],\\n          'dataset'=>[DATASET ID]}\",\n      \"language\": \"ruby\"\n    }\n  ]\n}\n[/block]\n**Example Response**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\\"status\\\":200,\\n \\\"message\\\":\\\"Dataset XXX has been cleared of all data\\\",\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"POST /dataset/remove\"\n}\n[/block]\nCompletely and totally remove the data repository from Exversion. The ID is destroyed, the metadata removed and all the data is cleared from the db. This change is NOT TRACKED and cannot be reverted.\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"access_token\",\n    \"h-0\": \"parameter\",\n    \"h-1\": \"value\",\n    \"0-1\": \"The access token provided by OAuth authentication. Can also be generated directly on Exversion's web platform if you only want to access your own account.\",\n    \"1-0\": \"dataset\",\n    \"1-1\": \"ID of the dataset to clear\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n**Example Requests**\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"url = 'https://www.exversion.com/api/v1/dataset/remove/'\\npayload = {'access_token':[YOUR ACCESS TOKEN], 'dataset':[DATASET ID]}\\nr = requests.post(url, data=json.dumps(payload))\",\n      \"language\": \"python\"\n    },\n    {\n      \"code\": \"<?php\\n\\t$post = json_encode(\\n    array('access_token'=>[YOUR ACCESS TOKEN],\\n          'dataset'=>[DATASET ID])\\n  );\\n\\t\\t\\n\\t$ch = curl_init('https://www.exversion.com/api/v1/dataset/remove/');\\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \\\"POST\\\");\\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $post);\\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\\ncurl_setopt($ch, CURLOPT_HTTPHEADER, array(\\n  'Content-Type: application/json',\\n  'Content-Length: ' . strlen($post))\\n           );\\n$result = json_decode(curl_exec($ch));\\n?>\",\n      \"language\": \"php\"\n    },\n    {\n      \"code\": \"require 'unirest'\\nresponse = Unirest.post \\\"https://www.exversion.com/api/v1/dataset/remove/\\\", \\n\\t\\theaders:{ \\\"Accept\\\" => \\\"application/json\\\" }, \\n    parameters:{'access_token'=>[YOUR ACCESS TOKEN],\\n          'dataset'=>[DATASET ID]}\",\n      \"language\": \"ruby\"\n    }\n  ]\n}\n[/block]\n**Example Response**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\\"status\\\":200,\\n \\\"message\\\":\\\"Dataset XXX has been deleted\\\",\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"deleting-data","type":"basic","title":"Deleting Data"}
[block:api-header] { "type": "basic", "title": "POST /dataset/delete" } [/block] **Delete specific data points**. Requires the _id of the specific data point (which is part of the information returned by any dataset query). Returns a record of the data points that have been deleted. All changes are tracked and can be reverted through the web interface. [block:parameters] { "data": { "h-0": "parameter", "h-1": "value", "0-0": "access_token", "0-1": "The access token provided by OAuth authentication. Can also be generated directly on Exversion's web platform if you only want to access your own account.", "1-0": "deletes", "1-1": "An array of objects specifying which data points to delete from which datasets" }, "cols": 2, "rows": 2 } [/block] [block:callout] { "type": "info", "title": "The Delete Data Point Object", "body": "Each deleted data point is an object with the following attributes:\n- **dataset**: the ID of the dataset being changed\n- **_id**: the ID of the specific data point being changed" } [/block] **Example Requests** [block:code] { "codes": [ { "code": "import requests\nimport json\n\nurl = 'https://www.exversion.com/api/v1/dataset/delete/'\npayload = {'access_token':[YOUR ACCESS TOKEN], 'deletes':[{'dataset':[DATASET ID], '_id':[DATA POINT ID]}]}\nr = requests.post(url, data=json.dumps(payload))", "language": "python" }, { "code": "<?php\n\t$post = json_encode(\n array('access_token'=>[YOUR ACCESS TOKEN],\n 'deletes'=>array(\n array('dataset'=>[DATASET ID],\n '_id'=>[DATA POINT ID])))\n );\n\t\t\n\t$ch = curl_init('https://www.exversion.com/api/v1/dataset/delete/');\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $post);\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json',\n 'Content-Length: ' . strlen($post))\n );\n$result = json_decode(curl_exec($ch));\n?>", "language": "php" }, { "code": "require 'unirest'\nresponse = Unirest.post \"https://www.exversion.com/api/v1/dataset/delete/\", \n\t\theaders:{ \"Accept\" => \"application/json\" }, \n parameters:{'access_token'=>[YOUR ACCESS TOKEN],\n 'deletes'=>[{'dataset'=>[DATASET ID],\n '_id'=>[DATA POINT ID]}]}", "language": "ruby" } ] } [/block] **Example Response** [block:code] { "codes": [ { "code": "{\"status\":200,\n \"message\":\"Success\",\n \"body\":[\n {\"test\":\"1\",\"gender\":\"f\",\"name\":\"Tal\",\"age\":25}\n ]\n}", "language": "json" } ] } [/block] [block:api-header] { "type": "basic", "title": "POST /dataset/clear" } [/block] This endpoint will clear the dataset of all data, but not remove the dataset itself. Data can then be re-added back into the dataset. All changes are tracked and can be reverted through the web interface. [block:parameters] { "data": { "h-0": "parameter", "h-1": "value", "0-0": "access_token", "0-1": "The access token provided by OAuth authentication. Can also be generated directly on Exversion's web platform if you only want to access your own account.", "1-0": "dataset", "1-1": "ID of the dataset to clear" }, "cols": 2, "rows": 2 } [/block] **Example Requests** [block:code] { "codes": [ { "code": "import requests\nimport json\n\nurl = 'https://www.exversion.com/api/v1/dataset/clear/'\npayload = {'access_token':[YOUR ACCESS TOKEN], 'dataset':[DATASET ID]}\nr = requests.post(url, data=json.dumps(payload))\n", "language": "python" }, { "code": "<?php\n\t$post = json_encode(\n array('access_token'=>[YOUR ACCESS TOKEN],\n 'dataset'=>[DATASET ID])\n );\n\t\t\n\t$ch = curl_init('https://www.exversion.com/api/v1/dataset/clear/');\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $post);\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json',\n 'Content-Length: ' . strlen($post))\n );\n$result = json_decode(curl_exec($ch));\n?>", "language": "php" }, { "code": "require 'unirest'\nresponse = Unirest.post \"https://www.exversion.com/api/v1/dataset/clear/\", \n\t\theaders:{ \"Accept\" => \"application/json\" }, \n parameters:{'access_token'=>[YOUR ACCESS TOKEN],\n 'dataset'=>[DATASET ID]}", "language": "ruby" } ] } [/block] **Example Response** [block:code] { "codes": [ { "code": "{\"status\":200,\n \"message\":\"Dataset XXX has been cleared of all data\",\n}", "language": "json" } ] } [/block] [block:api-header] { "type": "basic", "title": "POST /dataset/remove" } [/block] Completely and totally remove the data repository from Exversion. The ID is destroyed, the metadata removed and all the data is cleared from the db. This change is NOT TRACKED and cannot be reverted. [block:parameters] { "data": { "0-0": "access_token", "h-0": "parameter", "h-1": "value", "0-1": "The access token provided by OAuth authentication. Can also be generated directly on Exversion's web platform if you only want to access your own account.", "1-0": "dataset", "1-1": "ID of the dataset to clear" }, "cols": 2, "rows": 2 } [/block] **Example Requests** [block:code] { "codes": [ { "code": "url = 'https://www.exversion.com/api/v1/dataset/remove/'\npayload = {'access_token':[YOUR ACCESS TOKEN], 'dataset':[DATASET ID]}\nr = requests.post(url, data=json.dumps(payload))", "language": "python" }, { "code": "<?php\n\t$post = json_encode(\n array('access_token'=>[YOUR ACCESS TOKEN],\n 'dataset'=>[DATASET ID])\n );\n\t\t\n\t$ch = curl_init('https://www.exversion.com/api/v1/dataset/remove/');\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $post);\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json',\n 'Content-Length: ' . strlen($post))\n );\n$result = json_decode(curl_exec($ch));\n?>", "language": "php" }, { "code": "require 'unirest'\nresponse = Unirest.post \"https://www.exversion.com/api/v1/dataset/remove/\", \n\t\theaders:{ \"Accept\" => \"application/json\" }, \n parameters:{'access_token'=>[YOUR ACCESS TOKEN],\n 'dataset'=>[DATASET ID]}", "language": "ruby" } ] } [/block] **Example Response** [block:code] { "codes": [ { "code": "{\"status\":200,\n \"message\":\"Dataset XXX has been deleted\",\n}", "language": "json" } ] } [/block]