Excel to YAML API¶
Overview¶
Convert an Excel workbook to YAML. Body mode processes the workbook synchronously; URL and file modes submit an asynchronous job.
Endpoint¶
| Method | URL |
|---|---|
POST | https://api.apidatatools.com/excel-to-yaml-api |
Authentication¶
Include your API key in the x-api-key header.
Input modes¶
Select a mode with x-source-type. If omitted, the mode is body.
| Mode | Behavior |
|---|---|
body | Send the workbook as a binary request body. The conversion runs synchronously. |
url | Send a JSON object containing the workbook URL. The request submits an asynchronous job. |
file | Send a JSON object containing the exact storage key returned by the upload workflow. The request submits an asynchronous job. |
Headers¶
Header names are case-insensitive. The lowercase spellings below are used in the examples.
| Header | Type | Required | Default / values | Description |
|---|---|---|---|---|
x-api-key | String | Yes | Your API key | Authenticates the request. |
x-source-type | String | No | Default: body. Values: body, url, file | Chooses the input mode. |
Accepted file extensions¶
URL and file modes accept Excel workbooks with these extensions:
.xls.xlsx
Request body¶
Body mode¶
Send the workbook bytes as the request body. Use curl --data-binary to preserve the binary data.
URL mode¶
Send a JSON object with a url property containing the workbook URL:
url: URL of an.xlsor.xlsxworkbook.
File mode¶
Send a JSON object with a file property containing the exact storage key associated with the uploaded workbook:
file: Storage key returned by the upload workflow. Do not add a prefix to the key.
curl examples¶
Body mode¶
curl --request POST \
--url https://api.apidatatools.com/excel-to-yaml-api \
--header 'x-api-key: YOUR_API_KEY' \
--data-binary @workbook.xlsx
URL mode¶
curl --request POST \
--url https://api.apidatatools.com/excel-to-yaml-api \
--header 'x-api-key: YOUR_API_KEY' \
--header 'x-source-type: url' \
--data-binary '{"url":"https://example.com/input.xlsx"}'
File mode¶
curl --request POST \
--url https://api.apidatatools.com/excel-to-yaml-api \
--header 'x-api-key: YOUR_API_KEY' \
--header 'x-source-type: file' \
--data-binary '{"file":"S3_KEY_RETURNED_BY_THE_UPLOAD_WORKFLOW"}'
Success responses¶
Synchronous body mode¶
A successful body-mode request returns HTTP 200 with a file-producing success response containing:
| Field | Description |
|---|---|
request_id | ID for the request. |
status | success when conversion succeeds. |
file | Temporary URL for the converted output. |
preview | Preview returned for the output. |
Asynchronous URL and file modes¶
A successfully submitted job returns HTTP 202 with:
| Field | Description |
|---|---|
status | accepted. |
job_id | ID for the asynchronous job. |
status_url | URL to check the job status. |
request_id | ID for the request. |
Async job status¶
Check a submitted job with:
curl --request GET \
--url 'https://api.apidatatools.com/jobs/JOB_ID' \
--header 'x-api-key: YOUR_API_KEY'
The status endpoint returns HTTP 200 when it retrieves the job. Its response includes request_id, job_id, status, created_at, and updated_at. The remaining fields depend on the job status:
| Job status | Additional response fields |
|---|---|
queued | message: "Your job is being processed."; retry_after: 2 |
processing | message: "Your job is being processed."; retry_after: 2 |
success | result, containing status: "success", file (the temporary output URL), and preview |
failed | error, containing code, message, and details |
For failed jobs, details can include additional information. Job errors are returned in the status response; they are not the HTTP status of the status request.
Error handling¶
Error responses use status, error, request_id, and details.message. The details object may contain additional fields.
| HTTP status | Error codes | Context |
|---|---|---|
400 | INVALID_SOURCE_TYPE, INVALID_BODY_ENCODING, EMPTY_BODY | Invalid source mode, body encoding, or empty request body. |
400 | INVALID_BODY, INVALID_URL, URL_UNREACHABLE, URL_NOT_OK, INVALID_FILE, FILE_UNAVAILABLE, INVALID_FILE_EXTENSION | Invalid asynchronous request body or input, or URL/file validation failed. |
400 | INVALID_JOB_ID, JOB_NOT_FOUND, FORBIDDEN, DDB_ERROR | Job-status request errors. The status API returns these tool errors as HTTP 400. |
401 | UNAUTHORIZED | Authentication failed. |
404 | USER_NOT_FOUND, UNKNOWN_FUNCTION | User was not found, or the requested endpoint is unsupported. |
413 | PAYLOAD_TOO_LARGE | Synchronous request body exceeds the applicable limit. |
413 | FILE_TOO_LARGE | Input file exceeds the applicable file-size limit. |
429 | QUOTA_EXCEEDED, RATE_LIMITED | Plan quota or rate limit was exceeded. |
500 | PLAN_NOT_FOUND, CONFIG_ERROR, PLAN_CONFIG_ERROR, INTERNAL_ERROR | Plan configuration, asynchronous job configuration, or request processing failed. |
Asynchronous jobs can also end in failed with INVALID_JOB, DOWNLOAD_FAILED, UPLOAD_FAILED, or INTERNAL_ERROR. These codes appear in the job-status response’s error object.
Notes¶
- Body-size, file-size, quota, and rate limits depend on your plan. See API tool limits.
- Output download URLs are temporary. Their retention period depends on your plan.