How to Close a Task in Runrun.it

Java

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;

public final class RunrunitSample {

  public static void main(final String[] args) {
    final Client client = ClientBuilder.newClient();

    client.target("https://secure.runrun.it/api/v1.0/tasks/sampleTask/close").request().header("App-Key", ...).header("User-Token", ...).post(Entity.json(""));
    
    client.close();
  }

}

Go

package runrunitsample

import "gopkg.in/resty.v1"

func main() {
  resty.R().SetHeader("Content-Type", "application/json").SetHeader("App-Key", ...).SetHeader("User-Token", ...).Post("https://secure.runrun.it/api/v1.0/tasks/sampleTask/close")
}

Node.js

const https = require('https');

const req = https.post({ headers: { 'app-key': ..., 'user-token': ... }, hostname: 'secure.runrun.it', method: 'POST', path: '/api/v1.0/tasks/sampleTask/close' });

req.end();

Python

import requests

requests.post('https://secure.runrun.it/api/v1.0/tasks/sampleTask/close', headers = { 'App-Key': ..., 'User-Token': ... })

Ruby

require 'rest-client'

RestClient.post 'https://secure.runrun.it/api/v1.0/tasks/sampleTask/close', :app_key => ..., :user_token => ...
Advertisements

How to Pause a Task in Runrun.it

Java

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;

public final class RunrunitSample {

  public static void main(final String[] args) {
    final Client client = ClientBuilder.newClient();

    client.target("https://secure.runrun.it/api/v1.0/tasks/sampleTask/pause").request().header("App-Key", ...).header("User-Token", ...).post(Entity.json(""));
    
    client.close();
  }

}

Go

package runrunitsample

import "gopkg.in/resty.v1"

func main() {
  resty.R().SetHeader("Content-Type", "application/json").SetHeader("App-Key", ...).SetHeader("User-Token", ...).Post("https://secure.runrun.it/api/v1.0/tasks/sampleTask/pause")
}

Node.js

const https = require('https');

const req = https.post({ headers: { 'app-key': ..., 'user-token': ... }, hostname: 'secure.runrun.it', method: 'POST', path: '/api/v1.0/tasks/sampleTask/pause' });

req.end();

Python

import requests

requests.post('https://secure.runrun.it/api/v1.0/tasks/sampleTask/pause', headers = { 'App-Key': ..., 'User-Token': ... })

Ruby

require 'rest-client'

RestClient.post 'https://secure.runrun.it/api/v1.0/tasks/sampleTask/pause', :app_key => ..., :user_token => ...

How to Play a Task in Runrun.it

Java

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;

public final class RunrunitSample {

  public static void main(final String[] args) {
    final Client client = ClientBuilder.newClient();

    client.target("https://secure.runrun.it/api/v1.0/tasks/sampleTask/play").request().header("App-Key", ...).header("User-Token", ...).post(Entity.json(""));
    
    client.close();
  }

}

Go

package runrunitsample

import "gopkg.in/resty.v1"

func main() {
  resty.R().SetHeader("Content-Type", "application/json").SetHeader("App-Key", ...).SetHeader("User-Token", ...).Post("https://secure.runrun.it/api/v1.0/tasks/sampleTask/play")
}

Node.js

const https = require('https');

const req = https.post({ headers: { 'app-key': ..., 'user-token': ... }, hostname: 'secure.runrun.it', method: 'POST', path: '/api/v1.0/tasks/sampleTask/play' });

req.end();

Python

import requests

requests.post('https://secure.runrun.it/api/v1.0/tasks/sampleTask/play', headers = { 'App-Key': ..., 'User-Token': ... })

Ruby

require 'rest-client'

RestClient.post 'https://secure.runrun.it/api/v1.0/tasks/sampleTask/play', :app_key => ..., :user_token => ...

How to Retrieve a Task in Runrun.it

Java

import static java.lang.System.out;

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.core.Response;

