{"_id":"55297cdfa15e530d00af3d51","version":{"_id":"5435693035740020002a1c1f","__v":14,"project":"5435693035740020002a1c1c","createdAt":"2014-10-08T16:41:20.702Z","releaseDate":"2014-10-08T16:41:20.702Z","categories":["5435693035740020002a1c20","551c03c1ff892b3700d1c57a","551ca3927405910d00900a59","551cac6448564a2f0024d89e","551cb4d848564a2f0024d8a3","551cb52db7a32b3b00d1ef78","5526e2064a7ac121004c6073","5526e5147d4a4417009516b3","5526e9877d4a4417009516bb","5528362cd9e1db2d00cd924d","5580240ebe698419008f2ba2","5580a7dabe698419008f2db6","568161799de23c0d00c54750","5866c905a2cbb31900f6f1aa"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"githubsync":"","category":{"_id":"5435693035740020002a1c20","__v":5,"pages":["5435693035740020002a1c22","552917a3a15e530d00af3cac","55297cdfa15e530d00af3d51","558d812ebeb7c719007f62b0","568160e14047cf0d004121ba"],"project":"5435693035740020002a1c1c","version":"5435693035740020002a1c1f","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-10-08T16:41:20.738Z","from_sync":false,"order":0,"slug":"overview","title":"Overview"},"parentDoc":null,"project":"5435693035740020002a1c1c","user":"543569cd35740020002a1c2d","__v":5,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-04-11T19:58:23.453Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"No SDK for your language of choice? You can interact with our RESTful API with just about any HTTP library. We've provided cURL request examples alongside the JS SDK examples to make things easy.\n\n*We have SDK's for additional languages in the roadmap, and we'll update here as those launch.* \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Examples\"\n}\n[/block]\n### Java\nUsing the [OkHttp](https://github.com/square/okhttp) library from Square:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"private final OkHttpClient client = new OkHttpClient();\\n \\npublic void run () throw Exception {\\n  // prepare the request\\n  Request request = new Request.Builder()\\n    // Get space presence\\n    .url(\\\"https://api.robinpowered.com/v1.0/spaces/:id/presence\\\") \\n    // Include the Authorization header to let Robin know who you are\\n    .header(\\\"Authorization\\\", \\\"Access-Token [[app:Token]]\\\") \\n    .build();\\n  \\n  // perform the request\\n  client.newCall(request).enqueue(new Callback() {\\n    \\n    // this gets called when the response is received\\n    :::at:::Override \\n    public void onResponse(Response response) throws IOException {\\n      // Output the response\\n      System.out.println(response.body().string())\\n    }\\n  });\\n}\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]","excerpt":"How to integrate Robin's API without an SDK","slug":"making-http-requests","type":"basic","title":"Making HTTP Requests"}

Making HTTP Requests

How to integrate Robin's API without an SDK

No SDK for your language of choice? You can interact with our RESTful API with just about any HTTP library. We've provided cURL request examples alongside the JS SDK examples to make things easy. *We have SDK's for additional languages in the roadmap, and we'll update here as those launch.* [block:api-header] { "type": "basic", "title": "Examples" } [/block] ### Java Using the [OkHttp](https://github.com/square/okhttp) library from Square: [block:code] { "codes": [ { "code": "private final OkHttpClient client = new OkHttpClient();\n \npublic void run () throw Exception {\n // prepare the request\n Request request = new Request.Builder()\n // Get space presence\n .url(\"https://api.robinpowered.com/v1.0/spaces/:id/presence\") \n // Include the Authorization header to let Robin know who you are\n .header(\"Authorization\", \"Access-Token [[app:Token]]\") \n .build();\n \n // perform the request\n client.newCall(request).enqueue(new Callback() {\n \n // this gets called when the response is received\n @Override \n public void onResponse(Response response) throws IOException {\n // Output the response\n System.out.println(response.body().string())\n }\n });\n}", "language": "java" } ] } [/block]