Start a new conversion
The function recognizes (OCR) data in a file specified in the InputFile parameter and returns a converted file in a form of structured data in a format specified in the OutputFileFormat parameter.
Issue a following POST request, To start recognizing data in a file:
POST
https://converttodata.com/
converttodata/hs/api/v1/convert
https://converttodata.com/
converttodata/hs/api/v1/convert
Usage example:
curl -i -X POST -d
curl -i -X POST -d '{"apikey": "_YOUR_API_KEY_", "inputfile":"http://google.com/",
"outputfileformat":"json"}'
https://converttodata.com/converttodata
/hs/api/v1/convert
/hs/api/v1/convert
Parameter
Field | Type | Description |
ApiKey | String | Your API Key. (Required) |
InputFile | String | URL of the input file (if input=url), or file content (if input = raw/base64). (Required) |
OutputFileFormat | String | Output format, to which the file should be converted to. Available values: - json; - xml; - csv; - xlsx. Default "json". |
Return SUCCESS
Field | Type | Description |
AvailableFiles | String | Conversion API credits available on balance. |
FileName | String | Original file name. |
IsError | Boolean | Error flag during conversion. Returns True if there were errors, otherwise False. |
ErrorReason | String | Contains error description if parameter IsError = True. |
Rows | String | Recognized data from a file. |
Success Response (example) (OutputFileFormat = "json" or not specified):
HTTP/1.1 200 OK
{
"AvailableFiles": 1000,
"FileName": "MYTEST.pdf",
"IsError": "False",
"ErrorReason": "",
"Rows": [
{"Description": "product 1",
"Count": 2
"Price": 50
"Total": 100
}
{"Description": "product 2",
"Count": 3
"Price": 30
"Total": 90}
]
}
Error Response (example) (OutputFileFormat = "json" or not specified):
HTTP/1.1 500 Invalid request
{
"AvailableFiles": 0,
"IsError": "true",
"ErrorReason": "Error: Invalid request",
}