public final class RunrunitSample {

  public static void main(final String[] args) {
    final Client client = ClientBuilder.newClient();

    final Response res = client.target("https://secure.runrun.it/api/v1.0/tasks/sampleTask").request().header("App-Key", ...).header("User-Token", ...).get();

    if (res.getStatus() == 200)
      out.println(res.readEntity(String.class));

    client.close();
  }

}

Go

package runrunitsample

import "gopkg.in/resty.v1"

import "fmt"

func main() {
  res, _ := resty.R().SetHeader("App-Key", ...).SetHeader("User-Token", ...).Get("https://secure.runrun.it/api/v1.0/tasks/sampleTask")

  if res.StatusCode() == 200 {
    fmt.Printf("%v\n", res)
  }

}

Node.js

const https = require('https');

const req = https.get({ headers: { 'app-key': ..., 'user-token': ... }, hostname: 'secure.runrun.it', path: '/api/v1.0/tasks/sampleTask' }, (res) => {

  if (res.statusCode === 200) {
    var body = '';
 
    res.on('data', (chunk) => {
      body += chunk.toString();
    });
 
    res.on('end', () => {
      console.log(body);
    });
 
  }

});

req.end();

Python

import requests

res = requests.post('https://secure.runrun.it/api/v1.0/tasks/sampleTask', headers = { 'App-Key': ..., 'User-Token': ... })

if res.ok:
  print res.text

Ruby

require 'rest-client'

Res = RestClient.get 'https://secure.runrun.it/api/v1.0/tasks/sampleTask', :app_key => ..., :user_token => ...

if Res.code == 200
  puts Res.body
end

How to List Tasks in Runrun.it

Java

import static java.lang.System.out;

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.core.Response;

public final class RunrunitSample {

  public static void main(final String[] args) {
    final Client client = ClientBuilder.newClient();

    final Response res = client.target("https://secure.runrun.it/api/v1.0/tasks").request().header("App-Key", ...).header("User-Token", ...).get();

    if (res.getStatus() == 200)
      out.println(res.readEntity(String.class));

    client.close();
  }

}

Go

package runrunitsample

import "gopkg.in/resty.v1"

import "fmt"

func main() {
  res, _ := resty.R().SetHeader("App-Key", ...).SetHeader("User-Token", ...).Get("https://secure.runrun.it/api/v1.0/tasks")

  if res.StatusCode() == 200 {
    fmt.Printf("%v\n", res)
  }

}

Node.js

const https = require('https');

const req = https.get({ headers: { 'app-key': ..., 'user-token': ... }, hostname: 'secure.runrun.it', path: '/api/v1.0/tasks' }, (res) => {

  if (res.statusCode === 200) {
    var body = '';
 
    res.on('data', (chunk) => {
      body += chunk.toString();
    });
 
    res.on('end', () => {
      console.log(body);
    });
 
  }

});

req.end();

Python

import requests

res = requests.get('https://secure.runrun.it/api/v1.0/tasks', headers = { 'App-Key': ..., 'User-Token': ... }, )

if res.ok:
  print res.text

Ruby

require 'rest-client'

Res = RestClient.get 'https://secure.runrun.it/api/v1.0/tasks', :app_key => ..., :user_token => ...

if Res.code == 200
  puts Res.body
end

How to Create a Task in Runrun.it

Java

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;

public final class RunrunitSample {

  public static void main(final String[] args) {
    final Client client = ClientBuilder.newClient();

    client.target("https://secure.runrun.it/api/v1.0/tasks").request().header("App-Key", ...).header("User-Token", ...).post(Entity.json("{ \"task\": { \"project_id\": sampleProject, \"responsible_id\": \"sampleUser\", \"title\": \"SampleTask\", \"type_id\": sampleType } }"));

    client.close();
  }

}

Go

package runrunitsample

import "gopkg.in/resty.v1"

