{"__v":0,"_id":"55b96122b42b610d00c9b2a3","api":{"results":{"codes":[]},"settings":"","auth":"never","params":[{"_id":"542955e9ee5e3c0800157307","required":false,"desc":"","default":"","type":"string","name":"username","in":"body"}],"url":"/yo"},"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]","category":"55b9611fb42b610d00c9b28e","createdAt":"2014-09-29T12:48:09.013Z","editedParams":true,"editedParams2":true,"excerpt":"","githubsync":"","hidden":false,"link_external":false,"link_url":"","order":0,"project":"54295508cd35120800fceca2","slug":"getting-started","sync_unique":"","title":"What is Yo?","type":"basic","updates":["543eeda715d056080050277e"],"user":"542954f6cd35120800fceca0","version":"55b9611eb42b610d00c9b28d","childrenPages":[]}
Yo is the simplest notification platform. Some details about Yo: * 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. * Yo can be used between people, but with this simple API you can get notified about stuff that happens from computers as well. * A "Yo" is a simple push notification. * 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. cURL Example: ```curl --data "username=JOE&api_token=<your_api_token>" https://api.justyo.co/yo/``` To send yourself a Yo: 1. Download the app: https://justyo.co 2. Get your API token: https://dashboard.justyo.co 3. In terminal: ```curl --data "username=<your_username>&api_token=<your_api_token>" https://api.justyo.co/yo/``` [block:code] { "codes": [ { "code": "import requests\nrequests.post(\"http://api.justyo.co/yo/\", \n data={'api_token': api_token, 'username': 'JOHNAPPLESEED'})", "language": "python" }, { "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", "language": "ruby" }, { "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);", "language": "php" }, { "code": "NSURL *url = [NSURL urlWithString:@\"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];", "language": "objectivec" }, { "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();", "language": "java" }, { "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);", "language": "javascript" }, { "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/", "language": "shell", "name": "Bash" }, { "code": "curl --data \"username=JOE&api_token=<your_api_token>\" http://api.justyo.co/yo/", "language": "curl" }, { "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);", "language": "javascript" } ] } [/block] [block:embed] { "html": false, "url": "https://yo-dev-slackin.herokuapp.com/", "title": "Join Yo Developers Community on Slack!", "favicon": "https://slack.global.ssl.fastly.net/272a/img/icons/favicon-32.png", "iframe": true, "height": "1024px" } [/block]