Input id

This type of input allows you to use an input from a previous conversion again.

This is only possible if you are the creator of the job the input_id is taken from.

Advantages of using this input type:

  • You can avoid uploading a file twice
  • Our servers can avoid downloading a file a second time from the URL you supplied
    • This is especially useful for big files

Once you create a job and it is finished, you receive data similar to this:

{
    ... extra information ...
    "input": [
        {
            "id": "5e0aa023-2235-4e78-a0fc-3106b2689dd3",
            "type": "remote",
            "source": "http://cdn.online-convert.com/example-file/raster%20image/png/example_small.png",
            "filename": "example_small.png",
            "size": 333205,
            "hash": "144979874887251a2150c5485e294001",
            "checksum": "144979874887251a2150c5485e294001",
            "content_type": "image/png",
            "created_at": "2017-08-17T16:36:44",
            "modified_at": "2017-08-17T16:36:45",
            "parameters": []
        }
    ],
    ... extra information ...
}

Now, take the value of the id field. When creating your next job, add an input of type input_id and in the source field, specify the contents you retrieved from the previous input id field. Consider the following request:

POST /jobs HTTP/1.1
Host: api2.online-convert.com
x-oc-api-key: <your API key>
Content-Type: application/json
Cache-Control: no-cache

{
    "input": [{
        "type": "input_id",
        "source": "5e0aa023-2235-4e78-a0fc-3106b2689dd3"
    }],
    "conversion": [{
        "target": "png"
    }]
}
curl -X POST \
  https://api2.online-convert.com/jobs \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -H 'x-oc-api-key: <your API key>' \
  -d '{
    "input": [{
        "type": "input_id",
        "source": "5e0aa023-2235-4e78-a0fc-3106b2689dd3"
    }],
    "conversion": [{
        "target": "png"
    }]
}'

results matching ""

    No results matching ""