{"_id":"56c4191cbb64720d00552b89","parentDoc":null,"__v":4,"project":"56bc8e679afb8b0d00d62dcf","user":"56b98db7bb36440d0001f492","version":{"_id":"56bc8e689afb8b0d00d62dd2","project":"56bc8e679afb8b0d00d62dcf","__v":18,"createdAt":"2016-02-11T13:36:40.146Z","releaseDate":"2016-02-11T13:36:40.146Z","categories":["56bc8e689afb8b0d00d62dd3","56c3c837bc41330d009f25ed","56c3c83e521f350d00d348eb","56c3c8452d97560d00e23cd8","56c3c85234df460d00c2beb8","56c4180d70187b17005f43b4","56c418162d97560d00e23cf6","56c4181cc4796b0d007ef039","56c4182370187b17005f43b5","56c418292e75e01700986052","56c4183328bd680d005e7ac6","56c4183bbb64720d00552b88","56c418414040602b0064cea0","56c4184754b6030d00ec29a1","56c4184c28bd680d005e7ac7","56c4185370187b17005f43b6","56c4185b6063071700500cfc","582a98b6f8c0a0190053d7a5"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"githubsync":"","category":{"_id":"56c418162d97560d00e23cf6","__v":3,"pages":["56c41905c39ff40d00d25f98","56c41911c4796b0d007ef03c","56c4191cbb64720d00552b89"],"project":"56bc8e679afb8b0d00d62dcf","version":"56bc8e689afb8b0d00d62dd2","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-02-17T06:49:58.871Z","from_sync":false,"order":0,"slug":"device-information","title":"Device Information"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-02-17T06:54:20.101Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"[block:api-header]\n{\n  \"type\": \"post\",\n  \"title\": \"/devices/current/crashreports\"\n}\n[/block]\nCreates a crash report for the current device.  Use this operation to report application errors back to Buddy.  These errors will then be visible on in the [Buddy Developer Dashboard](http://buddyplatform.com) under the **Devices** section of your application.\n\nMultiple instances of the same crash (as determined by the stack trace) will be rolled up into a single report, with details about the types of devices reporting the crash.  This ensures that you are not overwhelmed by many instances of the same issue.\n\nOther fields like `message` or `methodName` are purely informational. \n\nThe Buddy SDK, when possible, monitors the platform's unhandled exception mechanism and automatically sends crash reports before the app is allowed to exit.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"var options = {\\n\\tstackTrace: \\\"Your stack trace\\\",\\n\\tmessage: \\\"Hey your app crashed\\\",\\n\\tmethodName: \\\"function doStuff()\\\",\\n\\tlocation: \\\"47.1, -121.292\\\",\\n\\ttag: \\\"Some useful tag\\\"\\n};\\n\\nBuddy.post('/devices/current/crashreports',\\n\\t\\toptions,\\n\\t\\tfunction(err, result) {\\n\\t\\t\\t \\n\\t\\t\\tif (result.success) {\\n\\t\\t\\t\\t// Do something with the result!\\n\\t\\t\\t} else { \\n\\t\\t\\t\\t// Otherwise log the error\\n\\t\\t\\t\\tconsole.log(err); \\n\\t\\t\\t} \\n\\t\\t}\\n\\t);\",\n      \"language\": \"javascript\"\n    },\n    {\n      \"code\": \"NSDictionary *params = :::at:::{\\n\\t\\t\\[email protected]\\\"stackTrace\\\": @\\\"Your stack trace\\\",\\n\\t\\t\\[email protected]\\\"message\\\": @\\\"Hey your app crashed\\\",\\n\\t\\t\\[email protected]\\\"methodName\\\": @\\\"function doStuff()\\\",\\n\\t\\t\\[email protected]\\\"location\\\": BPCoordinateMake(47.1, -121.292),\\n\\t\\t\\[email protected]\\\"tag\\\": @\\\"Some useful tag\\\"\\n\\t\\t};\\n\\n[Buddy POST:@\\\"/devices/current/crashreports\\\" parameters:params class:[NSDictionary class] callback:^(id obj, NSError *error) {\\n\\t// Your callback code here\\n}];\",\n      \"language\": \"objectivec\",\n      \"name\": \"iOS\"\n    },\n    {\n      \"code\": \"Map<String, Object> parameters = new HashMap<String, Object>();\\nparameters.put(\\\"stackTrace\\\", \\\"Your stack trace\\\");\\nparameters.put(\\\"message\\\", \\\"Hey your app crashed\\\");\\nparameters.put(\\\"methodName\\\", \\\"function doStuff()\\\");\\nparameters.put(\\\"location\\\", myLocation);\\nparameters.put(\\\"tag\\\", \\\"Some useful tag\\\");\\n\\nBuddy.<JsonObject>post(\\\"/devices/current/crashreports\\\", parameters, new BuddyCallback<JsonObject>(JsonObject.class) {\\n\\[email protected]\\n\\tpublic void completed(BuddyResult<JsonObject> result) {\\n\\t\\t// Your callback code here\\n\\t}\\n});\",\n      \"language\": \"java\",\n      \"name\": \"Android\"\n    },\n    {\n      \"code\": \"var options = new {\\n\\t\\t\\tstackTrace = \\\"Your stack trace\\\",\\n\\t\\t\\tmessage = \\\"Hey your app crashed\\\",\\n\\t\\t\\tmethodName = \\\"function doStuff()\\\",\\n\\t\\t\\tlocation = new BuddyGeoLocation(47.1, -122.3),\\n\\t\\t\\ttag = \\\"Some useful tag\\\"\\n\\t\\t};\\n\\nvar result = await Buddy.PostAsync<IDictionary<string,object>>(\\\"/devices/current/crashreports\\\", options);\",\n      \"language\": \"csharp\",\n      \"name\": \".NET\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n###Body Parameters\n\nThese parameters should be specified as part of the request body.\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"stackTrace\",\n    \"1-0\": \"message\",\n    \"2-0\": \"methodName\",\n    \"3-0\": \"location\",\n    \"4-0\": \"tag\",\n    \"0-1\": \"A string containing the callstack information for when the crash occurred.\",\n    \"1-1\": \"A message to include about the crash.\",\n    \"2-1\": \"The name of the method where the crash occurred.\",\n    \"3-1\": \"A location value, passed as a string in the format \\\"{latitude},{longitude}\\\" (e.g. \\\"47.1,-121.292\\\").\",\n    \"4-1\": \"A string value to attach to this object. This value will be returned with the object as a property called tag.\",\n    \"0-2\": \"string\",\n    \"1-2\": \"string\",\n    \"2-2\": \"string\",\n    \"3-2\": \"string\",\n    \"4-2\": \"string\",\n    \"0-3\": \"Required\",\n    \"1-3\": \"Optional\",\n    \"2-3\": \"Optional\",\n    \"3-3\": \"Optional\",\n    \"4-3\": \"Optional\"\n  },\n  \"cols\": 4,\n  \"rows\": 5\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"status\\\": 201,\\n    \\\"request_id\\\": \\\"f27c1574-0e9d-41b6-b796-bf10cd79382a\\\"\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Response\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]","excerpt":"","slug":"crash-reports","type":"basic","title":"Crash Reports"}
[block:api-header] { "type": "post", "title": "/devices/current/crashreports" } [/block] Creates a crash report for the current device. Use this operation to report application errors back to Buddy. These errors will then be visible on in the [Buddy Developer Dashboard](http://buddyplatform.com) under the **Devices** section of your application. Multiple instances of the same crash (as determined by the stack trace) will be rolled up into a single report, with details about the types of devices reporting the crash. This ensures that you are not overwhelmed by many instances of the same issue. Other fields like `message` or `methodName` are purely informational. The Buddy SDK, when possible, monitors the platform's unhandled exception mechanism and automatically sends crash reports before the app is allowed to exit. [block:code] { "codes": [ { "code": "var options = {\n\tstackTrace: \"Your stack trace\",\n\tmessage: \"Hey your app crashed\",\n\tmethodName: \"function doStuff()\",\n\tlocation: \"47.1, -121.292\",\n\ttag: \"Some useful tag\"\n};\n\nBuddy.post('/devices/current/crashreports',\n\t\toptions,\n\t\tfunction(err, result) {\n\t\t\t \n\t\t\tif (result.success) {\n\t\t\t\t// Do something with the result!\n\t\t\t} else { \n\t\t\t\t// Otherwise log the error\n\t\t\t\tconsole.log(err); \n\t\t\t} \n\t\t}\n\t);", "language": "javascript" }, { "code": "NSDictionary *params = @{\n\t\t\[email protected]\"stackTrace\": @\"Your stack trace\",\n\t\t\[email protected]\"message\": @\"Hey your app crashed\",\n\t\t\[email protected]\"methodName\": @\"function doStuff()\",\n\t\t\[email protected]\"location\": BPCoordinateMake(47.1, -121.292),\n\t\t\[email protected]\"tag\": @\"Some useful tag\"\n\t\t};\n\n[Buddy POST:@\"/devices/current/crashreports\" parameters:params class:[NSDictionary class] callback:^(id obj, NSError *error) {\n\t// Your callback code here\n}];", "language": "objectivec", "name": "iOS" }, { "code": "Map<String, Object> parameters = new HashMap<String, Object>();\nparameters.put(\"stackTrace\", \"Your stack trace\");\nparameters.put(\"message\", \"Hey your app crashed\");\nparameters.put(\"methodName\", \"function doStuff()\");\nparameters.put(\"location\", myLocation);\nparameters.put(\"tag\", \"Some useful tag\");\n\nBuddy.<JsonObject>post(\"/devices/current/crashreports\", parameters, new BuddyCallback<JsonObject>(JsonObject.class) {\n\[email protected]\n\tpublic void completed(BuddyResult<JsonObject> result) {\n\t\t// Your callback code here\n\t}\n});", "language": "java", "name": "Android" }, { "code": "var options = new {\n\t\t\tstackTrace = \"Your stack trace\",\n\t\t\tmessage = \"Hey your app crashed\",\n\t\t\tmethodName = \"function doStuff()\",\n\t\t\tlocation = new BuddyGeoLocation(47.1, -122.3),\n\t\t\ttag = \"Some useful tag\"\n\t\t};\n\nvar result = await Buddy.PostAsync<IDictionary<string,object>>(\"/devices/current/crashreports\", options);", "language": "csharp", "name": ".NET" } ], "sidebar": true } [/block] ###Body Parameters These parameters should be specified as part of the request body. [block:parameters] { "data": { "0-0": "stackTrace", "1-0": "message", "2-0": "methodName", "3-0": "location", "4-0": "tag", "0-1": "A string containing the callstack information for when the crash occurred.", "1-1": "A message to include about the crash.", "2-1": "The name of the method where the crash occurred.", "3-1": "A location value, passed as a string in the format \"{latitude},{longitude}\" (e.g. \"47.1,-121.292\").", "4-1": "A string value to attach to this object. This value will be returned with the object as a property called tag.", "0-2": "string", "1-2": "string", "2-2": "string", "3-2": "string", "4-2": "string", "0-3": "Required", "1-3": "Optional", "2-3": "Optional", "3-3": "Optional", "4-3": "Optional" }, "cols": 4, "rows": 5 } [/block] [block:code] { "codes": [ { "code": "{\n \"status\": 201,\n \"request_id\": \"f27c1574-0e9d-41b6-b796-bf10cd79382a\"\n}", "language": "json", "name": "Response" } ], "sidebar": true } [/block]