Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
Welcome to FreeConvert.com API V1! On this documentation you will find how to send API requests to convert, merge, or optimize your files using FreeConvert.com.
Our API uses API keys to authenticate requests. You can view and manage your API keys in the User Dashboard.
Your API keys can be used to consume your account credits, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.
All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests to protected routes without authentication will also fail.
This guide leads you through a typical implementation of the FreeConvert API. It contains creating a task, job and handling the result. For more in depth documentation please use the menu on the left to directly jump to specific api endpoints. Please refer to API code examples for more use cases.
Terminology
Tasks
Tasks are individual activities you can perform in FreeConvert.
Import Tasks
Import tasks are used to upload files into FreeConvert for using them later in other tasks. Example: Downloading files from device, URL or a S3 bucket. FreeConvert stores the imported files only for 4 hours. See Import Files from left menu to find different ways to import files into FreeConvert.
Processing Tasks
Processing tasks are used to perform file transformation activities in FreeConvert. Processing tasks subjects the files imported by Import tasks into modification according to the type of the processing task. See Convert, Compress and Merge operations from left menu to find more info.
Export Tasks
Export tasks are used to export one or multiple output files from FreeConvert, for example by generating public URLs or by storing them on your S3 bucket. See Export Files from left menu to find different ways to export files from FreeConvert.
Jobs
Job is a collection of tasks. A job can have import tasks, processing tasks and export tasks defining a workflow that FreeConvert should follow. For example, The first task of a job could be importing the file from your device. The second task could be converting this file into a different format and the final task of the job could be exporting the file to a S3 bucket or exporting the download URL.
It's also possible to have multiple processing tasks and multiple export tasks within a single job. This is useful if you want to convert a file and create a thumbnail at the same time, for example.
We can convert a file using a Job in which we define all the tasks that the Job is comprised of. Or we can execute individual tasks step by step. Following sections explain how to execute individual tasks before explaining how to submit a Job containing multiple tasks.
Import File - From device
Import / Upload
# You can also use wget
curl -X POST https://api.freeconvert.com/v1/process/import/upload \-H'Content-Type: application/json'\-H'Accept: application/json'\-H'Authorization: Bearer {access_token}'
<?phprequire'vendor/autoload.php';$headers=array('Content-Type'=>'application/json','Accept'=>'application/json','Authorization'=>'Bearer '$access_token,);$client=new\GuzzleHttp\Client();try{$response=$client->request('POST','https://api.freeconvert.com/v1/process/import/upload',array('headers'=>$headers,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
# You can also use wget# URL will be dynamic and will differ from task to task
curl -L"https://server100.freeconvert.com/api/upload/625e27e075ae740013481967/"\-F"signature=503808ac1738adbd"\-F"file=@/path/to/file.ext"\
# URL will be dynamic and will differ from task to task
POSThttps://server100.freeconvert.com/api/upload/625e27e075ae740013481967HTTP/1.1Host:server301.freeconvert.comContent-Type:multipart/form-data;boundary="boundary"
# value1
--boundary
Content-Disposition: form-data; name="file"; filename="example.mp3"
Content-Type: audio/mpeg
# value2
--boundary
Content-Disposition: form-data; name="signature" signature_value
constformData=newFormData();for(constparameterintask.result.form.parameters){formData.append(parameter,task.result.form.parameters[parameter]);}formData.append("file",/*file stream or blob*/);fetch(task.result.form.url,{method:"POST",body:formData,headers:{"Content-Type":"multipart/form-data"}}).then(function(res){returnres.json();}).then(function(body){console.log(body);});
importrequestspayload={'signature':'9c5db43ce428c4c4'}files=[('file',(file_name,open(file_path,'rb'),'audio/mpeg'))]headers={'Authorization':'Bearer'+access_token}# URL will be dynamic and will differ from task to task
result=requests.request('POST',task.result.form.url,headers=headers,data=payload,files=files)print(result.json())
<?php$client=newClient();$headers=['Authorization'=>'Bearer '$access_token];$options=['multipart'=>[['name'=>'file','contents'=>Utils::tryFopen($file_path,'r'),'filename'=>$file_name,'headers'=>['Content-Type'=>'<Content-type header>']],['name'=>'signature','contents'=>'9c5db43ce428c4c4']]];try{$request=newRequest('POST',$task->result->form->url,$headers);$response=$client->sendAsync($request,$options)->wait();print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
If you want to upload a file from your device storage, you have to use the import/upload API endpoint. This is a two-step process.
The first request will provide you a response which contains details about uploading the actual file from your device. The response contains the url that the file must be uploaded to and other paramaters that should be submitted.
The second request is to actually upload the file using the information we got from the first request. Please see API code examples for more examples of this.
Import File - From URL
Import / URL
# You can also use wget
curl -X POST https://api.freeconvert.com/v1/process/import/url \-H'Content-Type: application/json'\-H'Accept: application/json'\-H'Authorization: Bearer {access_token}'# Body Parameter{"url": "https://example.com/some.jpg",
"filename": "some.jpg", # optional}
<?phprequire'vendor/autoload.php';$headers=array('Content-Type'=>'application/json','Accept'=>'application/json','Authorization'=>'Bearer '$access_token,);$client=new\GuzzleHttp\Client();$request_body=array('url'=>"https://example.com/some.jpg",'filename'=>"some.jpg",# optional)try{$response=$client->request('POST','https://api.freeconvert.com/v1/process/import/url',array('headers'=>$headers,'content'=>json_encode($request_body),));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
If uploading a file directly from a URL, it will take only one step. FreeConvert will fetch the file from the URL you have specified in the url field.
We have a bunch of other options available for importing files into FreeConvert.
Convert File
Convert Task
# You can also use wget
curl -X POST https://api.freeconvert.com/v1/process/convert \-H'Content-Type: application/json'\-H'Accept: application/json'\-H'Authorization: Bearer {access_token}'# Body Parameter{"input": "import_task_id",
"input_format": "jpg",
"output_format": "png",
"options": {# …advanced options…},
}
<?phprequire'vendor/autoload.php';$headers=array('Content-Type'=>'application/json','Accept'=>'application/json','Authorization'=>'Bearer '$access_token,);$client=new\GuzzleHttp\Client();$request_body=array('input'=>import_task_id,'input_format'=>'jpg','output_format'=>'png','options'=>{// …advanced options…},)try{$response=$client->request('POST','https://api.freeconvert.com/v1/process/convert',array('headers'=>$headers,'content'=>json_encode($request_body),));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
In this example, we convert an imported file from jpg to png. We must provide the import task id as the input so FreeConvert will use that imported file for the conversion.
You can get the possible conversion formats for an operation from the following API endpoint: GET /query/view/options
See Tasks > List Operations from the left menu to find the parameters and the use of this endpoint.
Most of our file conversions have advanced options that let you control the output file. You'll get the possible advanced options for a specific input and output combination including the hints.
Compress File
Compress Task
# You can also use wget
curl -X POST https://api.freeconvert.com/v1/process/compress \-H'Content-Type: application/json'\-H'Accept: application/json'\-H'Authorization: Bearer {access_token}'# Body Parameter{"input": "import_task_id",
"input_format": "jpg",
"options": {# …advanced options…},
}
<?phprequire'vendor/autoload.php';$headers=array('Content-Type'=>'application/json','Accept'=>'application/json','Authorization'=>'Bearer '$access_token,);$client=new\GuzzleHttp\Client();$request_body=array('input'=>import_task_id,'input_format'=>'jpg','options'=>{// …advanced options…},)try{$response=$client->request('POST','https://api.freeconvert.com/v1/process/compress',array('headers'=>$headers,'content'=>json_encode($request_body),));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
In this example, we are going to compress an imported jpg file. We must provide the import task id as the input so FreeConvert will use that imported file for the compression.
Depending on the input file format, we have different kinds of compression options, which is a part of our advanced options that let you control the output file. You'll get the possible advanced options for a specific input and output combination including the hints.
Merge File
Merge Task
# You can also use wget
curl -X POST https://api.freeconvert.com/v1/process/merge \-H'Content-Type: application/json'\-H'Accept: application/json'\-H'Authorization: Bearer {access_token}'# Body Parameter{"input": ["task_id_1",
"task_id_2"],
"output_format": "pdf",
"filename": "some.pdf", # optional"options": {# …advanced options…},
}
We are going to merge two (or as many as you want) imported or converted image files (jpg, png, etc...) into a single PDF or GIF file. We must provide the task ids as the input so FreeConvert will use those files for the merge task.
You can use this merge task according to your needs.
For example, say you have several files and the only requirement is to merge those into a single PDF or GIF. In this case, all you need to do is just upload or import those files into FreeConvert and then start the merge task by including the import task ids from the previous step.
If you also need to decrease the size of your input files before merging them, then you have to perform one more step which is the compress task before starting the merge task.
In summary, all the tasks in FreeConvert are independent from each other, you can decide the flow and order of tasks as you want.
FreeConvert also supports a few advanced options while merging files, right now we only allow merging images and pdf files.
Export File - From URL
Export Task
# You can also use wget
curl -X POST https://api.freeconvert.com/v1/process/export/url \-H'Content-Type: application/json'\-H'Accept: application/json'\-H'Authorization: Bearer {access_token}'# Body Parameter{"input": ["import_task_id_1",
"import_task_id_2"],
"filename": "some.zip", # optional"archive_multiple_files": true}
<?phprequire'vendor/autoload.php';$headers=array('Content-Type'=>'application/json','Accept'=>'application/json','Authorization'=>'Bearer '$access_token,);$client=new\GuzzleHttp\Client();$request_body=array('input'=>array(import_task_id_1,import_task_id_2),'filename'=>'some.zip',# optional'archive_multiple_files'=>true,)try{$response=$client->request('POST','https://api.freeconvert.com/v1/process/export/url',array('headers'=>$headers,'content'=>json_encode($request_body),));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
Like import files, we have several ways to export a file from FreeConvert. Here, we're going to use export/url in order to retrieve a download link to the converted file.
We have a bunch of other options available for exporting files into FreeConvert.
# You can also use wget
curl -X POST https://api.freeconvert.com/v1/process/jobs \-H'Content-Type: application/json'\-H'Accept: application/json'\-H'Authorization: Bearer {access_token}'# Body Parameter{
...
# follow the sample job definition above}
inputBody={...// follow the sample job definition above};constheaders={"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${access_token}`,};fetch("https://api.freeconvert.com/v1/process/jobs",{method:"POST",body:inputBody,headers:headers,}).then(function(res){returnres.json();}).then(function(body){console.log(body);});
importrequestsrequest_body={...# follow the sample job definition above
}headers={'Content-Type':'application/json','Accept':'application/json','Authorization':'Bearer'+access_token}result=requests.post('https://api.freeconvert.com/v1/process/jobs',data=request_body,headers=headers)print(result.json())
require'rest-client'require'json'request_body={...# follow the sample job definition above}headers={'Content-Type'=>'application/json','Accept'=>'application/json','Authorization'=>'Bearer'+access_token}result=RestClient.post('https://api.freeconvert.com/v1/process/jobs',body: request_body,headers: headers)JSON.parse(result)
<?phprequire'vendor/autoload.php';$headers=array('Content-Type'=>'application/json','Accept'=>'application/json','Authorization'=>'Bearer '$access_token,);$client=new\GuzzleHttp\Client();$request_body=array(...// follow the sample job definition above)try{$response=$client->request('POST','https://api.freeconvert.com/v1/process/jobs',array('headers'=>$headers,'content'=>json_encode($request_body),));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
packagemainimport("bytes""net/http")funcmain(){jsonReq:=map[string][]string{...// follow the sample job definition above}headers:=map[string][]string{"Content-Type":string{"application/json"},"Accept":string{"application/json"},"Authorization":string{"Bearer"+access_token},}data:=bytes.NewBuffer([]byte{jsonReq})req,err:=http.NewRequest("POST","https://api.freeconvert.com/v1/process/jobs",data)req.Header=headersclient:=&http.Client{}resp,err:=client.Do(req)// ...}
Instead of executing Tasks individually as shown earlier, we can define the whole conversion process using a single Job. The Job shown here defines three tasks.
Import a jpg file from a specified URL.
Convert the file to png format.
Export a download URL.
Advanced Options
Convert (JPG to PDF) Advanced Options
{
"sourceExt": "jpg",
"targetExt": "pdf",
"operation": "convert",
"options": [
{
"name": "strip",
"hint": "Strip the image of any profiles, EXIF, and comments to reduce size",
"data_type": "boolean",
"default_value": "true"
},
{
"name": "pdf_page_size",
"hint": "",
"data_type": "string",
"type": "enum",
"enum_values": [
{
"value": "1240.2x1753.95",
"hint": "A4"
},
{
"value": "same-as-image",
"hint": "Same as image"
},
{
"value": "1753.95x2480.25",
"hint": "A3"
},
...
]
},
{
"name": "enlarge_images_to_fit",
"hint": "Use this option if you want to enlarge small images to fit the PDF page size.",
"data_type": "boolean",
"default_value": "true",
"conditions": [
{
"name": "pdf_page_size",
"required": true,
"meta": [
{
"value": "1240.2x1753.95",
"label": "A4"
},
{
"value": "1753.95x2480.25",
"label": "A3"
},
...
]
}
]
},
...
]
}
FreeConvert supports some outstanding advanced options in terms of converting, compressing, and merging files that make us the number one file converter in the web world. We are now making them available to our API users as well.
From the advanced options endpoint, you can generate all the possible options based on your operation and file types. Here, we'll share an example of how to use those options.
Let's say, you want to convert a JPG to a PDF. Now if you make a GET request to our convert advanced options API like below:
From this response, we can see an array named options that includes all the possible advanced options for your operation. Each options contains some common fields.
name - The name of the option that should be specified in the job.
hint - The use case of the option.
data_type - Data type that our engine allows for this option.
default_value - If the option is not included in the job, this value will be used.
We can see another field type: enum when the data_type is a string but only allow some specific values. In that case, you can also see the enum_values field that will give you a list of the possible values for that option.
Some of the options require certain conditions to be met to be effective. On the example response, enlarge_images_to_fit option requires one of the values of pdf_page_size to also be included in the job. Conditions can include:
name - Name of the other option that this option is dependent on.
meta - What are the values that the condition option must have, in order for the dependent option to be effective.
required - Whether the condition option must be included in the job or not. If this is false, that means the dependent option can exist on its own. However, if the condition option is also present in the job, then it must have one of the values specified in condition meta.
Now let's say I want to convert my JPG file to PDF, and I want the PDF page to be A4 in size and I need images in original size without scaling. So, my options that should be specified in the job will be like:
This section is to introduce to users possible errors and response codes that our API returns.
Response Codes:
FreeConvert.com API responds with the following standard HTTP status codes when encountered with an error:
Error Code
Meaning
400
Bad Request -- Your request parameter is invalid.
401
Unauthorized -- Your API key is invalid.
403
Forbidden -- Your access is denied.
404
Not Found -- The specified content could not be found.
405
Method Not Allowed -- You tried to access with an invalid method.
406
Not Acceptable -- You requested a format that isn't json.
409
Already exists -- You're requesting to create something that already exists.
429
Too Many Requests -- You're sending too many requests.
500
Internal Server Error -- We had a problem with our server. Try again later.
Rate Limits
FreeConvert API is rate limited. If your API requests are rate limited, you will receive a 429 HTTP response code.
Error Info
If a Job or Task has a status failed we provide additional info about the error in errorCode and msg(optional) attributes of the Job's or Task's result object.
// errorCode indicated on Task or Job object
{
....
result: {
errorCode: 'specific error code',
msg: 'additional message about the error'
}
...
}
Possible errorCodes of Task:
errorCode
Meaning
upload_timeout
File upload timeout exceeded.
engine_timeout
Conversion timeout exceeded due to our internal server issue.
out_of_conversion_minutes
Available conversion minutes are finished for this user.
out_of_conversion_minutes_per_task
Available conversion minutes are finished for this task.
user_deleted_task
Task failed due to the deletion operation of the user.
insufficient_permission
Task failed due to insufficient permission.
invalid_credentials
Task failed due to invalid credentials.
processing_failed
Task failed due to internal process failure.
A job can fail if one of its tasks is failed/canceled/deleted.
Possible errorCodes of Job:
errorCode
Meaning
task_failed
Job failed due to the failure of one of its task.
task_deleted
Job failed due to the deletion of one of its task.
task_canceled
Job failed due to the cancelation of one of its task.
Authentication
HTTP Authentication, scheme: bearer
Every request to a protected route in FreeConvert API must include an API Key so that we can identify you. Once you have signed up for an account, you can generate an API key by visiting the API keys page from
your User Dashboard.
API requests are authenticated using the Authorization: Bearer API_KEY in the header.
API keys do not expire unless you delete them.
File Formats
List All Formats
Code samples
# You can also use wget
curl -X GET https://api.freeconvert.com/v1/query/formats \-H'Accept: application/json'
<?phprequire'vendor/autoload.php';$headers=array('Accept'=>'application/json',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('GET','https://api.freeconvert.com/v1/query/formats',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakeGetRequest(){stringurl="https://api.freeconvert.com/v1/query/formats";varresult=awaitGetAsync(url);}/// Performs a GET RequestpublicasyncTaskGetAsync(stringurl){//Start the requestHttpResponseMessageresponse=awaitClient.GetAsync(url);//Validate resultresponse.EnsureSuccessStatusCode();}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
<?phprequire'vendor/autoload.php';$headers=array('Accept'=>'application/json',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('GET','https://api.freeconvert.com/v1/query/formats/convert',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakeGetRequest(){stringurl="https://api.freeconvert.com/v1/query/formats/convert";varresult=awaitGetAsync(url);}/// Performs a GET RequestpublicasyncTaskGetAsync(stringurl){//Start the requestHttpResponseMessageresponse=awaitClient.GetAsync(url);//Validate resultresponse.EnsureSuccessStatusCode();}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
GET /query/formats/convert
If input_format is specified, returns supported output formats for the specified input_format. If output_format is specified, returns supported input formats for the specified output_format. Either input_format or output_format can be specified at a time. Not both.
Parameters
Name
In
Type
Required
Description
input_format
query
string
false
Input file extension. Specify * to indicate all formats.
output_format
query
string
false
Output file extension. Specify * to indicate all formats.
<?phprequire'vendor/autoload.php';$headers=array('Accept'=>'application/json',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('GET','https://api.freeconvert.com/v1/query/formats/compress',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakeGetRequest(){stringurl="https://api.freeconvert.com/v1/query/formats/compress";varresult=awaitGetAsync(url);}/// Performs a GET RequestpublicasyncTaskGetAsync(stringurl){//Start the requestHttpResponseMessageresponse=awaitClient.GetAsync(url);//Validate resultresponse.EnsureSuccessStatusCode();}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
GET /query/formats/compress
If input_format is specified, returns supported output formats for the specified input_format. If output_format is specified, returns supported input formats for the specified output_format. Either input_format or output_format can be specified at a time. Not both.
Parameters
Name
In
Type
Required
Description
input_format
query
string
false
Input file extension. Specify * to indicate all formats.
output_format
query
string
false
Output file extension. Specify * to indicate all formats.
<?phprequire'vendor/autoload.php';$headers=array('Accept'=>'application/json',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('GET','https://api.freeconvert.com/v1/query/formats/merge',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakeGetRequest(){stringurl="https://api.freeconvert.com/v1/query/formats/merge";varresult=awaitGetAsync(url);}/// Performs a GET RequestpublicasyncTaskGetAsync(stringurl){//Start the requestHttpResponseMessageresponse=awaitClient.GetAsync(url);//Validate resultresponse.EnsureSuccessStatusCode();}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
GET /query/formats/merge
If input_format is specified, returns supported output formats for the specified input_format. If output_format is specified, returns supported input formats for the specified output_format. Either input_format or output_format can be specified at a time. Not both.
Parameters
Name
In
Type
Required
Description
input_format
query
string
false
Input file extension. Specify * to indicate all formats.
output_format
query
string
false
Output file extension. Specify * to indicate all formats.
<?phprequire'vendor/autoload.php';$headers=array('Accept'=>'application/json',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('GET','https://api.freeconvert.com/v1/query/formats/crop',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakeGetRequest(){stringurl="https://api.freeconvert.com/v1/query/formats/crop";varresult=awaitGetAsync(url);}/// Performs a GET RequestpublicasyncTaskGetAsync(stringurl){//Start the requestHttpResponseMessageresponse=awaitClient.GetAsync(url);//Validate resultresponse.EnsureSuccessStatusCode();}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
GET /query/formats/crop
If input_format is specified, returns supported output formats for the specified input_format. If output_format is specified, returns supported input formats for the specified output_format. Either input_format or output_format can be specified at a time. Not both.
Parameters
Name
In
Type
Required
Description
input_format
query
string
false
Input file extension. Specify * to indicate all formats.
output_format
query
string
false
Output file extension. Specify * to indicate all formats.
<?phprequire'vendor/autoload.php';$headers=array('Accept'=>'application/json',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('GET','https://api.freeconvert.com/v1/query/formats/trim',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakeGetRequest(){stringurl="https://api.freeconvert.com/v1/query/formats/trim";varresult=awaitGetAsync(url);}/// Performs a GET RequestpublicasyncTaskGetAsync(stringurl){//Start the requestHttpResponseMessageresponse=awaitClient.GetAsync(url);//Validate resultresponse.EnsureSuccessStatusCode();}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
GET /query/formats/trim
If input_format is specified, returns supported output formats for the specified input_format. If output_format is specified, returns supported input formats for the specified output_format. Either input_format or output_format can be specified at a time. Not both.
Parameters
Name
In
Type
Required
Description
input_format
query
string
false
Input file extension. Specify * to indicate all formats.
output_format
query
string
false
Output file extension. Specify * to indicate all formats.
Tasks are the building blocks of FreeConvert.com API. A job, such as converting a file, usually involves several tasks. For example, for a file conversion job, you would typically create a file import task, convert task, and finally an export task.
Different tasks have their own API endpoints. For example, for converting a file you can use the convert task endpoint.
List Tasks
Code samples
# You can also use wget
curl -X GET https://api.freeconvert.com/v1/process/tasks \-H'Accept: application/json'\-H'Authorization: Bearer {access-token}'
<?phprequire'vendor/autoload.php';$headers=array('Accept'=>'application/json','Authorization'=>'Bearer {access-token}',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('GET','https://api.freeconvert.com/v1/process/tasks',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakeGetRequest(){stringurl="https://api.freeconvert.com/v1/process/tasks";varresult=awaitGetAsync(url);}/// Performs a GET RequestpublicasyncTaskGetAsync(stringurl){//Start the requestHttpResponseMessageresponse=awaitClient.GetAsync(url);//Validate resultresponse.EnsureSuccessStatusCode();}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
GET /process/tasks
Get a list of all tasks for the current user with their payload, results, and status.
Parameters
Name
In
Type
Required
Description
status
query
string
false
List tasks matching the specified status [created, processing, completed, canceled, failed, deleted]
operation
query
string
false
FIlter the list to only show tasks with a given operation (for example, import/url, convert...etc.)
job
query
string
false
Show a list of tasks for the specified job id.
per_page
query
integer
false
Number of tasks per page, defaults to 50. Limited at 200.
page
query
integer
false
If the list of tasks include multiple pages, this specify which page to show.
# You can also use wget
curl -X GET https://api.freeconvert.com/v1/process/tasks/{taskId}\-H'Accept: application/json'\-H'Authorization: Bearer {access-token}'
<?phprequire'vendor/autoload.php';$headers=array('Accept'=>'application/json','Authorization'=>'Bearer {access-token}',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('GET','https://api.freeconvert.com/v1/process/tasks/{taskId}',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakeGetRequest(){stringurl="https://api.freeconvert.com/v1/process/tasks/{taskId}";varresult=awaitGetAsync(url);}/// Performs a GET RequestpublicasyncTaskGetAsync(stringurl){//Start the requestHttpResponseMessageresponse=awaitClient.GetAsync(url);//Validate resultresponse.EnsureSuccessStatusCode();}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
GET /process/tasks/{taskId}
Show details of a task using its task Id.
Parameters
Name
In
Type
Required
Description
taskId
path
string(ObjectID)
true
ID of the task to show.
include
query
string
false
Use this option to include payload, and job details in the result. You can seperate multiple inlude values with a comma.
<?phprequire'vendor/autoload.php';$headers=array('Authorization'=>'Bearer {access-token}',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('DELETE','https://api.freeconvert.com/v1/process/tasks/{taskId}',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakeDeleteRequest(){intid=1;stringurl="https://api.freeconvert.com/v1/process/tasks/{taskId}";awaitDeleteAsync(id,url);}/// Performs a DELETE RequestpublicasyncTaskDeleteAsync(intid,stringurl){//Execute DELETE requestHttpResponseMessageresponse=awaitClient.DeleteAsync(url+$"/{id}");//Return responseawaitDeserializeObject(response);}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
DELETE /process/tasks/{taskId}
Deleting a task also deletes its files.
All tasks are automatically removed after 24 hours of creation. Files from a task are deleted 4 hours after the task creation.
# You can also use wget
curl -X POST https://api.freeconvert.com/v1/process/tasks/{taskId}/cancel \-H'Accept: application/json'\-H'Authorization: Bearer {access-token}'
<?phprequire'vendor/autoload.php';$headers=array('Accept'=>'application/json','Authorization'=>'Bearer {access-token}',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('POST','https://api.freeconvert.com/v1/process/tasks/{taskId}/cancel',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakePostRequest(){stringurl="https://api.freeconvert.com/v1/process/tasks/{taskId}/cancel";awaitPostAsync(null,url);}/// Performs a POST RequestpublicasyncTaskPostAsync(undefinedcontent,stringurl){//Serialize ObjectStringContentjsonContent=SerializeObject(content);//Execute POST requestHttpResponseMessageresponse=awaitClient.PostAsync(url,jsonContent);}/// Serialize an object to JsonprivateStringContentSerializeObject(undefinedcontent){//Serialize ObjectstringjsonObject=JsonConvert.SerializeObject(content);//Create Json UTF8 String ContentreturnnewStringContent(jsonObject,Encoding.UTF8,"application/json");}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
POST /process/tasks/{taskId}/cancel
Cancel a task that has a status of created or processing.
If you cancel a task, all tasks that depends on it will also fail.
<?phprequire'vendor/autoload.php';$headers=array('Accept'=>'application/json','Authorization'=>'Bearer {access-token}',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('GET','https://api.freeconvert.com/v1/process/jobs',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakeGetRequest(){stringurl="https://api.freeconvert.com/v1/process/jobs";varresult=awaitGetAsync(url);}/// Performs a GET RequestpublicasyncTaskGetAsync(stringurl){//Start the requestHttpResponseMessageresponse=awaitClient.GetAsync(url);//Validate resultresponse.EnsureSuccessStatusCode();}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
GET /process/jobs
Get a list of all jobs for the current user
Parameters
Name
In
Type
Required
Description
status
query
string
false
List jobs matching the specified status. Possible statuses are [created, processing, completed, failed]
tag
query
string
false
Show a list of jobs containing the specified tag.
include
query
string
false
Include additional info in the returned Job data. Possible values: tasks
per_page
query
integer
false
Number of jobs per page, defaults to 50. Limited at 200.
page
query
integer
false
If the list of jobs include multiple pages, this specify which page to show.
Successful jobs lookup, returns a list of jobs in the response body. You can get more details on the response format by referring to Show a Job endpoint
# You can also use wget
curl -X POST https://api.freeconvert.com/v1/process/jobs \-H'Content-Type: application/json'\-H'Accept: application/json'\-H'Authorization: Bearer {access-token}'
<?phprequire'vendor/autoload.php';$headers=array('Content-Type'=>'application/json','Accept'=>'application/json','Authorization'=>'Bearer {access-token}',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('POST','https://api.freeconvert.com/v1/process/jobs',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakePostRequest(){stringurl="https://api.freeconvert.com/v1/process/jobs";awaitPostAsync(null,url);}/// Performs a POST RequestpublicasyncTaskPostAsync(undefinedcontent,stringurl){//Serialize ObjectStringContentjsonContent=SerializeObject(content);//Execute POST requestHttpResponseMessageresponse=awaitClient.PostAsync(url,jsonContent);}/// Serialize an object to JsonprivateStringContentSerializeObject(undefinedcontent){//Serialize ObjectstringjsonObject=JsonConvert.SerializeObject(content);//Create Json UTF8 String ContentreturnnewStringContent(jsonObject,Encoding.UTF8,"application/json");}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
POST /process/jobs
Creates a new job along with all of its tasks. A job cretaion request must include at least one task.
An abitrary string which has no effect. It can be used to identify a job with an ID in your system/application.
» tasks
body
object
true
A job consists of one or more tasks. For example, the example shown inludes an import, conversion, and a export task. Task names should only contain alphanumerals, dash (-), and underscore (_).
»» operation
body
string
true
Specify the endpoint for the given task. For example, import/upload, convert, export/s3...etc.
»» input
body
string or array
false
Specify the names of the input tasks for the task. For example, in a convert task, you can enter the import task's name to convert that specific imported file. You can also enter multiple input task names in an array.
»» Other
body
string
false
List of available properties for a task depending on the task's operation.
# You can also use wget
curl -X GET https://api.freeconvert.com/v1/process/jobs/{jobId}\-H'Accept: application/json'\-H'Authorization: Bearer {access-token}'
<?phprequire'vendor/autoload.php';$headers=array('Accept'=>'application/json','Authorization'=>'Bearer {access-token}',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('GET','https://api.freeconvert.com/v1/process/jobs/{jobId}',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakeGetRequest(){stringurl="https://api.freeconvert.com/v1/process/jobs/{jobId}";varresult=awaitGetAsync(url);}/// Performs a GET RequestpublicasyncTaskGetAsync(stringurl){//Start the requestHttpResponseMessageresponse=awaitClient.GetAsync(url);//Validate resultresponse.EnsureSuccessStatusCode();}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
<?phprequire'vendor/autoload.php';$headers=array('Authorization'=>'Bearer {access-token}',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('DELETE','https://api.freeconvert.com/v1/process/jobs/{jobId}',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakeDeleteRequest(){intid=1;stringurl="https://api.freeconvert.com/v1/process/jobs/{jobId}";awaitDeleteAsync(id,url);}/// Performs a DELETE RequestpublicasyncTaskDeleteAsync(intid,stringurl){//Execute DELETE requestHttpResponseMessageresponse=awaitClient.DeleteAsync(url+$"/{id}");//Return responseawaitDeserializeObject(response);}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
DELETE /process/jobs/{jobId}
Deleting a job would delete all the tasks and files of that job.
All files that belongs to a task within a job are automatically deleted 4 hours after task creation. Job entries are deleted after 24 hours of creation.
# You can also use wget
curl -X POST https://api.freeconvert.com/v1/process/import/url \-H'Content-Type: application/json'\-H'Accept: application/json'\-H'Authorization: Bearer {access-token}'
<?phprequire'vendor/autoload.php';$headers=array('Content-Type'=>'application/json','Accept'=>'application/json','Authorization'=>'Bearer {access-token}',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('POST','https://api.freeconvert.com/v1/process/import/url',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakePostRequest(){stringurl="https://api.freeconvert.com/v1/process/import/url";awaitPostAsync(null,url);}/// Performs a POST RequestpublicasyncTaskPostAsync(undefinedcontent,stringurl){//Serialize ObjectStringContentjsonContent=SerializeObject(content);//Execute POST requestHttpResponseMessageresponse=awaitClient.PostAsync(url,jsonContent);}/// Serialize an object to JsonprivateStringContentSerializeObject(undefinedcontent){//Serialize ObjectstringjsonObject=JsonConvert.SerializeObject(content);//Create Json UTF8 String ContentreturnnewStringContent(jsonObject,Encoding.UTF8,"application/json");}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
# You can also use wget
curl -X POST https://api.freeconvert.com/v1/process/import/upload \-H'Accept: application/json'\-H'Authorization: Bearer {access-token}'
<?phprequire'vendor/autoload.php';$headers=array('Accept'=>'application/json','Authorization'=>'Bearer {access-token}',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('POST','https://api.freeconvert.com/v1/process/import/upload',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakePostRequest(){stringurl="https://api.freeconvert.com/v1/process/import/upload";awaitPostAsync(null,url);}/// Performs a POST RequestpublicasyncTaskPostAsync(undefinedcontent,stringurl){//Serialize ObjectStringContentjsonContent=SerializeObject(content);//Execute POST requestHttpResponseMessageresponse=awaitClient.PostAsync(url,jsonContent);}/// Serialize an object to JsonprivateStringContentSerializeObject(undefinedcontent){//Serialize ObjectstringjsonObject=JsonConvert.SerializeObject(content);//Create Json UTF8 String ContentreturnnewStringContent(jsonObject,Encoding.UTF8,"application/json");}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
POST /process/import/upload
Creates an upload task to submit one file to FreeConvert.com. You can also use this method to directly send your user's files to FreeConvert without storing them on your application. See Getting Started - Import file from device
For example, you could use the form object in the result key of the response to allow browser-based file uploading.
Here is a Form Upload Example (in the right panel) on how to utilize the url and other post parameters from our response to create a file upload form. Please see API code examples for more.
# You can also use wget
curl -X POST https://api.freeconvert.com/v1/process/import/googlecloud \-H'Content-Type: application/json'\-H'Accept: application/json'\-H'Authorization: Bearer {access-token}'
<?phprequire'vendor/autoload.php';$headers=array('Content-Type'=>'application/json','Accept'=>'application/json','Authorization'=>'Bearer {access-token}',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('POST','https://api.freeconvert.com/v1/process/import/googlecloud',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakePostRequest(){stringurl="https://api.freeconvert.com/v1/process/import/googlecloud";awaitPostAsync(null,url);}/// Performs a POST RequestpublicasyncTaskPostAsync(undefinedcontent,stringurl){//Serialize ObjectStringContentjsonContent=SerializeObject(content);//Execute POST requestHttpResponseMessageresponse=awaitClient.PostAsync(url,jsonContent);}/// Serialize an object to JsonprivateStringContentSerializeObject(undefinedcontent){//Serialize ObjectstringjsonObject=JsonConvert.SerializeObject(content);//Create Json UTF8 String ContentreturnnewStringContent(jsonObject,Encoding.UTF8,"application/json");}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
POST /process/import/googlecloud
Creates a new task to import a file form google cloud storage into FreeConvert
# You can also use wget
curl -X POST https://api.freeconvert.com/v1/process/import/azureblob \-H'Content-Type: application/json'\-H'Accept: application/json'\-H'Authorization: Bearer {access-token}'
<?phprequire'vendor/autoload.php';$headers=array('Content-Type'=>'application/json','Accept'=>'application/json','Authorization'=>'Bearer {access-token}',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('POST','https://api.freeconvert.com/v1/process/import/azureblob',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakePostRequest(){stringurl="https://api.freeconvert.com/v1/process/import/azureblob";awaitPostAsync(null,url);}/// Performs a POST RequestpublicasyncTaskPostAsync(undefinedcontent,stringurl){//Serialize ObjectStringContentjsonContent=SerializeObject(content);//Execute POST requestHttpResponseMessageresponse=awaitClient.PostAsync(url,jsonContent);}/// Serialize an object to JsonprivateStringContentSerializeObject(undefinedcontent){//Serialize ObjectstringjsonObject=JsonConvert.SerializeObject(content);//Create Json UTF8 String ContentreturnnewStringContent(jsonObject,Encoding.UTF8,"application/json");}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
POST /process/import/azureblob
Creates a new task to import a file form azure blob storage into FreeConvert
# You can also use wget
curl -X POST https://api.freeconvert.com/v1/process/import/s3 \-H'Content-Type: application/json'\-H'Accept: application/json'\-H'Authorization: Bearer {access-token}'
<?phprequire'vendor/autoload.php';$headers=array('Content-Type'=>'application/json','Accept'=>'application/json','Authorization'=>'Bearer {access-token}',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('POST','https://api.freeconvert.com/v1/process/import/s3',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakePostRequest(){stringurl="https://api.freeconvert.com/v1/process/import/s3";awaitPostAsync(null,url);}/// Performs a POST RequestpublicasyncTaskPostAsync(undefinedcontent,stringurl){//Serialize ObjectStringContentjsonContent=SerializeObject(content);//Execute POST requestHttpResponseMessageresponse=awaitClient.PostAsync(url,jsonContent);}/// Serialize an object to JsonprivateStringContentSerializeObject(undefinedcontent){//Serialize ObjectstringjsonObject=JsonConvert.SerializeObject(content);//Create Json UTF8 String ContentreturnnewStringContent(jsonObject,Encoding.UTF8,"application/json");}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
POST /process/import/s3
Creates a new task to import a file form S3 bucket into FreeConvert
# You can also use wget
curl -X POST https://api.freeconvert.com/v1/process/import/sftp \-H'Content-Type: application/json'\-H'Accept: application/json'\-H'Authorization: Bearer {access-token}'
<?phprequire'vendor/autoload.php';$headers=array('Content-Type'=>'application/json','Accept'=>'application/json','Authorization'=>'Bearer {access-token}',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('POST','https://api.freeconvert.com/v1/process/import/sftp',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakePostRequest(){stringurl="https://api.freeconvert.com/v1/process/import/sftp";awaitPostAsync(null,url);}/// Performs a POST RequestpublicasyncTaskPostAsync(undefinedcontent,stringurl){//Serialize ObjectStringContentjsonContent=SerializeObject(content);//Execute POST requestHttpResponseMessageresponse=awaitClient.PostAsync(url,jsonContent);}/// Serialize an object to JsonprivateStringContentSerializeObject(undefinedcontent){//Serialize ObjectstringjsonObject=JsonConvert.SerializeObject(content);//Create Json UTF8 String ContentreturnnewStringContent(jsonObject,Encoding.UTF8,"application/json");}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
POST /process/import/sftp
Creates a new task to import a file form SFTP server into FreeConvert
# You can also use wget
curl -X POST https://api.freeconvert.com/v1/process/import/base64 \-H'Content-Type: application/json'\-H'Accept: application/json'\-H'Authorization: Bearer {access-token}'
<?phprequire'vendor/autoload.php';$headers=array('Content-Type'=>'application/json','Accept'=>'application/json','Authorization'=>'Bearer {access-token}',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('POST','https://api.freeconvert.com/v1/process/import/base64',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakePostRequest(){stringurl="https://api.freeconvert.com/v1/process/import/base64";awaitPostAsync(null,url);}/// Performs a POST RequestpublicasyncTaskPostAsync(undefinedcontent,stringurl){//Serialize ObjectStringContentjsonContent=SerializeObject(content);//Execute POST requestHttpResponseMessageresponse=awaitClient.PostAsync(url,jsonContent);}/// Serialize an object to JsonprivateStringContentSerializeObject(undefinedcontent){//Serialize ObjectstringjsonObject=JsonConvert.SerializeObject(content);//Create Json UTF8 String ContentreturnnewStringContent(jsonObject,Encoding.UTF8,"application/json");}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
POST /process/import/base64
Creates a new task to import a file as base64 encoded string into FreeConvert.
Note: The maximum size of base64 encoded file content must be 1.5 MB
# You can also use wget
curl -X POST https://api.freeconvert.com/v1/process/import/webpage \-H'Content-Type: application/json'\-H'Accept: application/json'\-H'Authorization: Bearer {access-token}'
<?phprequire'vendor/autoload.php';$headers=array('Content-Type'=>'application/json','Accept'=>'application/json','Authorization'=>'Bearer {access-token}',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('POST','https://api.freeconvert.com/v1/process/import/webpage',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakePostRequest(){stringurl="https://api.freeconvert.com/v1/process/import/webpage";awaitPostAsync(null,url);}/// Performs a POST RequestpublicasyncTaskPostAsync(undefinedcontent,stringurl){//Serialize ObjectStringContentjsonContent=SerializeObject(content);//Execute POST requestHttpResponseMessageresponse=awaitClient.PostAsync(url,jsonContent);}/// Serialize an object to JsonprivateStringContentSerializeObject(undefinedcontent){//Serialize ObjectstringjsonObject=JsonConvert.SerializeObject(content);//Create Json UTF8 String ContentreturnnewStringContent(jsonObject,Encoding.UTF8,"application/json");}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
POST /process/import/webpage
Creates a new task to import a webpage into FreeConvert from a URL
# You can also use wget
curl -X POST https://api.freeconvert.com/v1/process/export/url \-H'Content-Type: application/json'\-H'Accept: application/json'\-H'Authorization: Bearer {access-token}'
<?phprequire'vendor/autoload.php';$headers=array('Content-Type'=>'application/json','Accept'=>'application/json','Authorization'=>'Bearer {access-token}',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('POST','https://api.freeconvert.com/v1/process/export/url',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakePostRequest(){stringurl="https://api.freeconvert.com/v1/process/export/url";awaitPostAsync(null,url);}/// Performs a POST RequestpublicasyncTaskPostAsync(undefinedcontent,stringurl){//Serialize ObjectStringContentjsonContent=SerializeObject(content);//Execute POST requestHttpResponseMessageresponse=awaitClient.PostAsync(url,jsonContent);}/// Serialize an object to JsonprivateStringContentSerializeObject(undefinedcontent){//Serialize ObjectstringjsonObject=JsonConvert.SerializeObject(content);//Create Json UTF8 String ContentreturnnewStringContent(jsonObject,Encoding.UTF8,"application/json");}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
POST /process/export/url
Creates a temporary URL to download the file (Please note that files are automatically deleted 4-hours after the task creation).
Files can also be manually deleted by deleting the task.
# You can also use wget
curl -X POST https://api.freeconvert.com/v1/process/export/googlecloud \-H'Content-Type: application/json'\-H'Accept: application/json'\-H'Authorization: Bearer {access-token}'
<?phprequire'vendor/autoload.php';$headers=array('Content-Type'=>'application/json','Accept'=>'application/json','Authorization'=>'Bearer {access-token}',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('POST','https://api.freeconvert.com/v1/process/export/googlecloud',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakePostRequest(){stringurl="https://api.freeconvert.com/v1/process/export/googlecloud";awaitPostAsync(null,url);}/// Performs a POST RequestpublicasyncTaskPostAsync(undefinedcontent,stringurl){//Serialize ObjectStringContentjsonContent=SerializeObject(content);//Execute POST requestHttpResponseMessageresponse=awaitClient.PostAsync(url,jsonContent);}/// Serialize an object to JsonprivateStringContentSerializeObject(undefinedcontent){//Serialize ObjectstringjsonObject=JsonConvert.SerializeObject(content);//Create Json UTF8 String ContentreturnnewStringContent(jsonObject,Encoding.UTF8,"application/json");}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
POST /process/export/googlecloud
Creates a new task to export a file form FreeConvert into google cloud storage
# You can also use wget
curl -X POST https://api.freeconvert.com/v1/process/export/azureblob \-H'Content-Type: application/json'\-H'Accept: application/json'\-H'Authorization: Bearer {access-token}'
<?phprequire'vendor/autoload.php';$headers=array('Content-Type'=>'application/json','Accept'=>'application/json','Authorization'=>'Bearer {access-token}',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('POST','https://api.freeconvert.com/v1/process/export/azureblob',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakePostRequest(){stringurl="https://api.freeconvert.com/v1/process/export/azureblob";awaitPostAsync(null,url);}/// Performs a POST RequestpublicasyncTaskPostAsync(undefinedcontent,stringurl){//Serialize ObjectStringContentjsonContent=SerializeObject(content);//Execute POST requestHttpResponseMessageresponse=awaitClient.PostAsync(url,jsonContent);}/// Serialize an object to JsonprivateStringContentSerializeObject(undefinedcontent){//Serialize ObjectstringjsonObject=JsonConvert.SerializeObject(content);//Create Json UTF8 String ContentreturnnewStringContent(jsonObject,Encoding.UTF8,"application/json");}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
POST /process/export/azureblob
Creates a new task to export a file form FreeConvert into azure blob storage
# You can also use wget
curl -X POST https://api.freeconvert.com/v1/process/export/s3 \-H'Content-Type: application/json'\-H'Accept: application/json'\-H'Authorization: Bearer {access-token}'
<?phprequire'vendor/autoload.php';$headers=array('Content-Type'=>'application/json','Accept'=>'application/json','Authorization'=>'Bearer {access-token}',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('POST','https://api.freeconvert.com/v1/process/export/s3',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakePostRequest(){stringurl="https://api.freeconvert.com/v1/process/export/s3";awaitPostAsync(null,url);}/// Performs a POST RequestpublicasyncTaskPostAsync(undefinedcontent,stringurl){//Serialize ObjectStringContentjsonContent=SerializeObject(content);//Execute POST requestHttpResponseMessageresponse=awaitClient.PostAsync(url,jsonContent);}/// Serialize an object to JsonprivateStringContentSerializeObject(undefinedcontent){//Serialize ObjectstringjsonObject=JsonConvert.SerializeObject(content);//Create Json UTF8 String ContentreturnnewStringContent(jsonObject,Encoding.UTF8,"application/json");}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
POST /process/export/s3
This endpoint will allow users to export their files to AWS S3 using our API (Please note that files are automatically deleted 4-hours after the task creation).
Files can also be manually deleted by deleting the task.
The ID of the task to create temporary URLs for. Multiple task IDs can be provided as an array.
» bucket
body
string
true
The Amazon S3 bucket where to store the file
» region
body
string
true
Specify the Amazon S3 endpoint, e.g. us-west-2 or eu-west-1
» access_key_id
body
string
true
AWS access key id
» secret_access_key
body
string
true
AWS secret access key
» key
body
string
true
S3 key for storing the file (the filename in the bucket, including path)
» acl
body
string
false
S3 ACL for storing the file. Possible values like private, public-read , public-read-write, authenticated-read, bucket-owner-read, bucket-owner-full-control
» endpoint
body
string
false
Use a custom S3 API endpoint. The default endpoint is built from the configured region
# You can also use wget
curl -X POST https://api.freeconvert.com/v1/process/export/sftp \-H'Content-Type: application/json'\-H'Accept: application/json'\-H'Authorization: Bearer {access-token}'
<?phprequire'vendor/autoload.php';$headers=array('Content-Type'=>'application/json','Accept'=>'application/json','Authorization'=>'Bearer {access-token}',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('POST','https://api.freeconvert.com/v1/process/export/sftp',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakePostRequest(){stringurl="https://api.freeconvert.com/v1/process/export/sftp";awaitPostAsync(null,url);}/// Performs a POST RequestpublicasyncTaskPostAsync(undefinedcontent,stringurl){//Serialize ObjectStringContentjsonContent=SerializeObject(content);//Execute POST requestHttpResponseMessageresponse=awaitClient.PostAsync(url,jsonContent);}/// Serialize an object to JsonprivateStringContentSerializeObject(undefinedcontent){//Serialize ObjectstringjsonObject=JsonConvert.SerializeObject(content);//Create Json UTF8 String ContentreturnnewStringContent(jsonObject,Encoding.UTF8,"application/json");}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
POST /process/export/sftp
This endpoint will allow our users to export processed files into an sftp account using our API
# You can also use wget
curl -X POST https://api.freeconvert.com/v1/process/convert \-H'Content-Type: application/json'\-H'Accept: application/json'\-H'Authorization: Bearer {access-token}'
<?phprequire'vendor/autoload.php';$headers=array('Content-Type'=>'application/json','Accept'=>'application/json','Authorization'=>'Bearer {access-token}',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('POST','https://api.freeconvert.com/v1/process/convert',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakePostRequest(){stringurl="https://api.freeconvert.com/v1/process/convert";awaitPostAsync(null,url);}/// Performs a POST RequestpublicasyncTaskPostAsync(undefinedcontent,stringurl){//Serialize ObjectStringContentjsonContent=SerializeObject(content);//Execute POST requestHttpResponseMessageresponse=awaitClient.PostAsync(url,jsonContent);}/// Serialize an object to JsonprivateStringContentSerializeObject(undefinedcontent){//Serialize ObjectstringjsonObject=JsonConvert.SerializeObject(content);//Create Json UTF8 String ContentreturnnewStringContent(jsonObject,Encoding.UTF8,"application/json");}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
POST /process/convert
Creates a task to convert one input file from an input_format to outut_format
# You can also use wget
curl -X POST https://api.freeconvert.com/v1/process/compress \-H'Content-Type: application/json'\-H'Accept: application/json'\-H'Authorization: Bearer {access-token}'
<?phprequire'vendor/autoload.php';$headers=array('Content-Type'=>'application/json','Accept'=>'application/json','Authorization'=>'Bearer {access-token}',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('POST','https://api.freeconvert.com/v1/process/compress',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakePostRequest(){stringurl="https://api.freeconvert.com/v1/process/compress";awaitPostAsync(null,url);}/// Performs a POST RequestpublicasyncTaskPostAsync(undefinedcontent,stringurl){//Serialize ObjectStringContentjsonContent=SerializeObject(content);//Execute POST requestHttpResponseMessageresponse=awaitClient.PostAsync(url,jsonContent);}/// Serialize an object to JsonprivateStringContentSerializeObject(undefinedcontent){//Serialize ObjectstringjsonObject=JsonConvert.SerializeObject(content);//Create Json UTF8 String ContentreturnnewStringContent(jsonObject,Encoding.UTF8,"application/json");}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
# You can also use wget
curl -X POST https://api.freeconvert.com/v1/process/merge \-H'Content-Type: application/json'\-H'Accept: application/json'\-H'Authorization: Bearer {access-token}'
<?phprequire'vendor/autoload.php';$headers=array('Content-Type'=>'application/json','Accept'=>'application/json','Authorization'=>'Bearer {access-token}',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('POST','https://api.freeconvert.com/v1/process/merge',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakePostRequest(){stringurl="https://api.freeconvert.com/v1/process/merge";awaitPostAsync(null,url);}/// Performs a POST RequestpublicasyncTaskPostAsync(undefinedcontent,stringurl){//Serialize ObjectStringContentjsonContent=SerializeObject(content);//Execute POST requestHttpResponseMessageresponse=awaitClient.PostAsync(url,jsonContent);}/// Serialize an object to JsonprivateStringContentSerializeObject(undefinedcontent){//Serialize ObjectstringjsonObject=JsonConvert.SerializeObject(content);//Create Json UTF8 String ContentreturnnewStringContent(jsonObject,Encoding.UTF8,"application/json");}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
POST /process/merge
Use this endpoint to merge two or more files. For example, you can convert multiple JPG or PNG files to a single PDF or GIF file.
# You can also use wget
curl -X GET https://api.freeconvert.com/v1/query/options/convert?input_format=string&output_format=string \-H'Accept: application/json'
<?phprequire'vendor/autoload.php';$headers=array('Accept'=>'application/json',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('GET','https://api.freeconvert.com/v1/query/options/convert',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakeGetRequest(){stringurl="https://api.freeconvert.com/v1/query/options/convert";varresult=awaitGetAsync(url);}/// Performs a GET RequestpublicasyncTaskGetAsync(stringurl){//Start the requestHttpResponseMessageresponse=awaitClient.GetAsync(url);//Validate resultresponse.EnsureSuccessStatusCode();}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
GET /query/options/convert
Use this endpoint to generate convert advanced options. Our getting started section can help grab a general idea of how to use the advanced options.
Parameters
Name
In
Type
Required
Description
input_format
query
string
true
input file extension
output_format
query
string
true
output file extension
Example responses
200 Response
{"sourceExt":"png","targetExt":"gif","operation":"convert","options":[{"name":"resize_type_image","label":"Resize Type","hint":"Choose a method if you want to resize the output image. This parameter has no effect but it's options may help you identify sub-options.","data_type":"string","type":"enum","enum_values":[{"value":"keep_original","label":"Keep original size"},{"value":"by_width_keep_ar","label":"Enter Width (px)"},{"value":"by_height_keep_ar","label":"Enter Height (px)"},{"value":"dimension","label":"Enter Width X Height (px)"},{"value":"percent","label":"As a percentage"}]},{"name":"image_custom_width","label":"Enter Width (px)","hint":"Enter target width in pixels. If no height is specified, we will keep the image's aspect ratio intact to avoid stretching","data_type":"number","depends_on":{"name":"resize_type_image","meta":[{"value":"dimension","label":"Enter Width X Height (px)"},{"value":"by_width_keep_ar","label":"Enter Width (px)"}]}},{"name":"image_resize_percentage","label":"Enter Percentage (%)","hint":"For example, 25 will make both width and height 25% of the original (1/4 of the original). Use this option when you want to resize output image \"As a percentage\" of original.","data_type":"number","default_value":"100","depends_on":{"name":"resize_type_image","meta":[{"value":"percent","label":"As a percentage"}]}},{"name":"image_custom_height","label":"Enter Height (px)","hint":"Enter target height in pixels. If no width is specified, we will keep the image's aspect ratio intact to avoid stretching","data_type":"number","depends_on":{"name":"resize_type_image","meta":[{"value":"by_height_keep_ar","label":"Enter Height (px)"},{"value":"dimension","label":"Enter Width X Height (px)"}]}},{"name":"strip","label":"Strip","hint":"Strip the image of any profiles, EXIF, and comments to reduce size","data_type":"boolean","default_value":"true"},{"name":"auto-orient","label":"Auto Orient","hint":"Correctly orient the image using the gravity sensor data stored in EXIF","data_type":"boolean","default_value":"true"},{"name":"trim_image","label":"Trim Image","hint":"Trim tall images from top & bottom to fit GIF width","data_type":"boolean","default_value":"true"},{"name":"gif_trim_image_in_pixel","label":"GIF width","hint":"Enter GIF width in pixels","data_type":"number","default_value":"480"}]}
# You can also use wget
curl -X GET https://api.freeconvert.com/v1/query/options/compress?input_format=string&output_format=string \-H'Accept: application/json'
<?phprequire'vendor/autoload.php';$headers=array('Accept'=>'application/json',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('GET','https://api.freeconvert.com/v1/query/options/compress',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakeGetRequest(){stringurl="https://api.freeconvert.com/v1/query/options/compress";varresult=awaitGetAsync(url);}/// Performs a GET RequestpublicasyncTaskGetAsync(stringurl){//Start the requestHttpResponseMessageresponse=awaitClient.GetAsync(url);//Validate resultresponse.EnsureSuccessStatusCode();}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
GET /query/options/compress
Use this endpoint to generate compress advanced options. Our getting started section can help grab a general idea of how to use the advanced options.
Parameters
Name
In
Type
Required
Description
input_format
query
string
true
input file extension
output_format
query
string
true
output file extension
Example responses
200 Response
{"sourceExt":"gif","targetExt":"gif","operation":"compress","options":[{"name":"gif_undo_optimization","label":"Undo Optimizations","hint":"May increase file size. Better for fixing buggy GIFs","data_type":"boolean","default_value":"false"},{"name":"gif_compress_reduce_frames","label":"Drop Frames to reduce the file size?","hint":"For certain types of GIFs, you maybe able to reduce file size further by dropping frames. Not available when \"Undo optimization\" is set to \"true\"","data_type":"string","type":"enum","enum_values":[{"value":"no-change","label":"None"},{"value":"duplicate","label":" Remove Duplicate Frames"},{"value":"n2","label":" Drop every 2nd frame"},{"value":"n3","label":" Drop every 3rd frame"},{"value":"n4","label":" Drop every 4th frame"},{"value":"n5","label":" Drop every 5th frame"}],"depends_on":{"name":"gif_undo_optimization","meta":[{"value":false,"label":""}]}},{"name":"gif_compress_match_frames_fuzz_factor","label":"Match Frames With Similar Colors?","hint":"This option lets you match identical frames with ‘similar’ colors. Higher values match more similar colors as identical. Available when \"Remove Duplicate Frames\" option is used along with gif_undo_optimization set to false.","data_type":"number","default_value":"5","units":"%","depends_on":{"name":"gif_compress_reduce_frames","meta":[{"value":"duplicate","label":" Remove Duplicate Frames"}]}},{"name":"gif_color","label":"Reduce colors?","hint":"This parameter is not used in operations but it's options may help you identify sub-options.","data_type":"number","default_value":"75","type":"enum","enum_values":[{"value":"no-change","label":"None"},{"value":"reduce","label":" Reduce the number of colors"},{"value":"reduce_dither","label":" Reduce the number of colors and dither"},{"value":"single","label":" Use a single color table"}],"depends_on":{"name":"gif_undo_optimization","meta":[{"value":false,"label":""}]}},{"name":"gif_compress_number_of_colors","label":"Number of colors?","hint":"GIF files support up to 256 different colors. Reducing the number of colors in colormap can reduce GIF file size. You can choose to reduce colors up to just 2 colors.","data_type":"number","default_value":"256","depends_on":{"name":"gif_color","meta":[{"value":"reduce","label":" Reduce the number of colors"},{"value":"reduce_dither","label":" Reduce the number of colors and dither"}]}},{"name":"gif_compression_level","label":"Compression level","hint":"Applies lossy LZW compression. Default (75) is a good balance between compression & quality. Higher values compress more. Not available with the \"Undo optimizations\" method.","data_type":"number","default_value":"75","depends_on":{"name":"gif_undo_optimization","meta":[{"value":false,"label":""}]}},{"name":"gif_optimize_transparency","label":"Optimize Transparency","hint":"Replace repeating/duplicate color pixels with transparency for better compression. Available when gif_undo_optimization set to false.","data_type":"boolean","default_value":"false","depends_on":{"name":"gif_undo_optimization","meta":[{"value":false,"label":""}]}},{"name":"gif_optimize_transparency_fuzz_factor","label":"Fuzz Factor","hint":"Match similar colors as equal. Available when \"gif_optimize_transparency\" is set to \"true\" and \"gif_undo_optimization\" set to \"false\".","data_type":"number","default_value":"5","units":"%","depends_on":{"name":"gif_optimize_transparency","meta":[{"value":true,"label":""}]}}]}
<?phprequire'vendor/autoload.php';$headers=array('Accept'=>'application/json',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('GET','https://api.freeconvert.com/v1/query/options/merge',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakeGetRequest(){stringurl="https://api.freeconvert.com/v1/query/options/merge";varresult=awaitGetAsync(url);}/// Performs a GET RequestpublicasyncTaskGetAsync(stringurl){//Start the requestHttpResponseMessageresponse=awaitClient.GetAsync(url);//Validate resultresponse.EnsureSuccessStatusCode();}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
GET /query/options/merge
Use this endpoint to generate merge advanced options. Our getting started section can help grab a general idea of how to use the advanced options."
Parameters
Name
In
Type
Required
Description
output_format
query
string
true
Output file extension matching the specified file types [gif, pdf]
Example responses
200 Response
{"sourceExt":"png","targetExt":"gif","operation":"merge","options":[{"name":"gif_loop_count","label":"Loop Count","hint":"Leave empty (0) to loop infinitely. Only applies when creating a GIF from multiple images.","data_type":"number"},{"name":"gif_frame_speed","label":"Frame Speed","hint":"Delay between frames (in 1/100 of a second). Only applies when creating a GIF from multiple images.","data_type":"number","default_value":"100"},{"name":"trim_image","label":"Trim images ?","hint":"Trim tall images from top & bottom to fit GIF width","data_type":"boolean","default_value":"true"},{"name":"gif_fill_color_smaller_image","label":"Fill color for smaller images","hint":"Fill color for smaller images","data_type":"string","default_value":"#000000","depends_on":{"name":"trim_image","meta":[{"value":false,"label":""}]}},{"name":"gif_trim_image_in_pixel","label":"GIF width","hint":"Enter GIF width in pixels","data_type":"number","default_value":"480"}]}
<?phprequire'vendor/autoload.php';$headers=array('Accept'=>'application/json',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('GET','https://api.freeconvert.com/v1/query/options/crop',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakeGetRequest(){stringurl="https://api.freeconvert.com/v1/query/options/crop";varresult=awaitGetAsync(url);}/// Performs a GET RequestpublicasyncTaskGetAsync(stringurl){//Start the requestHttpResponseMessageresponse=awaitClient.GetAsync(url);//Validate resultresponse.EnsureSuccessStatusCode();}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
GET /query/options/crop
Use this endpoint to generate crop advanced options. Our getting started section can help grab a general idea of how to use the advanced options.
Parameters
Name
In
Type
Required
Description
input_format
query
string
true
input file extension
output_format
query
string
true
output file extension
Example responses
200 Response
{"sourceExt":"mp4","targetExt":"mov","operation":"crop","options":[{"name":"crop-position-x","label":"Position-X","data_type":"float"},{"name":"crop-position-y","label":"Position-Y","data_type":"float","default_value":"0"},{"name":"video_crop","label":"Crop Video","hint":"Specify the video crop settings. Format is width:height:offset_x:offset_y. Where, width and height is that of the crop rectangle. Offset_x and y specify the crop rectangle position on original video.","data_type":"string","default_value":"0:0:0:0"}]}
<?phprequire'vendor/autoload.php';$headers=array('Accept'=>'application/json',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('GET','https://api.freeconvert.com/v1/query/options/trim',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakeGetRequest(){stringurl="https://api.freeconvert.com/v1/query/options/trim";varresult=awaitGetAsync(url);}/// Performs a GET RequestpublicasyncTaskGetAsync(stringurl){//Start the requestHttpResponseMessageresponse=awaitClient.GetAsync(url);//Validate resultresponse.EnsureSuccessStatusCode();}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
GET /query/options/trim
Use this endpoint to generate trim advanced options. Our getting started section can help grab a general idea of how to use the advanced options.
Parameters
Name
In
Type
Required
Description
input_format
query
string
true
input file extension
output_format
query
string
true
output file extension
Example responses
200 Response
{"sourceExt":"mp4","targetExt":"mov","operation":"trim","options":[{"name":"cut_start_trim","label":"Trim start","hint":"Specify trim start position in the video. Format is hh:mm:ss","data_type":"float","default_value":"0"},{"name":"cut_end_trim","label":"Trim end","hint":"Specify trim end position in the video. Format is hh:mm:ss","data_type":"float","default_value":"5"}]}
Webhook lets you receive status updates for your jobs and tasks. You can create webhooks using the
User Dashboard
Events
event
description
job.created
Emitted upon creating a new job
job.success
Emitted when a job completes successfully.
job.failed
Emits when a job has failed.
In all 3 cases, the payload includes the Job. See an example on the right side.
Failing Webhooks
If your webhook endpoint returns a 4XX or 5XX HTTP status code, we will re-try sending the webhook event up to 3 times (in 30-minute intervals. If you have enabled the "Webhook unreachable" notification from your user dashboard, we will also send you an email when a webhook fails.
If the webhook endpoint returns 410 status code, we will automatically disable this webhook. You can always re-enable it manually from the User Dashboard.
Signing Webhooks
For verifying that the webhook is actually coming from FreeConvert.com, you should validate it. When we send a webhook, we cryptographically sign it using a unique signing secret use this key to make sure the webhook is coming from us. You can get this secret by clicking the edit icon next to your webhook.
The FreeConvert-Signature header contains a hash-based message authentication code (HMAC) with SHA-256. Here is a PHP example on how to calculate this signature for validation:
$signingSecret can be found in the user dashboard's webhook settings (Click show on the SECRET column of the webhook). $payload is the full request body (the JSON string) that we sent to your webhook endpoint.
List Webhooks
Code samples
# You can also use wget
curl -X GET https://notification.freeconvert.com/webhooks \-H'Accept: application/json'\-H'Authorization: Bearer {access-token}'
<?phprequire'vendor/autoload.php';$headers=array('Accept'=>'application/json','Authorization'=>'Bearer {access-token}',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('GET','https://notification.freeconvert.com/webhooks',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakeGetRequest(){stringurl="https://notification.freeconvert.com/webhooks";varresult=awaitGetAsync(url);}/// Performs a GET RequestpublicasyncTaskGetAsync(stringurl){//Start the requestHttpResponseMessageresponse=awaitClient.GetAsync(url);//Validate resultresponse.EnsureSuccessStatusCode();}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
GET https://notification.freeconvert.com/webhooks
Lists all webhooks for the user
Parameters
Name
In
Type
Required
Description
url
query
string
false
List webhooks matching the specified url.
per_page
query
integer
false
Number of webhooks per page, defaults to 50. Limited at 200.
page
query
integer
false
If the list of webhooks include multiple pages, this specify which page to show.
Successful jobs lookup, returns a list of jobs in the response body. You can get more details on the response format by referring to Show a Job endpoint
# You can also use wget
curl -X POST https://notification.freeconvert.com/webhooks \-H'Content-Type: application/json'\-H'Accept: application/json'\-H'Authorization: Bearer {access-token}'
<?phprequire'vendor/autoload.php';$headers=array('Content-Type'=>'application/json','Accept'=>'application/json','Authorization'=>'Bearer {access-token}',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('POST','https://notification.freeconvert.com/webhooks',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakePostRequest(){stringurl="https://notification.freeconvert.com/webhooks";awaitPostAsync(null,url);}/// Performs a POST RequestpublicasyncTaskPostAsync(undefinedcontent,stringurl){//Serialize ObjectStringContentjsonContent=SerializeObject(content);//Execute POST requestHttpResponseMessageresponse=awaitClient.PostAsync(url,jsonContent);}/// Serialize an object to JsonprivateStringContentSerializeObject(undefinedcontent){//Serialize ObjectstringjsonObject=JsonConvert.SerializeObject(content);//Create Json UTF8 String ContentreturnnewStringContent(jsonObject,Encoding.UTF8,"application/json");}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
POST https://notification.freeconvert.com/webhooks
Create a webhook to receive task/job updates in your application.
<?phprequire'vendor/autoload.php';$headers=array('Authorization'=>'Bearer {access-token}',);$client=new\GuzzleHttp\Client();// Define array of request body.$request_body=array();try{$response=$client->request('DELETE','https://notification.freeconvert.com/webhooks/{webhookId}',array('headers'=>$headers,'json'=>$request_body,));print_r($response->getBody()->getContents());}catch(\GuzzleHttp\Exception\BadResponseException$e){// handle exception or api errors.print_r($e->getMessage());}// ...
usingSystem;usingSystem.Collections.Generic;usingSystem.Net.Http;usingSystem.Net.Http.Headers;usingSystem.Text;usingSystem.Threading.Tasks;usingNewtonsoft.Json;/// <<summary>>/// Example of Http Client/// <</summary>>publicclassHttpExample{privateHttpClientClient{get;set;}/// <<summary>>/// Setup http client/// <</summary>>publicHttpExample(){Client=newHttpClient();}/// Make a dummy requestpublicasyncTaskMakeDeleteRequest(){intid=1;stringurl="https://notification.freeconvert.com/webhooks/{webhookId}";awaitDeleteAsync(id,url);}/// Performs a DELETE RequestpublicasyncTaskDeleteAsync(intid,stringurl){//Execute DELETE requestHttpResponseMessageresponse=awaitClient.DeleteAsync(url+$"/{id}");//Return responseawaitDeserializeObject(response);}/// Deserialize object from request responseprivateasyncTaskDeserializeObject(HttpResponseMessageresponse){//Read body stringresponseBody=awaitresponse.Content.ReadAsStringAsync();//Deserialize Body to objectvarresult=JsonConvert.DeserializeObject(responseBody);}}
constsocket=io("https://notification.freeconvert.com/",{transports:["websocket"],path:"/socket.io",auth:{token:`Bearer ${YOUR_TOKEN_HERE}`},});//for subscribe job and tasksocket.emit("subscribe",`job.{jobId}`);socket.emit("subscribe",`task.{taskId}`);//for unsubscribe job and tasksocket.emit("unsubscribe",`job.{jobId}`);socket.emit("unsubscribe",`task.{taskId}`);socket.on("task_started",(data)=>{console.log("task_started",data);});socket.on("job_started",(data)=>{console.log("job_started",data);});
If you would like to receive real-time updates of your tasks and jobs, you can use FreeConvert.com Socket API. The hostname for Socket.io updates is notification.freeconvert.com. Socket.io clients are available in Javascript and many other languages. Please see API code examples.
To join a channel, you must authorize using the Authorization: Bearer API_KEY as shown to the right.
Note:
When you initiate a job with the Create job API, you would receive real-time updates of your tasks and jobs via WebSocket. In rare cases, an export job may become completed even before you have subscribed to WebSocket. To avoid this you may call the Get job API once after the WebSocket subscription just to check if the job has finished and have the result ready.
The best practice would be to check if the socket returns the expected url value just after the subscription. If not call the Get job API once and manually check the value. If the GET API doesn’t return the url, the job is still processing.
Friendly name of the task specified by you. Can be used to reference other tasks inside a job.
operation
string
true
none
Name of the operation. For example, to upload a file to FreeConvert using the URL upload method requires a task with operation import/url. Possible operations are [ import/url, import/upload, import/googlecloud, import/azureblob, import/s3, import/sftp, import/base64, convert, compress, merge, export/url, export/googlecloud, export/azureblob, export/s3, export/sftp, ]
status
string
false
read-only
Status of the task. Can be one of [created, processing, completed, failed, canceled, deleted].
payload
object
false
none
Parameters sent by you for the task. Payload depends on the type of operation of the task.
dependsOn
array
false
read-only
The task IDs that this task depends on. This task will be automatically started once all depends tasks are complete.
job
string(uuid)
false
read-only
The Job ID the task belongs to.
user
string(uuid)
false
read-only
The user ID the task belongs to.
result
object
false
read-only
Shows the result of the task. If the task has succesfully finished, result property will list the created file(s) here.
» url
string
false
read-only
If the task succeeded, contains the resulting file's download url.
» errorCode
string
false
read-only
If the task failed, contains the error code indicating the cause. -upload_timeout: 'import/upload' task timed out before the uplaod completed. - out_of_conversion_minutes: User ran out of conversion minutes. - out_of_conversion_minutes_per_task: The task reached max conversion minutes usage per task. - insufficient_permission: External storage Import or Export task failed due to insufficient permissions. - invalid_credentials: External storage Import or Export task failed due to specified credentials were invalid. processing_failed: Generic task processing failure. task_failed: Task failed due to the Job faile. unsupported_multifile: Multi-file import task creation not allowed outside a Job.
» msg
string
false
read-only
Contains further details about why a task failed, if any.
createdAt
string(date-time)
false
read-only
Timestamp of when the task is created. Format ISO8601.
startedAt
string(date-time)
false
read-only
Timestamp of when the task processing is started. Format ISO8601.
endedAt
string(date-time)
false
read-only
Timestamp of when the task finished. Format ISO8601.
updatedAt
string(date-time)
false
read-only
Timestamp of when the task was last updated. Format ISO8601.
expiresAt
string(date-time)
false
read-only
Timestamp of when the task is automatically expired and deleted. Format ISO8601.