API Reference

Java Client Library

Fork

Install

Get the code on Github.

Submitting the job

Use the API Request Builder to generate a config file that match your specific workflow.

Example of coconut.conf:

var s3 = s3://accesskey:secretkey@mybucket

set source  = http://yoursite.com/media/video.mp4
set webhook = http://mysite.com/webhook/coconut

-> mp4  = $s3/videos/video.mp4
-> webm = $s3/videos/video.webm
-> jpg:300x = $s3/previews/thumbs_#num#.jpg, number=3

Here is the java code to submit the config file:

import co.coconut.api.CoconutAPI;
import co.coconut.api.CoconutException;
import co.coconut.api.CoconutObject;

public class App {
  public static void main(String[] args) throws CoconutException {
    try {
      String config = "set source = https://s3-eu-west-1.amazonaws.com/media.coconut.com/test.mp4\n"
          + "-> mp4 = s3://a:s@bucket/video.mp4\n";

      CoconutObject job = CoconutAPI.submit(config, "api-key");
      System.out.println("Job: " + job.get("id"));

    } catch(CoconutException e) {
      System.out.println("Error " + e.getMessage());
    }
  }
}

Note that you can use the environment variable COCONUT_API_KEY to set your API key.

Released under the Apache license.