Vertopal
API Menu

Convert Formats Relation

POST /v1/convert/graph

Gets the relation between the input format and the output format for file conversion.

Request

Parameter Keys

input string required

The input format. If the input format also has a type, separate it with a hyphen.

Example
txt-markdown
output string required

The output format. If the output format also has a type, separate it with a hyphen.

Example
tex-beamer
The example code of this section shows the structure of the Convert Formats Relation request. You may see the other request structure keys such as data keys and see how the request is authenticated.
HTTP
cURL
CLI
POST https://api.vertopal.com/v1/convert/graph
Authorization: Bearer [APP_TOKEN]

data={
    "app": "[APP_ID]",
    "parameters": {
        "input": "png",
        "output": "jpg"
    }
}
curl -L -X POST 'https://api.vertopal.com/v1/convert/graph' \
-H 'Authorization: Bearer [APP_TOKEN]' \
-F 'data={
    "app": "[APP_ID]",
    "parameters": {
        "input": "png",
        "output": "jpg"
    }
}'
vertopal api -v 1 convert/graph \
--app "[APP_ID]" \
--token "[APP_TOKEN]" \
-F data='{
    "app": "%app-id%",
    "parameters": {
        "input": "png",
        "output": "jpg"
    }
}'

Response

Output Keys

is_match boolean

Indicates converter availability for converting the input format to the output format.

is_reversable boolean

Assumes that the input and output are interchanged. Indicates converter availability for converting the output format to the input format.

HTTP Status Codes

OK 200

The task has been executed successfully without any errors.

INVALID_INPUT_FORMAT 200

The [INPUT] format is not found in the valid input formats.

INVALID_OUTPUT_FORMAT 200

The [OUTPUT] format is not found in the valid output formats.

WRONG_INPUT_FORMAT_STRUCTURE 200

The input format has the wrong structure.

WRONG_OUTPUT_FORMAT_STRUCTURE 200

The output format has the wrong structure.

The example code of this section shows the structure of the Convert Formats Relation response. You may see the other response structure keys such as entity keys.
JSON
{
    "result": {
        "output": {
            "is_match": true,
            "is_reversable": true
        },
        "error": {},
        "warning": {}
    }
}
Loading, Please Wait...