Sunteți pe pagina 1din 32

{

"swagger": "2.0",
"info": {
"title": "Online Convert",
"termsOfService": "http:\/\/www.online-convert.com\/terms",
"contact": {
"email": "time2talk@online-convert.com"
},
"version": "2.0.1"
},
"host": "api2.online-convert.com",
"schemes": [
"https",
"http"
],
"consumes": [
"application\/json"
],
"produces": [
"application\/json"
],
"tags": [
{
"name": "Jobs",
"description": "Operation related to jobs."
},
{
"name": "Information",
"description": "Static information used in the Jobs operations."
},
{
"name": "Conversion",
"description": "Operations with the conversions made for a job."
},
{
"name": "Input",
"description": "Operations with the input files for a job."
},
{
"name": "Output",
"description": "Operations with the output files for a job."
},
{
"name": "Statistics",
"description": "Statistics infomations about API usage."
}
],
"paths": {
"\/jobs": {
"get": {
"summary": "List of jobs active for the current user identified by
the key.",
"description": "It will return the list of jobs for the given user.
In order to get the jobs a key or token must be provided:\n - If the user key is
provided all jobs for the current will be return.\n - If one token is provided it
will return the job assigned to that token if any.\n\nThe request is paginated with
an amount of 50 elements per page in any case.\n",
"tags": [
"Jobs"
],
"parameters": [
{
"name": "status",
"in": "query",
"description": "Filter the status of the job.",
"required": false,
"type": "string"
},
{
"name": "X-Oc-Token",
"in": "header",
"description": "Token for authentication for the current
job",
"required": false,
"type": "string"
},
{
"in": "header",
"name": "X-Oc-Api-Key",
"description": "Api key for the user to filter.",
"required": false,
"type": "string"
},
{
"name": "page",
"in": "query",
"description": "Pagination for list of elements.",
"required": false,
"type": "number",
"default": 1
}
],
"responses": {
"200": {
"description": "Gets the newly created job info",
"schema": {
"type": "array",
"items": {
"$ref": "#\/definitions\/Job"
}
}
},
"401": {
"description": "No API key or invalid API key given.",
"schema": {
"$ref": "#\/definitions\/Error"
}
},
"400": {
"description": "Invalid input.",
"schema": {
"$ref": "#\/definitions\/Error"
}
}
}
},
"post": {
"summary": "Creates a new Job with the user key.",
"tags": [
"Jobs"
],
"parameters": [
{
"in": "header",
"name": "X-Oc-Api-Key",
"description": "Api key for the user to filter.",
"required": true,
"type": "string"
},
{
"in": "header",
"name": "X-Oc-Debug-Server",
"description": "Defines which server should be used",
"type": "string"
},
{
"in": "body",
"name": "body",
"description": "Content of the job.",
"required": true,
"schema": {
"$ref": "#\/definitions\/Job"
}
},
{
"name": "X-Oc-Token",
"in": "header",
"description": "Token for authentication for the current
job",
"required": false,
"type": "string"
},
{
"in": "header",
"name": "X-Oc-Api-Key",
"description": "Api key for the user to filter.",
"required": false,
"type": "string"
}
],
"responses": {
"201": {
"description": "Gets the newly created job info",
"schema": {
"$ref": "#\/definitions\/Job"
}
},
"204": {
"description": "The JSON body is empty.",
"schema": {
"$ref": "#\/definitions\/Error"
}
},
"400": {
"description": "Invalid input.",
"schema": {
"$ref": "#\/definitions\/Error"
}
},
"429": {
"description": "Too many concurrent requests.",
"schema": {
"$ref": "#\/definitions\/Error"
}
},
"500": {
"description": "Server not available.",
"schema": {
"$ref": "#\/definitions\/Error"
}
},
"401": {
"description": "No API key or invalid API key given.",
"schema": {
"$ref": "#\/definitions\/Error"
}
}
}
}
},
"\/jobs\/{job_id}": {
"get": {
"summary": "Get information about a Job",
"tags": [
"Jobs"
],
"parameters": [
{
"name": "X-Oc-Token",
"in": "header",
"description": "Token for authentication for the current
job",
"required": false,
"type": "string"
},
{
"in": "header",
"name": "X-Oc-Api-Key",
"description": "Api key for the user to filter.",
"required": false,
"type": "string"
},
{
"name": "job_id",
"in": "path",
"description": "ID of job that needs to be fetched",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Get information about a Job",
"schema": {
"$ref": "#\/definitions\/Job"
}
},
"401": {
"description": "No API key or invalid API key given.",
"schema": {
"$ref": "#\/definitions\/Error"
}
},
"404": {
"description": "The specified job does not exists.",
"schema": {
"$ref": "#\/definitions\/Error"
}
}
}
},
"patch": {
"summary": "Modifies the job identified by the id, allows to start
a created job.",
"tags": [
"Jobs"
],
"parameters": [
{
"in": "body",
"name": "body",
"description": "Content of the job.",
"required": true,
"schema": {
"$ref": "#\/definitions\/Job"
}
},
{
"name": "X-Oc-Token",
"in": "header",
"description": "Token for authentication for the current
job",
"required": false,
"type": "string"
},
{
"in": "header",
"name": "X-Oc-Api-Key",
"description": "Api key for the user to filter.",
"required": false,
"type": "string"
},
{
"name": "job_id",
"in": "path",
"description": "ID of job that needs to be fetched",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Get information about the removed Job",
"schema": {
"$ref": "#\/definitions\/Job"
}
},
"409": {
"description": "The status of the job could not be changed
since it is in a invalid status.",
"schema": {
"$ref": "#\/definitions\/Error"
}
},
"401": {
"description": "No API key or invalid API key given.",
"schema": {
"$ref": "#\/definitions\/Error"
}
},
"404": {
"description": "The specified job does not exists.",
"schema": {
"$ref": "#\/definitions\/Error"
}
}
}
},
"delete": {
"summary": "Cancels a job created that haven\u0027t been started.
(Allow to cancel jobs in process.)",
"tags": [
"Jobs"
],
"parameters": [
{
"name": "X-Oc-Token",
"in": "header",
"description": "Token for authentication for the current
job",
"required": false,
"type": "string"
},
{
"in": "header",
"name": "X-Oc-Api-Key",
"description": "Api key for the user to filter.",
"required": false,
"type": "string"
},
{
"name": "job_id",
"in": "path",
"description": "ID of job that needs to be fetched",
"required": true,
"type": "string"
}
],
"responses": {
"204": {
"description": "The job has been deleted"
},
"401": {
"description": "No API key or invalid API key given.",
"schema": {
"$ref": "#\/definitions\/Error"
}
},
"404": {
"description": "The specified job does not exists.",
"schema": {
"$ref": "#\/definitions\/Error"
}
},
"405": {
"description": "The job can not be modified",
"schema": {
"$ref": "#\/definitions\/Error"
}
}
}
}
},
"\/jobs\/{job_id}\/conversions": {
"get": {
"summary": "Get list of conversions defined for the current job.",
"tags": [
"Conversion"
],
"parameters": [
{
"name": "X-Oc-Token",
"in": "header",
"description": "Token for authentication for the current
job",
"required": false,
"type": "string"
},
{
"in": "header",
"name": "X-Oc-Api-Key",
"description": "Api key for the user to filter.",
"required": false,
"type": "string"
},
{
"name": "job_id",
"in": "path",
"description": "ID of job that needs to be fetched",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Get a list of all available conversions.",
"schema": {
"type": "array",
"items": {
"$ref": "#\/definitions\/Conversion"
}
}
},
"401": {
"description": "No API key or invalid API key given.",
"schema": {
"$ref": "#\/definitions\/Error"
}
},
"404": {
"description": "The specified job does not exists.",
"schema": {
"$ref": "#\/definitions\/Error"
}
}
}
},
"post": {
"summary": "Adds a new conversion to the given job.",
"tags": [
"Conversion"
],
"parameters": [
{
"in": "body",
"name": "body",
"description": "information for the conversion.",
"required": true,
"schema": {
"$ref": "#\/definitions\/Conversion"
}
},
{
"name": "X-Oc-Token",
"in": "header",
"description": "Token for authentication for the current
job",
"required": false,
"type": "string"
},
{
"in": "header",
"name": "X-Oc-Api-Key",
"description": "Api key for the user to filter.",
"required": false,
"type": "string"
},
{
"name": "job_id",
"in": "path",
"description": "ID of job that needs to be fetched",
"required": true,
"type": "string"
}
],
"responses": {
"201": {
"description": "The created conversion.",
"schema": {
"$ref": "#\/definitions\/Conversion"
}
},
"400": {
"description": "Invalid input.",
"schema": {
"$ref": "#\/definitions\/Error"
}
},
"401": {
"description": "No API key or invalid API key given.",
"schema": {
"$ref": "#\/definitions\/Error"
}
},
"404": {
"description": "The specified job does not exists.",
"schema": {
"$ref": "#\/definitions\/Error"
}
}
}
}
},
"\/jobs\/{job_id}\/conversions\/{conversion_id}": {
"get": {
"summary": "Get list of conversions defined for the current job.",
"tags": [
"Conversion"
],
"parameters": [
{
"name": "X-Oc-Token",
"in": "header",
"description": "Token for authentication for the current
job",
"required": false,
"type": "string"
},
{
"in": "header",
"name": "X-Oc-Api-Key",
"description": "Api key for the user to filter.",
"required": false,
"type": "string"
},
{
"name": "job_id",
"in": "path",
"description": "ID of job that needs to be fetched",
"required": true,
"type": "string"
},
{
"name": "conversion_id",
"in": "path",
"description": "Identifier for the job conversion.",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Get a conversion for the current job",
"schema": {
"$ref": "#\/definitions\/Conversion"
}
},
"401": {
"description": "No API key or invalid API key given.",
"schema": {
"$ref": "#\/definitions\/Error"
}
},
"404": {
"description": "The specified job does not exists.",
"schema": {
"$ref": "#\/definitions\/Error"
}
}
}
},
"delete": {
"summary": "Removes the conversion for a job.",
"tags": [
"Conversion"
],
"parameters": [
{
"name": "X-Oc-Token",
"in": "header",
"description": "Token for authentication for the current
job",
"required": false,
"type": "string"
},
{
"in": "header",
"name": "X-Oc-Api-Key",
"description": "Api key for the user to filter.",
"required": false,
"type": "string"
},
{
"name": "job_id",
"in": "path",
"description": "ID of job that needs to be fetched",
"required": true,
"type": "string"
},
{
"name": "conversion_id",
"in": "path",
"description": "Identifier for the job conversion.",
"required": true,
"type": "string"
}
],
"responses": {
"204": {
"description": "The conversion has been deleted"
},
"401": {
"description": "No API key or invalid API key given.",
"schema": {
"$ref": "#\/definitions\/Error"
}
},
"404": {
"description": "The specified job does not exists.",
"schema": {
"$ref": "#\/definitions\/Error"
}
},
"405": {
"description": "The job can not be modified",
"schema": {
"$ref": "#\/definitions\/Error"
}
}
}
}
},
"\/jobs\/{job_id}\/input": {
"get": {
"summary": "Get list of binary source files for the
conversion.hhh",
"description": "Description of the get for the inputs of a specific
job.",
"tags": [
"Input"
],
"parameters": [
{
"name": "X-Oc-Token",
"in": "header",
"description": "Token for authentication for the current
job",
"required": false,
"type": "string"
},
{
"in": "header",
"name": "X-Oc-Api-Key",
"description": "Api key for the user to filter.",
"required": false,
"type": "string"
},
{
"name": "job_id",
"in": "path",
"description": "ID of job that needs to be fetched",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Downloads the binary for the file.",
"schema": {
"type": "array",
"items": {
"$ref": "#\/definitions\/InputFile"
}
}
},
"401": {
"description": "No API key or invalid API key given.",
"schema": {
"$ref": "#\/definitions\/Error"
}
},
"404": {
"description": "The specified job does not exists.",
"schema": {
"$ref": "#\/definitions\/Error"
}
}
}
},
"post": {
"summary": "Cretes a new input for the current job.",
"tags": [
"Input"
],
"parameters": [
{
"name": "body",
"in": "body",
"schema": {
"$ref": "#\/definitions\/InputFile"
}
},
{
"name": "X-Oc-Token",
"in": "header",
"description": "Token for authentication for the current
job",
"required": false,
"type": "string"
},
{
"in": "header",
"name": "X-Oc-Api-Key",
"description": "Api key for the user to filter.",
"required": false,
"type": "string"
},
{
"name": "job_id",
"in": "path",
"description": "ID of job that needs to be fetched",
"required": true,
"type": "string"
}
],
"responses": {
"201": {
"description": "The created conversion.",
"schema": {
"$ref": "#\/definitions\/InputFile"
}
},
"401": {
"description": "No API key or invalid API key given.",
"schema": {
"$ref": "#\/definitions\/Error"
}
},
"404": {
"description": "The specified job does not exists.",
"schema": {
"$ref": "#\/definitions\/Error"
}
}
}
}
},
"\/jobs\/{job_id}\/input\/{file_id}": {
"get": {
"summary": "Get info on a specific job input",
"tags": [
"Input"
],
"parameters": [
{
"name": "X-Oc-Token",
"in": "header",
"description": "Token for authentication for the current
job",
"required": false,
"type": "string"
},
{
"in": "header",
"name": "X-Oc-Api-Key",
"description": "Api key for the user to filter.",
"required": false,
"type": "string"
},
{
"name": "job_id",
"in": "path",
"description": "ID of job that needs to be fetched",
"required": true,
"type": "string"
},
{
"name": "file_id",
"in": "path",
"description": "Id of the file to download",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Get a file for the current job",
"schema": {
"$ref": "#\/definitions\/InputFile"
}
},
"401": {
"description": "No API key or invalid API key given.",
"schema": {
"$ref": "#\/definitions\/Error"
}
},
"404": {
"description": "The specified job does not exists.",
"schema": {
"$ref": "#\/definitions\/Error"
}
}
}
},
"delete": {
"summary": "Removes the input for a job.",
"tags": [
"Input"
],
"parameters": [
{
"name": "X-Oc-Token",
"in": "header",
"description": "Token for authentication for the current
job",
"required": false,
"type": "string"
},
{
"in": "header",
"name": "X-Oc-Api-Key",
"description": "Api key for the user to filter.",
"required": false,
"type": "string"
},
{
"name": "job_id",
"in": "path",
"description": "ID of job that needs to be fetched",
"required": true,
"type": "string"
},
{
"name": "file_id",
"in": "path",
"description": "Id of the file to download",
"required": true,
"type": "string"
}
],
"responses": {
"204": {
"description": "The input file has been deleted"
},
"401": {
"description": "No API key or invalid API key given.",
"schema": {
"$ref": "#\/definitions\/Error"
}
},
"404": {
"description": "The specified job does not exists.",
"schema": {
"$ref": "#\/definitions\/Error"
}
},
"405": {
"description": "The job can not be modified",
"schema": {
"$ref": "#\/definitions\/Error"
}
}
}
}
},
"\/jobs\/{job_id}\/output": {
"get": {
"summary": "Get list of converted.",
"tags": [
"Output"
],
"parameters": [
{
"name": "conversion_id",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "input_id",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "X-Oc-Token",
"in": "header",
"description": "Token for authentication for the current
job",
"required": false,
"type": "string"
},
{
"in": "header",
"name": "X-Oc-Api-Key",
"description": "Api key for the user to filter.",
"required": false,
"type": "string"
},
{
"name": "job_id",
"in": "path",
"description": "ID of job that needs to be fetched",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Downloads the binary for the file",
"schema": {
"type": "array",
"items": {
"$ref": "#\/definitions\/OutputFile"
}
}
},
"401": {
"description": "No API key or invalid API key given.",
"schema": {
"$ref": "#\/definitions\/Error"
}
},
"404": {
"description": "The specified job does not exists.",
"schema": {
"$ref": "#\/definitions\/Error"
}
}
}
}
},
"\/jobs\/{job_id}\/output\/{file_id}": {
"get": {
"summary": "Get information about an output file source.",
"tags": [
"Output"
],
"parameters": [
{
"name": "X-Oc-Token",
"in": "header",
"description": "Token for authentication for the current
job",
"required": false,
"type": "string"
},
{
"in": "header",
"name": "X-Oc-Api-Key",
"description": "Api key for the user to filter.",
"required": false,
"type": "string"
},
{
"name": "job_id",
"in": "path",
"description": "ID of job that needs to be fetched",
"required": true,
"type": "string"
},
{
"name": "file_id",
"in": "path",
"description": "Id of the file to download",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Gets the information for the file.",
"schema": {
"$ref": "#\/definitions\/OutputFile"
}
},
"401": {
"description": "No API key or invalid API key given.",
"schema": {
"$ref": "#\/definitions\/Error"
}
},
"404": {
"description": "The specified job does not exists.",
"schema": {
"$ref": "#\/definitions\/Error"
}
}
}
},
"delete": {
"summary": "Deletes a file from the output.",
"tags": [
"Output"
],
"parameters": [
{
"name": "X-Oc-Token",
"in": "header",
"description": "Token for authentication for the current
job",
"required": false,
"type": "string"
},
{
"in": "header",
"name": "X-Oc-Api-Key",
"description": "Api key for the user to filter.",
"required": false,
"type": "string"
},
{
"name": "job_id",
"in": "path",
"description": "ID of job that needs to be fetched",
"required": true,
"type": "string"
},
{
"name": "file_id",
"in": "path",
"description": "Id of the file to download",
"required": true,
"type": "string"
}
],
"responses": {
"204": {
"description": "The output file has been deleted"
},
"401": {
"description": "No API key or invalid API key given.",
"schema": {
"$ref": "#\/definitions\/Error"
}
},
"404": {
"description": "The specified job does not exists.",
"schema": {
"$ref": "#\/definitions\/Error"
}
}
}
}
},
"\/jobs\/{job_id}\/threads": {
"get": {
"summary": "Get list of threads defined for the current job.",
"tags": [
"Jobs"
],
"parameters": [
{
"name": "X-Oc-Token",
"in": "header",
"description": "Token for authentication for the current
job",
"required": false,
"type": "string"
},
{
"in": "header",
"name": "X-Oc-Api-Key",
"description": "Api key for the user to filter.",
"required": false,
"type": "string"
},
{
"name": "job_id",
"in": "path",
"description": "ID of job that needs to be fetched",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Get a list of all threads currently being
processed.",
"schema": {
"type": "array",
"items": {
"$ref": "#\/definitions\/Thread"
}
}
},
"401": {
"description": "No API key or invalid API key given.",
"schema": {
"$ref": "#\/definitions\/Error"
}
},
"404": {
"description": "The specified job does not exists.",
"schema": {
"$ref": "#\/definitions\/Error"
}
}
}
}
},
"\/jobs\/{job_id}\/history": {
"get": {
"summary": "Get the change history for the current job.",
"tags": [
"Jobs"
],
"parameters": [
{
"name": "X-Oc-Token",
"in": "header",
"description": "Token for authentication for the current
job",
"required": false,
"type": "string"
},
{
"in": "header",
"name": "X-Oc-Api-Key",
"description": "Api key for the user to filter.",
"required": false,
"type": "string"
},
{
"name": "job_id",
"in": "path",
"description": "ID of job that needs to be fetched",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Get a list of all events for the current
job",
"schema": {
"type": "array",
"items": {
"$ref": "#\/definitions\/History"
}
}
},
"401": {
"description": "No API key or invalid API key given.",
"schema": {
"$ref": "#\/definitions\/Error"
}
},
"404": {
"description": "The specified job does not exists.",
"schema": {
"$ref": "#\/definitions\/Error"
}
}
}
}
},
"\/statuses": {
"get": {
"summary": "Get a list of the valid statuses.",
"description": "The endpoint provide a list of all available status
that the Job may have during the process as a description of the status.",
"tags": [
"Information"
],
"responses": {
"200": {
"description": "List of statuses",
"schema": {
"type": "array",
"items": {
"$ref": "#\/definitions\/Status"
}
}
}
}
}
},
"\/conversions": {
"get": {
"summary": "Get a list of the valid conversions.",
"description": "Gets a list of the valid conversions that can be
made with the API. For each conversion is also shown the available options for that
specific type of conversion.\n\nThis conversions can be added to a Job through the
specific endpoint or in the information given to create the new Job.\n",
"tags": [
"Information"
],
"parameters": [
{
"name": "category",
"in": "query",
"description": "Category for the conversion.",
"required": false,
"type": "string"
},
{
"name": "target",
"in": "query",
"description": "Target for for the conversion.",
"required": false,
"type": "string"
},
{
"name": "page",
"in": "query",
"description": "Pagination for list of elements.",
"required": false,
"type": "number",
"default": 1
}
],
"responses": {
"200": {
"description": "List of conversions",
"schema": {
"type": "array",
"items": {
"$ref": "#\/definitions\/ConversionList"
}
}
}
}
}
},
"\/stats\/day\/{day}\/{filter}": {
"get": {
"summary": "Get the statistics data for a specific day",
"description": "The endpoint provides the statistics data for a
specific day",
"tags": [
"Statistics"
],
"parameters": [
{
"in": "header",
"name": "x-oc-api-key",
"description": "Api key for the user to filter.",
"required": true,
"type": "string"
},
{
"name": "day",
"in": "path",
"description": "It must be in the format yyyy-mm-dd",
"required": true,
"type": "string"
},
{
"name": "filter",
"in": "path",
"description": "Allows to filter the statistics data for
all or a single API key",
"required": true,
"type": "string",
"enum": [
"single",
"all"
]
}
],
"responses": {
"200": {
"description": "Returns statistics data for the requested
day",
"schema": {
"type": "array"
}
},
"404": {
"description": "Invalid credentials",
"schema": {
"$ref": "#\/definitions\/Error"
}
}
}
}
},
"\/stats\/month\/{month}\/{filter}": {
"get": {
"summary": "Get the statistics data for a specific month",
"description": "The endpoint provides the statistics data for a
specific month",
"tags": [
"Statistics"
],
"parameters": [
{
"in": "header",
"name": "x-oc-api-key",
"description": "Api key for the user to filter.",
"required": true,
"type": "string"
},
{
"name": "month",
"in": "path",
"description": "It must be in the format yyyy-mm",
"required": true,
"type": "string"
},
{
"name": "filter",
"in": "path",
"description": "Allows to filter the statistics data for
all or a single API key",
"required": true,
"type": "string",
"enum": [
"single",
"all"
]
}
],
"responses": {
"200": {
"description": "Returns statistics data for the requested
month",
"schema": {
"type": "array"
}
},
"404": {
"description": "Invalid credentials",
"schema": {
"$ref": "#\/definitions\/Error"
}
}
}
}
},
"\/stats\/year\/{year}\/{filter}": {
"get": {
"summary": "Get the statistics data for a specific year",
"description": "The endpoint provides the statistics data for a
specific year",
"tags": [
"Statistics"
],
"parameters": [
{
"in": "header",
"name": "x-oc-api-key",
"description": "Api key for the user to filter.",
"required": true,
"type": "string"
},
{
"name": "year",
"in": "path",
"description": "It must be in the format yyyy",
"required": true,
"type": "string"
},
{
"name": "filter",
"in": "path",
"description": "Allows to filter the statistics data for
all or a single API key",
"required": true,
"type": "string",
"enum": [
"single",
"all"
]
}
],
"responses": {
"200": {
"description": "Returns statistics data for the requested
year",
"schema": {
"type": "array"
}
},
"404": {
"description": "Invalid credentials",
"schema": {
"$ref": "#\/definitions\/Error"
}
}
}
}
}
},
"definitions": {
"Job": {
"properties": {
"id": {
"type": "string",
"example": "8daae6d1-26e0-11e5-b2a1-0800273b325b",
"description": "Unique identifier for the job."
},
"token": {
"type": "string",
"example": "12srxin63mgp23f8mtny2rgtgl1nl39i",
"description": "Token to identify client allowed to run the
job."
},
"type": {
"type": "string",
"enum": [
"job"
],
"default": "job",
"description": "Type of the job created."
},
"status": {
"$ref": "#\/definitions\/Status",
"description": "Current status for the job"
},
"errors": {
"type": "array",
"items": {
"$ref": "#\/definitions\/UserError"
},
"description": "Errors that happens in downloads or
conversions"
},
"warnings": {
"type": "array",
"items": {
"$ref": "#\/definitions\/UserWarning"
},
"description": "Warnings that happens in downloads or
conversions"
},
"process": {
"type": "boolean",
"default": true,
"description": "Determine if the job must be processed as soon
as it is ready."
},
"conversion": {
"description": "Type of conversion or conversions to be carried
out.",
"type": "array",
"items": {
"$ref": "#\/definitions\/Conversion"
}
},
"input": {
"type": "array",
"items": {
"$ref": "#\/definitions\/InputFile"
},
"description": "Source or sources of the files to be
converted."
},
"output": {
"type": "array",
"items": {
"$ref": "#\/definitions\/OutputFile"
},
"description": "Output or Outputs of the conversion."
},
"callback": {
"type": "string",
"description": "Callback url to the the status updates",
"example": "http:\/\/www.mysite.com\/callback"
},
"notify_status": {
"type": "boolean",
"default": false,
"description": "If set to true, a callback will be sent for
each job status change"
},
"server": {
"type": "string",
"description": "Server assigned for file uploads and
downloads",
"example": "api5\/\/www.online-convert.com"
},
"spent": {
"type": "integer",
"description": "Conversion minutes spent to complete the job",
"example": 2
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Date and time when the job was created."
},
"modified_at": {
"type": "string",
"format": "date-time",
"description": "Date and time when the job was last modified."
}
},
"required": [
"type"
]
},
"InputFile": {
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "8daae6d1-26e0-11e5-b2a1-0800273b325b",
"description": "Unique identifier for the file."
},
"type": {
"type": "string",
"enum": [
"upload",
"remote",
"output",
"input_id",
"gdrive_picker",
"base64",
"cloud"
],
"default": "remote",
"description": "How the file has been generated."
},
"source": {
"type": "string",
"example": "http:\/\/www.dropbox.com\/f\/sfasdfhasdjkr434fadf",
"description": "The source of the file to be used that can be
either, an external url, an identifier for an uploaded file to the server, an
identifier for another input or the cloud storage (e.g. amazons3)."
},
"filename": {
"type": "string",
"example": "image.png",
"description": "Filename of the file."
},
"size": {
"type": "integer",
"example": 12835187,
"description": "Size of the file in bytes."
},
"hash": {
"type": "string",
"example": "da39a3ee5e6b4b0d3255bfef95601890afd80709",
"description": "(deprecated, use checksum instead) File hash
for content verification"
},
"checksum": {
"type": "string",
"example": "da39a3ee5e6b4b0d3255bfef95601890afd80709",
"description": "Hash for content verification"
},
"content_type": {
"type": "string",
"example": "video\/mp4",
"description": "Content type for file conversion definition"
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Date and time when the job was created."
},
"modified_at": {
"type": "string",
"format": "date-time",
"description": "Date and time when the job was last modified."
},
"credentials": {
"type": "object",
"example": "{\u0022token\u0022: \u00222134ffa487\u0022}",
"description": "Credentials needed to download the input file."
},
"parameters": {
"type": "object",
"example": "{\u0022bucket\u0022: \u0022some.s3.bucket\u0022}",
"description": "Any extra parameter that is specified in the
documentation, if not recognized, it will be ignored."
}
},
"required": [
"source"
]
},
"OutputFile": {
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "8daae6d1-26e0-11e5-b2a1-0800273b325b",
"description": "Unique identifier for the file."
},
"source": {
"type": "object",
"properties": {
"conversion": {
"type": "string"
},
"input": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Sources for the files including the input files
and conversion used."
},
"uri": {
"type": "string",
"example": "http:\/\/www3.online-convert.com",
"description": "Url for downloading the file."
},
"size": {
"type": "integer",
"example": 12835187,
"description": "Size of the file in bytes."
},
"status": {
"type": "string",
"enum": [
"enabled",
"disabled"
],
"example": "enabled",
"description": "Status of the output, when disabled the file
will not be able to download."
},
"content_type": {
"type": "string",
"example": "image\/jpg",
"description": "The mime type of the output file."
},
"downloads_counter": {
"type": "integer",
"example": 2,
"description": "Number of times the output has been
downloaded."
},
"checksum": {
"type": "string",
"example": "ABCD",
"description": "Checksum of the file"
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Date and time when the job was created."
}
},
"required": [
"id"
]
},
"Conversion": {
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "8daae6d1-26e0-11e5-b2a1-0800273b325b",
"description": "Identifier for the job conversion."
},
"target": {
"type": "string",
"example": "mp3",
"description": "Identifier for the job conversion type."
},
"category": {
"type": "string",
"example": "audio",
"description": "Category for the conveted file."
},
"options": {
"type": "object",
"default": [],
"example": {
"bitrate": "320kbps",
"stereo": true
},
"description": "Type of conversion to perform with the file."
},
"metadata": {
"type": "object",
"default": [],
"example": {
"clear_all": true,
"author": "your name"
},
"description": "Metadata to be inserted\/updated\/deleted"
},
"output_target": {
"type": "array",
"items": {
"$ref": "#\/definitions\/OutputTarget"
}
}
},
"required": [
"target"
]
},
"ConversionList": {
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "8daae6d1-26e0-11e5-b2a1-0800273b325b",
"description": "Identifier for the job conversion."
},
"target": {
"type": "string",
"example": "mp3",
"description": "Identifier for the job conversion type."
},
"category": {
"type": "string",
"example": "audio",
"description": "Category for the conveted file."
},
"options": {
"type": "object",
"default": [],
"example": {
"bitrate": "320kbps",
"stereo": true
},
"description": "Type of conversion to perform with the file."
}
},
"required": [
"target"
]
},
"OutputTarget": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"amazons3",
"googlecloud",
"azure",
"ftp"
]
},
"status": {
"type": "string",
"enum": [
"waiting",
"uploading",
"completed",
"failed"
]
},
"parameters": {
"type": "object",
"default": []
},
"credentials": {
"type": "object",
"default": []
}
},
"required": [
"type"
]
},
"Thread": {
"type": "object",
"properties": {
"hash": {
"type": "string",
"description": "Unique identifier of the thread."
},
"status": {
"type": "integer",
"description": "Status of the thread."
},
"info": {
"type": "string",
"description": "Extra information."
},
"exec_time": {
"type": "integer",
"description": "Execution time for the thread in seconds"
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Date and time when the job was created."
},
"modified_at": {
"type": "string",
"format": "date-time",
"description": "Date and time when the job was last modified."
}
}
},
"History": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Unique identifier of the event."
},
"status": {
"type": "string",
"description": "Status of the job."
},
"info": {
"type": "string",
"description": "Addtional information."
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Date and time when the job was created."
}
}
},
"Status": {
"properties": {
"code": {
"type": "string",
"example": "processing",
"description": "Status code identifier."
},
"info": {
"type": "string",
"example": "The file is being processed.",
"description": "Description of the status code."
}
},
"required": [
"code",
"info"
]
},
"Error": {
"properties": {
"code": {
"type": "integer",
"format": "int32",
"example": 8
},
"message": {
"type": "string",
"example": "The JSON body is empty"
},
"errors": {
"type": "object"
}
}
},
"UserError": {
"properties": {
"source": {
"type": "string",
"description": "The source of the error in the Job definition.
Can be one of \u0022input\u0022 or \u0022conversion\u0022",
"example": "input"
},
"id_source": {
"type": "string",
"description": "The unique identifier of the source",
"example": "8daae6d1-26e0-11e5-b2a1-0800273b325b"
},
"code": {
"type": "integer",
"description": "A machine readable error code",
"example": 404
},
"message": {
"type": "string",
"description": "A human readable error message",
"example": "The file could not be downloaded by our servers.
Please verify the link you have provided."
}
}
},
"UserWarning": {
"properties": {
"source": {
"type": "string",
"description": "The source of the warning in the Job
definition. Can be one of \u0022input\u0022 or \u0022conversion\u0022",
"example": "input"
},
"id_source": {
"type": "string",
"description": "The unique identifier of the source",
"example": "8daae6d1-26e0-11e5-b2a1-0800273b325b"
},
"code": {
"type": "integer",
"description": "A machine readable warning code",
"example": 404
},
"message": {
"type": "string",
"description": "A human readable warning message",
"example": "Impossible to write metadata inside the file"
}
}
}
}
}

S-ar putea să vă placă și