func main() {
  resty.R().SetHeader("Content-Type", "application/json").SetHeader("App-Key", ...).SetHeader("User-Token", ...).SetBody(`{ "task": { "project_id": sampleProject, "responsible_id": "sampleUser", "title": "SampleTask", "type_id": sampleType } }`).Post("https://secure.runrun.it/api/v1.0/tasks")
}

Node.js

const https = require('https');

const req = https.request({ headers: { 'content-type': 'application/json', 'content-length': ..., 'app-key': ..., 'user-token': ... }, hostname: 'secure.runrun.it', method: 'POST', path: '/api/v1.0/tasks' });

req.write('{ "task": { "project_id": sampleProject, "responsible_id": sampleUser, "title": "SampleTask", "type_id": sampleType } }');

req.end();

Python

import requests

requests.post('https://secure.runrun.it/api/v1.0/tasks', headers = { 'App-Key': ..., 'User-Token': ... }, json = { 'task': { 'project_id': sampleProject, 'responsible_id': sampleUser, 'title': 'SampleTask', 'type_id': sampleType } })

Ruby

require 'rest-client'

RestClient.post 'https://secure.runrun.it/api/v1.0/tasks', { task: { project_id: sampleProject, responsible_id: sampleUser, title: 'SampleTask', type_id: sampleType } }, :app_key => ..., :user_token => ...

How to Update a Project in Runrun.it

Java

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;

public final class RunrunitSample {

  public static void main(final String[] args) {
    final Client client = ClientBuilder.newClient();

    client.target("https://secure.runrun.it/api/v1.0/projects/sampleProject").request().header("App-Key", ...).header("User-Token", ...).put(Entity.json("{ \"project\": { \"name\": \"SampleProject2\" } }"));

    client.close();
  }

}

Go

package runrunitsample

import "gopkg.in/resty.v1"

func main() {
  resty.R().SetHeader("Content-Type", "application/json").SetHeader("App-Key", ...).SetHeader("User-Token", ...).SetBody(`{ "project": { "name": "SampleProject2" }`).Put("https://secure.runrun.it/api/v1.0/projects/sampleProject")
}

Node.js

const https = require('https');

const req = https.request({ headers: { 'content-type': 'application/json', 'content-length': ..., 'app-key': ..., 'user-token': ... }, hostname: 'secure.runrun.it', method: 'PUT', path: '/api/v1.0/projects/sampleProject' });

req.write('{ "project": { "name": "SampleProject2" } }');

req.end();

Python

import requests

requests.put('https://secure.runrun.it/api/v1.0/projects/sampleProject', headers = { 'App-Key': ..., 'User-Token': ..., json = { 'project': { 'name': 'SampleProject2' } } })

Ruby

require 'rest-client'

RestClient.put 'https://secure.runrun.it/api/v1.0/projects/sampleProject', { project: { name: 'SampleProject2' } }, :app_key => ..., :user_token => ...

How to Retrieve a Project in Runrun.it

Java

import static java.lang.System.out;

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.core.Response;

public final class RunrunitSample {

  public static void main(final String[] args) {
    final Client client = ClientBuilder.newClient();

    final Response res = client.target("https://secure.runrun.it/api/v1.0/projects/sampleProject").request().header("App-Key", ...).header("User-Token", ...).get();

    if (res.getStatus() == 200)
      out.println(res.readEntity(String.class));

    client.close();
  }

}

Go

package runrunitsample

import "gopkg.in/resty.v1"

import "fmt"

func main() {
  res, _ := resty.R().SetHeader("App-Key", ...).SetHeader("User-Token", ...).Get("https://secure.runrun.it/api/v1.0/projects/sampleProject")

  if res.StatusCode() == 200 {
    fmt.Printf("%v\n", res)
  }

}

Node.js

const https = require('https');

