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.

Examples

Java

Using the OkHttp library from Square:

private final OkHttpClient client = new OkHttpClient();
 
public void run () throw Exception {
  // prepare the request
  Request request = new Request.Builder()
    // Get space presence
    .url("https://api.robinpowered.com/v1.0/spaces/:id/presence") 
    // Include the Authorization header to let Robin know who you are
    .header("Authorization", "Access-Token [[app:Token]]") 
    .build();
  
  // perform the request
  client.newCall(request).enqueue(new Callback() {
    
    // this gets called when the response is received
    @Override 
    public void onResponse(Response response) throws IOException {
      // Output the response
      System.out.println(response.body().string())
    }
  });
}