{"__v":2,"_id":"55b9611fb42b610d00c9b295","category":{"__v":2,"_id":"55b9611fb42b610d00c9b290","pages":["55b9611fb42b610d00c9b294","55b9611fb42b610d00c9b295","55b9611fb42b610d00c9b296","55b9611fb42b610d00c9b297","55c523807f345917005ff8ad"],"project":"54295508cd35120800fceca2","version":"55b9611eb42b610d00c9b28d","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-07-29T22:28:54.673Z","from_sync":false,"order":2,"slug":"rest-api-oauth","title":"Rest API"},"editedParams":true,"editedParams2":true,"project":"54295508cd35120800fceca2","user":"542954f6cd35120800fceca0","version":{"__v":4,"_id":"55b9611eb42b610d00c9b28d","project":"54295508cd35120800fceca2","createdAt":"2015-07-29T23:26:22.532Z","releaseDate":"2015-07-29T23:26:22.532Z","categories":["55b9611fb42b610d00c9b28e","55b9611fb42b610d00c9b28f","55b9611fb42b610d00c9b290","55b9611fb42b610d00c9b291","55b9611fb42b610d00c9b292","55b9611fb42b610d00c9b293","55bc25ee76754617002aa893","56ae7f53be2c040d00d5a09b","56ae7f7b0c1cab0d009f65d1"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-07-29T22:33:29.114Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"code":"curl --data \"access_token=<access_token>&username=<username>\" http://api.justyo.co/yos/","language":"curl","name":null},{"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":"python"},{"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":"ruby"},{"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":"php"},{"code":"data = {\n\t\"username\": \"<username>\",\n  \"access_token: \"<access_token>\"\n}\n$http.post('https://api.justyo.co/yos/', data).success(successCallback);","language":"javascript"},{"code":"NSDictionary *jsonDict = :::at:::{\n\t@\"username\": @\"<username>\",\n\t@\"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"},{"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()","language":"swift"}]},"method":"post","results":{"codes":[]},"settings":"","auth":"required","params":[{"_id":"55b954b9e536930d00e360a0","ref":"","in":"body","required":true,"desc":"Target username","default":"","type":"string","name":"username"},{"_id":"55b954b9e536930d00e3609f","ref":"","in":"body","required":false,"desc":"Optional link attachment","default":"","type":"string","name":"link"},{"_id":"55b954b9e536930d00e3609e","ref":"","in":"body","required":false,"desc":"Optional location attachment in the format: \"lat;long\"","default":"","type":"string","name":"location"},{"_id":"55b954b9e536930d00e3609d","ref":"","in":"body","required":false,"desc":"Optional. See http://docs.justyo.co/docs/response-pairs","default":"","type":"string","name":"response_pair"},{"_id":"55c01938344dc40d00f557e1","ref":"","in":"body","required":false,"desc":"Optional. 30 chars max. will show in the notification.","default":"","type":"string","name":"text"},{"_id":"56a9716a2d8fd90d0036eecb","ref":"","in":"body","required":true,"desc":"Access token","default":"","type":"string","name":"access_token"}],"url":"/yos/"},"isReference":false,"order":2,"body":"","excerpt":"Send a Yo","slug":"yos-1","type":"endpoint","title":"/yos/"}

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 }}