const req = https.get({ headers: { 'app-key': ..., 'user-token': ... }, hostname: 'secure.runrun.it', path: '/api/v1.0/projects/sampleProject' }, (res) => {

  if (res.statusCode === 200) {
    var body = '';
 
    res.on('data', (chunk) => {
      body += chunk.toString();
    });
 
    res.on('end', () => {
      console.log(body);
    });
 
  }

});

req.end();

Python

import requests

res = requests.get('https://secure.runrun.it/api/v1.0/projects/sampleProject', headers = { 'App-Key': ..., 'User-Token': ... })

if res.ok:
  print res.text

Ruby

require 'rest-client'

Res = RestClient.get 'https://secure.runrun.it/api/v1.0/projects/sampleProject', :app_key => ..., :user_token => ...

if Res.code == 200
  puts Res.body
end

How to List Projects in Runrun.it

Java

import static java.lang.System.out;

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.core.Response;

public final class RunrunitSample {

  public static void main(final String[] args) {
    final Client client = ClientBuilder.newClient();

    final Response res = client.target("https://secure.runrun.it/api/v1.0/projects").request().header("App-Key", ...).header("User-Token", ...).get();

    if (res.getStatus() == 200)
      out.println(res.readEntity(String.class));

    client.close();
  }

}

Go

package runrunitsample

import "gopkg.in/resty.v1"

import "fmt"

func main() {
  res, _ := resty.R().SetHeader("App-Key", ...).SetHeader("User-Token", ...).Get("https://secure.runrun.it/api/v1.0/projects")

  if res.StatusCode() == 200 {
    fmt.Printf("%v\n", res)
  }

}

Node.js

const https = require('https');

const req = https.get({ headers: { 'app-key': ..., 'user-token': ... }, hostname: 'secure.runrun.it', path: '/api/v1.0/projects' }, (res) => {

  if (res.statusCode === 200) {
    var body = '';
 
    res.on('data', (chunk) => {
      body += chunk.toString();
    });
 
    res.on('end', () => {
      console.log(body);
    });
 
  }

});

req.end();

Python

import requests
 
res = requests.get('https://secure.runrun.it/api/v1.0/projects', headers = { 'App-Key': ..., 'User-Token': ... })

if res.ok:
  print res.text

Ruby

require 'rest-client'

Res = RestClient.get 'https://secure.runrun.it/api/v1.0/projects', :app_key => ..., :user_token => ...

if Res.code == 200
  puts Res.body
end

How to Create a Project in Runrun.it

Java

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;

public final class RunrunitSample {

  public static void main(final String[] args) {
    final Client client = ClientBuilder.newClient();

    client.target("https://secure.runrun.it/api/v1.0/projects").request().header("App-Key", ...).header("User-Token", ...).post(Entity.json("{ \"project\": { \"name\": \"SampleProject\", \"client_id\": sampleClient } }"));

    client.close();
  }

}

Go

package runrunitsample

import "gopkg.in/resty.v1"

func main() {
  resty.R().SetHeader("Content-Type", "application/json").SetHeader("App-Key", ...).SetHeader("User-Token", ...).SetBody(`{ "project": { "name": "SampleProject", "client_id": sampleClient } }`).Post("https://secure.runrun.it/api/v1.0/projects")
}

Node.js

const https = require('https');

const req = https.request({ headers: { 'content-type': 'application/json', 'content-length': ..., 'app-key': ..., 'user-token': ... }, hostname: 'secure.runrun.it', method: 'POST', path: '/api/v1.0/projects' });

req.write('{ "project": { "name": "SampleProject", "client_id": sampleClient } }');

req.end();

Python

import requests

requests.post('https://secure.runrun.it/api/v1.0/projects', headers = { 'App-Key': ..., 'User-Token': ... }, json = { 'project': { 'name': 'SampleProject', 'client_id': sampleClient } })

Ruby

require 'rest-client'

RestClient.post 'https://secure.runrun.it/api/v1.0/projects', { project: { name: 'SampleProject', client_id: sampleClient} }, :app_key => ..., :user_token => ...