A Blitline job is an atomic unit of work on Blitline.

The only thing you can submit to Blitline is jobs.

Jobs consist of a chunk of JSON defining some operations you wish to perform.

A job consists of 4 primary elements:

  • application_id : Your Blitline application ID which you get when you sign up for Blitline
  • src : A image URL that will be the image you are performing your Blitline job on
  • functions : An array of operations (like crop, resize, etc) to be performed on this job.
  • v : Version number of API (current is 1.21)

📘

There are many more options for jobs, these are just the basic requirements.

Here is an example of job JSON you would submit to Blitline

{
    "application_id": "YOUR_APP_ID",
    "src": "http://cdn.blitline.com/filters/boys.jpeg",
    "v" : 1.20,
    "functions": [
        {
            "name": "resize_to_fit",
            "params": {
                "width": 100
            },
            "save": {
                "image_identifier": "MY_CLIENT_ID"
            }
        }
    ]
}

You can invoke this JSON by using a simple CURL call:

curl 'http://api.blitline.com/job' -d json='{ "application_id": "YOUR_APP_ID", "src" : "http://www.google.com/logos/2011/yokoyama11-hp.jpg", "v" : 1.20, "functions" : [ {"name": "blur", "params" : {"radius" : 0.0,  "sigma" : 2.0}, "save" : { "image_identifier" : "MY_CLIENT_ID" }} ]}'

📘

Try it out Online!

You can try out our online tool for running jobs!

http://www.blitline.com/docs/gist_runner




HOW DO I KNOW WHEN MY JOB IS COMPLETED?

When you submit a job to Blitline is is not instantly done. There is a delay between submission and when Blitline queues will process your job. Usually that is measured in milliseconds but there can be latency as with any asynchronous system.

There are two options for knowing when a job is completed, one is by polling and one is by Postback (webhook). You can read about those two options under Polling and Postbacks


What’s Next