{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/yos/","auth":"required","results":{"codes":[]},"settings":"","examples":{"codes":[{"name":null,"language":"curl","code":"curl --data \"access_token=<access_token>&username=<username>\" http://api.justyo.co/yos/"},{"language":"python","code":"import requests\nrequests.post(\"http://api.justyo.co/yos/\", \n              data={\n    \t\t\t\t\t\t\t'access_token': <access_token>,\n    \t\t\t\t\t\t\t'username': '<username>'\n  \t\t\t\t\t\t}\n)"},{"language":"ruby","code":"require 'net/http'\nrequire 'uri'\nrequire 'json'\n\nuri = URI.parse(\"https://api.justyo.co/yos\")\n\nheader = {'Content-Type': 'text/json'}\npayload = {\n  username: '<username>',\n  access_token: '<access_token>'\n  }\n\n# Create the HTTP objects\nhttp = Net::HTTP.new(uri.host, uri.port)\nrequest = Net::HTTP::Post.new(uri.request_uri, header)\nrequest.body = payload.to_json\n\n# Send the request\nresponse = http.request(request)"},{"language":"php","code":"$data = array(\n    'username'       => 'username',\n    'access_token' => <access_token>\n);\n\n$options = array(\n  'http' => array(\n    'method'  => 'POST',\n    'content' => json_encode( $data ),\n    'header'=>  \"Content-Type: application/json\\r\\n\" .\n                \"Accept: application/json\\r\\n\"\n    )\n);\n\n$context  = stream_context_create( $options );\n$result = file_get_contents( $url, false, $context );\n$response = json_decode( $result );"},{"language":"javascript","code":"data = {\n\t\"username\": \"<username>\",\n  \"access_token: \"<access_token>\"\n}\n$http.post('https://api.justyo.co/yos/', data).success(successCallback);"},{"code":"NSDictionary *jsonDict = :::at:::{\n\[email protected]\"username\": @\"<username>\",\n\[email protected]\"access_token\": @\"<access_token>\"\n}\n\nNSString *jsonRequest = [jsonDict JSONRepresentation];\nNSURL *url = [NSURL URLWithString:@\"https://api.justyo.co\"];\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url\n             cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0];\nNSData *requestData = [jsonRequest dataUsingEncoding:NSUTF8StringEncoding];\n[request setHTTPMethod:@\"POST\"];\n[request setValue:@\"application/json\" forHTTPHeaderField:@\"Accept\"];\n[request setValue:@\"application/json\" forHTTPHeaderField:@\"Content-Type\"];\n[request setValue:[NSString stringWithFormat:@\"%d\", [requestData length]] forHTTPHeaderField:@\"Content-Length\"];\n[request setHTTPBody: requestData];\n\nNSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];\n","language":"objectivec"},{"language":"swift","code":"\nlet json = [ \"username\":\"<username>\" , \"access_token\": \"<access_token>\" ]\nlet jsonData = NSJSONSerialization.dataWithJSONObject(json, options: .PrettyPrinted, error: nil)\n\n// create post request\nlet url = NSURL(string: \"https://api.justyo.co/status/\")!\nlet request = NSMutableURLRequest(URL: url)\nrequest.HTTPMethod = \"POST\"\n\n// insert json data to the request\nrequest.HTTPBody = jsonData\n\nlet task = NSURLSession.sharedSession().dataTaskWithRequest(request){ data,response,error in\n    if error != nil{\n        println(error.localizedDescription)\n        return\n    }\n    if let responseJSON = NSJSONSerialization.JSONObjectWithData(data, options: nil, error: nil) as? [String:AnyObject]{\n        println(responseJSON)\n    }\n}\n\ntask.resume()"}]},"method":"post","params":[{"name":"username","type":"string","default":"","desc":"Target username","required":true,"in":"body","ref":"","_id":"55b954b9e536930d00e360a0"},{"name":"link","type":"string","default":"","desc":"Optional link attachment","required":false,"in":"body","ref":"","_id":"55b954b9e536930d00e3609f"},{"name":"location","type":"string","default":"","desc":"Optional location attachment in the format: \"lat;long\"","required":false,"in":"body","ref":"","_id":"55b954b9e536930d00e3609e"},{"name":"response_pair","type":"string","default":"","desc":"Optional. See http://docs.justyo.co/docs/response-pairs","required":false,"in":"body","ref":"","_id":"55b954b9e536930d00e3609d"},{"name":"text","type":"string","default":"","desc":"Optional. 30 chars max. will show in the notification.","required":false,"in":"body","ref":"","_id":"55c01938344dc40d00f557e1"},{"name":"access_token","type":"string","default":"","desc":"Access token","required":true,"in":"body","ref":"","_id":"56a9716a2d8fd90d0036eecb"}]},"next":{"description":"","pages":[]},"title":"/yos/","type":"endpoint","slug":"yos-1","excerpt":"Send a Yo","body":"","updates":[],"order":2,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"55b9611fb42b610d00c9b295","createdAt":"2015-07-29T22:33:29.114Z","editedParams2":true,"githubsync":"","category":{"sync":{"isSync":false,"url":""},"pages":["55b9611fb42b610d00c9b294","55b9611fb42b610d00c9b295","55b9611fb42b610d00c9b296","55b9611fb42b610d00c9b297","55c523807f345917005ff8ad"],"title":"Rest API","slug":"rest-api-oauth","order":2,"from_sync":false,"reference":false,"_id":"55b9611fb42b610d00c9b290","__v":2,"createdAt":"2015-07-29T22:28:54.673Z","project":"54295508cd35120800fceca2","version":"55b9611eb42b610d00c9b28d"},"project":"54295508cd35120800fceca2","user":"542954f6cd35120800fceca0","editedParams":true,"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"},"__v":2}

post/yos/

Send a Yo

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

username:
required
string
Target username
link:
string
Optional link attachment
location:
string
Optional location attachment in the format: "lat;long"
response_pair:
string
Optional. See http://docs.justyo.co/docs/response-pairs
text:
string
Optional. 30 chars max. will show in the notification.
access_token:
required
string
Access token

Examples


User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}