{"_id":"56c41d06521f350d00d34903","project":"56bc8e679afb8b0d00d62dcf","__v":4,"githubsync":"","category":{"_id":"56c418414040602b0064cea0","version":"56bc8e689afb8b0d00d62dd2","__v":5,"pages":["56c41d06521f350d00d34903","56c41d11106c12170020dba6","56c41d262e75e0170098605a","56c41d2f2d97560d00e23d03","56c41d386063071700500d04"],"project":"56bc8e679afb8b0d00d62dcf","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-02-17T06:50:41.481Z","from_sync":false,"order":8,"slug":"checkins","title":"Checkins"},"user":"56b98db7bb36440d0001f492","parentDoc":null,"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"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-02-17T07:11:02.072Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"[block:api-header]\n{\n  \"type\": \"post\",\n  \"title\": \"/checkins\"\n}\n[/block]\nCreates a new checkin for a user. A checkin records a comment and description at a specific location.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"var options = {\\n\\tlocation: \\\"47.1, -121.292\\\",\\n\\tcomment: \\\"This is so cool!\\\",\\n\\ttag: \\\"Some useful tag\\\",\\n\\tdescription: \\\"An awesome description\\\",\\n\\treadPermissions: \\\"App\\\",\\n\\twritePermissions: \\\"User\\\"\\n};\\n\\nBuddy.post('/checkins',\\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]\\\"location\\\": BPCoordinateMake(47.1, -121.292),\\n\\t\\t\\[email protected]\\\"comment\\\": @\\\"This is so cool!\\\",\\n\\t\\t\\[email protected]\\\"tag\\\": @\\\"Some useful tag\\\",\\n\\t\\t\\[email protected]\\\"description\\\": @\\\"An awesome description\\\",\\n\\t\\t\\[email protected]\\\"readPermissions\\\": @\\\"App\\\",\\n\\t\\t\\[email protected]\\\"writePermissions\\\": @\\\"User\\\"\\n\\t\\t};\\n\\n[Buddy POST:@\\\"/checkins\\\" parameters:params class:[BPCheckin 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(\\\"location\\\", myLocation);\\nparameters.put(\\\"comment\\\", \\\"This is so cool!\\\");\\nparameters.put(\\\"tag\\\", \\\"Some useful tag\\\");\\nparameters.put(\\\"description\\\", \\\"An awesome description\\\");\\nparameters.put(\\\"readPermissions\\\", \\\"App\\\");\\nparameters.put(\\\"writePermissions\\\", \\\"User\\\");\\n\\nBuddy.<Checkin>post(\\\"/checkins\\\", parameters, new BuddyCallback<Checkin>(Checkin.class) {\\n\\[email protected]\\n\\tpublic void completed(BuddyResult<Checkin> 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\\tlocation = new BuddyGeoLocation(47.1, -122.3),\\n\\t\\t\\tcomment = \\\"This is so cool!\\\",\\n\\t\\t\\ttag = \\\"Some useful tag\\\",\\n\\t\\t\\tdescription = \\\"An awesome description\\\",\\n\\t\\t\\treadPermissions = \\\"App\\\",\\n\\t\\t\\twritePermissions = \\\"User\\\"\\n\\t\\t};\\n\\nvar result = await Buddy.PostAsync<Checkin>(\\\"/checkins\\\", 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\": \"location\",\n    \"0-1\": \"A location value, passed as a string in the format \\\"{latitude}, {longitude}\\\" , for example \\\"47.1,-121.292\\\".\",\n    \"1-0\": \"comment\",\n    \"2-0\": \"tag\",\n    \"3-0\": \"description\",\n    \"4-0\": \"readPermissions\",\n    \"5-0\": \"writePermissions\",\n    \"1-1\": \"A comment about or description of the checkin.\",\n    \"2-1\": \"A string value to attach to this object. This value will be returned with the object as a property called tag.\",\n    \"3-1\": \"A string description of this checkin\",\n    \"4-1\": \"Specifies who can view this item. Values are User, only the user that created the value can view it, or App, meaning any app code can view the value.\",\n    \"5-1\": \"Specifies who can modify this item. Values are User, only the user that created the value can view it and modify it, or App, meaning any app code can view and modify the value.\",\n    \"0-2\": \"string\",\n    \"1-2\": \"string\",\n    \"2-2\": \"string\",\n    \"3-2\": \"string\",\n    \"4-2\": \"string\",\n    \"5-2\": \"string\",\n    \"0-3\": \"Required\",\n    \"1-3\": \"Optional\",\n    \"2-3\": \"Optional\",\n    \"3-3\": \"Optional\",\n    \"4-3\": \"Optional\",\n    \"5-3\": \"Optional\"\n  },\n  \"cols\": 4,\n  \"rows\": 6\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"status\\\": 201,\\n  \\\"result\\\": {\\n    \\\"userID\\\": \\\"bv.kChbvshdHnDn\\\",\\n    \\\"id\\\": \\\"cb.mDhbvPNpjtxp\\\",\\n    \\\"location\\\": {\\n      \\\"lat\\\": 34.052,\\n      \\\"lng\\\": -118.243\\n    },\\n    \\\"created\\\": \\\"2014-07-15T18:09:14.687Z\\\",\\n    \\\"lastModified\\\": \\\"2014-07-15T18:09:14.687Z\\\"\\n  },\\n  \\\"request_id\\\": \\\"53c56e4bb32fad05c0bd191b\\\",\\n  \\\"success\\\": true\\n} \",\n      \"language\": \"json\",\n      \"name\": \"Response\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]","excerpt":"","slug":"create-checkin","type":"basic","title":"Create Checkin"}
[block:api-header] { "type": "post", "title": "/checkins" } [/block] Creates a new checkin for a user. A checkin records a comment and description at a specific location. [block:code] { "codes": [ { "code": "var options = {\n\tlocation: \"47.1, -121.292\",\n\tcomment: \"This is so cool!\",\n\ttag: \"Some useful tag\",\n\tdescription: \"An awesome description\",\n\treadPermissions: \"App\",\n\twritePermissions: \"User\"\n};\n\nBuddy.post('/checkins',\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]\"location\": BPCoordinateMake(47.1, -121.292),\n\t\t\[email protected]\"comment\": @\"This is so cool!\",\n\t\t\[email protected]\"tag\": @\"Some useful tag\",\n\t\t\[email protected]\"description\": @\"An awesome description\",\n\t\t\[email protected]\"readPermissions\": @\"App\",\n\t\t\[email protected]\"writePermissions\": @\"User\"\n\t\t};\n\n[Buddy POST:@\"/checkins\" parameters:params class:[BPCheckin 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(\"location\", myLocation);\nparameters.put(\"comment\", \"This is so cool!\");\nparameters.put(\"tag\", \"Some useful tag\");\nparameters.put(\"description\", \"An awesome description\");\nparameters.put(\"readPermissions\", \"App\");\nparameters.put(\"writePermissions\", \"User\");\n\nBuddy.<Checkin>post(\"/checkins\", parameters, new BuddyCallback<Checkin>(Checkin.class) {\n\[email protected]\n\tpublic void completed(BuddyResult<Checkin> result) {\n\t\t// Your callback code here\n\t}\n});", "language": "java", "name": "Android" }, { "code": "var options = new {\n\t\t\tlocation = new BuddyGeoLocation(47.1, -122.3),\n\t\t\tcomment = \"This is so cool!\",\n\t\t\ttag = \"Some useful tag\",\n\t\t\tdescription = \"An awesome description\",\n\t\t\treadPermissions = \"App\",\n\t\t\twritePermissions = \"User\"\n\t\t};\n\nvar result = await Buddy.PostAsync<Checkin>(\"/checkins\", 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": "location", "0-1": "A location value, passed as a string in the format \"{latitude}, {longitude}\" , for example \"47.1,-121.292\".", "1-0": "comment", "2-0": "tag", "3-0": "description", "4-0": "readPermissions", "5-0": "writePermissions", "1-1": "A comment about or description of the checkin.", "2-1": "A string value to attach to this object. This value will be returned with the object as a property called tag.", "3-1": "A string description of this checkin", "4-1": "Specifies who can view this item. Values are User, only the user that created the value can view it, or App, meaning any app code can view the value.", "5-1": "Specifies who can modify this item. Values are User, only the user that created the value can view it and modify it, or App, meaning any app code can view and modify the value.", "0-2": "string", "1-2": "string", "2-2": "string", "3-2": "string", "4-2": "string", "5-2": "string", "0-3": "Required", "1-3": "Optional", "2-3": "Optional", "3-3": "Optional", "4-3": "Optional", "5-3": "Optional" }, "cols": 4, "rows": 6 } [/block] [block:code] { "codes": [ { "code": "{\n \"status\": 201,\n \"result\": {\n \"userID\": \"bv.kChbvshdHnDn\",\n \"id\": \"cb.mDhbvPNpjtxp\",\n \"location\": {\n \"lat\": 34.052,\n \"lng\": -118.243\n },\n \"created\": \"2014-07-15T18:09:14.687Z\",\n \"lastModified\": \"2014-07-15T18:09:14.687Z\"\n },\n \"request_id\": \"53c56e4bb32fad05c0bd191b\",\n \"success\": true\n} ", "language": "json", "name": "Response" } ], "sidebar": true } [/block]