Base64

To send a base64 input, the following is required:

  • Send a job without any input files
  • Retrieve the server and id keys from the response
  • Concatenate the server value with /upload-base64/ and the id value

The resulting string looks like this:

https://www13.online-convert.com/dl/web2/upload-base64/a6f691e2-839e-49e5-829d-dc2d97486fe1

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

{
    "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 here>' \
  -d '{
    "conversion": [{
        "target": "png"
    }]
}'

After generating the URL, do a POST request to it.

The form has to contain the following fields:

  • content: The base64 encoded data
  • filename: This parameter is optional. If not specified, the file will be named "output".

Once the base64 data is sent, the job will continue its lifecycle, start processing the conversion and eventually finish.

POST /dl/web2/upload-base64/a6f691e2-839e-49e5-829d-dc2d97486fe1 HTTP/1.1
Host: www13.online-convert.com
x-oc-api-key: <your API key here>
Content-Type: application/json
Cache-Control: no-cache

{
  "content": "data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=",
  "filename": "black-pixel"
}
curl -X POST \
  https://www13.online-convert.com/dl/web2/upload-base64/a6f691e2-839e-49e5-829d-dc2d97486fe1 \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -H 'x-oc-api-key: <your API key here>' \
  -d '{
  "content": "data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=",
  "filename": "black-pixel"
}'

results matching ""

    No results matching ""