{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/yo","auth":"never","results":{"codes":[]},"settings":"","params":[{"name":"username","type":"string","default":"","desc":"","required":false,"in":"body","ref":"","_id":"542955e9ee5e3c0800157307"}]},"next":{"description":"","pages":[]},"title":"What is Yo?","type":"basic","slug":"getting-started","excerpt":"","body":"Yo is the simplest notification platform.\n\n\nSome details about Yo:\n* It's perfect for the times you just need a simple ping that let's you know something happened and the predefined context fills in the data that is not provided in the notification.\n* Yo can be used between people, but with this simple API you can get notified about stuff that happens from computers as well.\n* A \"Yo\" is a simple push notification.\n* Sending a Yo is as easy as sending a POST request. All you need is a token that determines who the Yo is from, and the username of the recipient.\ncURL Example:\n```curl --data \"username=JOE&api_token=<your_api_token>\" https://api.justyo.co/yo/```\n\n\nTo send yourself a Yo:\n1. Download the app: https://justyo.co\n2. Get your API token: https://dashboard.justyo.co\n3. In terminal: ```curl --data \"username=<your_username>&api_token=<your_api_token>\" https://api.justyo.co/yo/```\n\n\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"import requests\\nrequests.post(\\\"http://api.justyo.co/yo/\\\", \\n data={'api_token': api_token, 'username': 'JOHNAPPLESEED'})\",\n \"language\": \"python\"\n },\n {\n \"code\": \"require 'net/http'\\n\\npostData = Net::HTTP.post_form(URI.parse('http://api.justyo.co/yo/'), {'api_token'=>'<token>', 'username'=>'JOE'})\\n\\nputs postData.body\",\n \"language\": \"ruby\"\n },\n {\n \"code\": \"$url = 'http://api.justyo.co/yo/';\\n$data = array('api_token' => 'token', 'username' => 'JOE');\\n\\n$options = array(\\n 'http' => array(\\n 'header' => \\\"Content-type: application/x-www-form-urlencoded\\\\r\\\\n\\\",\\n 'method' => 'POST',\\n 'content' => http_build_query($data),\\n ),\\n);\\n$context = stream_context_create($options);\\n$result = file_get_contents($url, false, $context);\\n\\nvar_dump($result);\",\n \"language\": \"php\"\n },\n {\n \"code\": \"NSURL *url = [NSURL urlWithString::::at:::\\\"http://api.justyo.co/yo/\\\";\\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];\\n// Set request type\\nrequest.HTTPMethod = @\\\"POST\\\";\\n \\n// Set params to be sent to the server\\nNSString *params = @\\\"api_token=<token>&username=JOE\\\";\\n// Encoding type\\nNSData *data = [params dataUsingEncoding:NSUTF8StringEncoding];\\n// Add values and contenttype to the http header\\n[request addValue:@\\\"8bit\\\" forHTTPHeaderField:@\\\"Content-Transfer-Encoding\\\"];\\n[request addValue:@\\\"application/x-www-form-urlencoded\\\" forHTTPHeaderField:@\\\"Content-Type\\\"];\\n[request addValue:[NSString stringWithFormat:@\\\"%lu\\\", (unsigned long)[data length]] forHTTPHeaderField:@\\\"Content-Length\\\"];\\n[request setHTTPBody:data];\\n \\n// Send the request\\n[NSURLConnection connectionWithRequest:request delegate:self];\",\n \"language\": \"objectivec\"\n },\n {\n \"code\": \"String url = \\\"http://api.justyo.co/yo/\\\";\\nURL obj = new URL(url);\\nHttpsURLConnection con = (HttpsURLConnection) obj.openConnection();\\n\\ncon.setRequestMethod(\\\"POST\\\");\\n\\nString urlParameters = \\\"api_token=<token>&username=JOE\\\";\\n\\ncon.setDoOutput(true);\\nDataOutputStream wr = new DataOutputStream(con.getOutputStream());\\nwr.writeBytes(urlParameters);\\nwr.flush();\\nwr.close();\\n\\nint responseCode = con.getResponseCode();\\n\\nBufferedReader in = new BufferedReader(\\n new InputStreamReader(con.getInputStream()));\\nString inputLine;\\nStringBuffer response = new StringBuffer();\\n\\nwhile ((inputLine = in.readLine()) != null) {\\n\\tresponse.append(inputLine);\\n}\\nin.close();\",\n \"language\": \"java\"\n },\n {\n \"code\": \"var request = require('request');\\n\\nrequest.post(\\n 'http://api.justyo.co/yo/',\\n { form: { 'api_token': '<token>',\\n 'username': '<username>',\\n 'link': 'http://google.com' } },\\n function (error, response, body) {\\n if (!error && response.statusCode == 200) {\\n console.log(body);\\n }\\n }\\n);\",\n \"language\": \"javascript\"\n },\n {\n \"code\": \"API_TOKEN = <token>\\n# get api_token from https://dev.justyo.co\\nUSERNAME = JOE\\nwget --post-data 'api_token=$API_TOKEN&username=$USERNAME' https://api.justyo.co/yo/\",\n \"language\": \"shell\",\n \"name\": \"Bash\"\n },\n {\n \"code\": \"curl --data \\\"username=JOE&api_token=<your_api_token>\\\" http://api.justyo.co/yo/\",\n \"language\": \"curl\"\n },\n {\n \"code\": \"var http = new XMLHttpRequest();\\nvar url = \\\"http://api.justyo.co/yo/\\\";\\nvar params = \\\"api_token=<token>&username=JOE\\\";\\nhttp.open(\\\"POST\\\", url, true);\\n\\n//Send the proper header information along with the request\\nhttp.setRequestHeader(\\\"Content-type\\\", \\\"application/x-www-form-urlencoded\\\");\\nhttp.setRequestHeader(\\\"Content-length\\\", params.length);\\nhttp.setRequestHeader(\\\"Connection\\\", \\\"close\\\");\\n\\nhttp.onreadystatechange = function() {//Call a function when the state changes.\\n if(http.readyState == 4 && http.status == 200) {\\n alert(http.responseText);\\n }\\n}\\nhttp.send(params);\",\n \"language\": \"javascript\"\n }\n ]\n}\n[/block]\n\n[block:embed]\n{\n \"html\": false,\n \"url\": \"https://yo-dev-slackin.herokuapp.com/\",\n \"title\": \"Join Yo Developers Community on Slack!\",\n \"favicon\": \"https://slack.global.ssl.fastly.net/272a/img/icons/favicon-32.png\",\n \"iframe\": true,\n \"height\": \"1024px\"\n}\n[/block]","updates":["543eeda715d056080050277e"],"order":0,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"55b96122b42b610d00c9b2a3","editedParams2":true,"__v":0,"category":{"sync":{"isSync":false,"url":""},"pages":["55b96122b42b610d00c9b2a3","55b9ba07baf4cd2300bc5703","55badf181b0d663700781663","55bbeedfba60dd0d00a6300f","55bbf19bba60dd0d00a63018"],"title":"Getting Started","slug":"getting-started","order":0,"from_sync":false,"reference":false,"_id":"55b9611fb42b610d00c9b28e","createdAt":"2015-07-29T22:29:09.965Z","project":"54295508cd35120800fceca2","version":"55b9611eb42b610d00c9b28d","__v":5},"githubsync":"","version":{"version":"2.0","version_clean":"2.0.0","codename":"","is_stable":true,"is_beta":true,"is_hidden":false,"is_deprecated":false,"categories":["55b9611fb42b610d00c9b28e","55b9611fb42b610d00c9b28f","55b9611fb42b610d00c9b290","55b9611fb42b610d00c9b291","55b9611fb42b610d00c9b292","55b9611fb42b610d00c9b293","55bc25ee76754617002aa893","56ae7f53be2c040d00d5a09b","56ae7f7b0c1cab0d009f65d1"],"_id":"55b9611eb42b610d00c9b28d","__v":4,"createdAt":"2015-07-29T23:26:22.532Z","project":"54295508cd35120800fceca2","releaseDate":"2015-07-29T23:26:22.532Z"},"editedParams":true,"user":"542954f6cd35120800fceca0","createdAt":"2014-09-29T12:48:09.013Z","project":"54295508cd35120800fceca2"}