SQLizer Logo

Easily convert files into SQL databases

GET /api/files/{ID}

This endpoint can be used to fetch details of an ongoing file conversion. The ID value in the URI should come from the response to a POST request to /api/files/.

In response to this request, SQLizer will either reply with a HTTP 404 code, or a JSON representation of the file conversion.

The response will contain a single JSON object, with the following properties:

Property Type Remarks
ID String A base64 ID for the current file entity
FileName String The name of the file that was (or is being) uploaded.
FileType String The type of file being converted. This will be either: "csv", "json", "xlsx" or "xml".
DatabaseType String The type of SQL syntax being generated. This will be either: "MySQL", "SQLServer", "PostgreSQL" or "SQLite".
TableName String The table name that was requested when the conversion was initiated. SQLizer may alter this value in the final SQL file that is produced. Anything other than alphanumeric characters and underscores will be removed.
Status String Will be one of the following values: "New", "Uploaded", "Analysing", "Processing", "Complete", "Failed", "SubscriptionRequired", "PaymentRequired". See below for details on what each status means.
CheckTableExists Boolean Indicates whether the resulting SQL file will check the table doesn't exist before attempting to create it.
InsertSpacing Integer The number of rows of values to generate per insert statement.
FileHasHeaders Boolean Indicates whether the first row of the input file is being used as the set of column names and excluding from the analysis of what data type each column is.
Delimiter String When converting csv files, this value contains the value that will be used to separate column values. For example: ","
SheetName String When converting Excel files, this value contains the name of the worksheet that data is being loaded from.
CellRange String When converting Excel files, this value contains the cell range that data is being loaded from. This value will be similar to "A1:GB10000"
PercentComplete Integer During the upload, analysing or processing stages, this value indicates how far through that stage SQLizer believes it is.
ResultUrl String Once the conversion reaches a status of "Complete" this property contains the location of the SQL file that has been produced. The file at that URL can be downloaded without the SQLizer authorisation header.
ResultRows Integer Once the conversion reaches a status of "Complete" this property contains the number of result rows of data SQLizer found in the input file and has added to the resulting SQL file.
Message String If the conversion reaches a status of "Failed" this property contains a description of the problem, if SQLizer is able to determine what the problem was.

Conversion Statuses

This table shows the possible values for the Status property, and their meanings.

Status Description
New The file conversion entity has been created but the data has not been uploaded yet and the conversion process has not begun.
Uploaded The data has been uploaded and the client has updated the file conversion entity to tell SQLizer it can begin analysing, but analysis has not begun yet.
Analysing SQLizer has begun analysing the input file.
Processing SQLizer has completed it's analysis of the input file, and is generated the resulting SQL file.
Complete SQLizer has completed generating the resulting SQL file and the conversion process was successful. The "ResultUrl" property will contain the location of the resulting SQL file.
Failed SQLizer has stopped the conversion process because an error was encountered. The "Message" property might contain more information on why.
SubscriptionRequired The conversion process was initiated without a valid API key, or the user's 24 hour pass has expired, and the input file contains more than 5000 rows of data, which is above our free usage limit. The user should sign up for an account to obtain a valid API key, or purchase a subscription then repeat the conversion attempt.
PaymentRequired The users has a valid account, but a payment has been missed and the input file contains more than 5000 rows of data, which is above our free usage limit. The user should update their payment details on the /account/ page and repeat the conversion attempt.