Base32 Encoder API¶
Overview¶
Encodes text input as Base32. Body mode runs synchronously; URL and pre-uploaded file modes run asynchronously.
Endpoint¶
| Method | URL |
|---|---|
POST | https://api.apidatatools.com/base32-encoder-api |
Authentication¶
Send your API key in the x-api-key header with every request.
Input modes¶
| Mode | Description |
|---|---|
body | Send raw text in the request body. This mode is synchronous and is the default. |
url | Submit a URL to a supported text file. The request creates an asynchronous job. |
file | Submit a pre-uploaded file reference. The request creates an asynchronous job. |
Headers¶
Header names are case-insensitive. The spellings below are the documented lowercase forms.
| Header | Type | Required | Default / values | Description |
|---|---|---|---|---|
x-api-key | String | Yes | Your API key | Authenticates the request. |
x-source-type | String | No | body; allowed values: body, url, file | Selects the input mode. |
x-record-path | String | No | Not specified | Listed in endpoint metadata, but no Base32 encoder behavior for this header is established by the supplied source. |
x-root-name | String | No | Not specified | Listed in endpoint metadata, but no Base32 encoder behavior for this header is established by the supplied source. |
x-tab-space | String | No | Not specified | Listed in endpoint metadata, but no Base32 encoder behavior for this header is established by the supplied source. |
Accepted file extensions¶
For URL and file modes, the accepted input extensions are txt and log.
Request body¶
Body mode¶
Send raw text as the request body. The endpoint is not a binary-body endpoint.
Text to encode
URL mode¶
Send a JSON object containing the URL:
{
"url": "https://example.com/input.txt"
}
File mode¶
Send a JSON object containing the exact file reference returned by the upload workflow. Do not add a prefix to the reference.
{
"file": "S3_KEY_RETURNED_BY_THE_UPLOAD_WORKFLOW"
}
curl examples¶
Body mode¶
curl -X POST "https://api.apidatatools.com/base32-encoder-api" \
-H "x-api-key: YOUR_API_KEY" \
-H "x-source-type: body" \
--data-raw "Text to encode"
URL mode¶
curl -X POST "https://api.apidatatools.com/base32-encoder-api" \
-H "x-api-key: YOUR_API_KEY" \
-H "x-source-type: url" \
-H "Content-Type: application/json" \
--data '{"url":"https://example.com/input.txt"}'
File mode¶
curl -X POST "https://api.apidatatools.com/base32-encoder-api" \
-H "x-api-key: YOUR_API_KEY" \
-H "x-source-type: file" \
-H "Content-Type: application/json" \
--data '{"file":"S3_KEY_RETURNED_BY_THE_UPLOAD_WORKFLOW"}'
Success responses¶
Synchronous body mode¶
A successful file-producing response has HTTP 200 and includes a request ID, success status, file reference, and preview:
{
"request_id": "REQUEST_ID",
"status": "success",
"file": "TEMPORARY_DOWNLOAD_URL",
"preview": "ENCODED_OUTPUT_PREVIEW"
}
The preview is a string and may contain only part of the output.
Asynchronous URL and file modes¶
A successfully accepted asynchronous request has HTTP 202:
{
"status": "accepted",
"job_id": "JOB_ID",
"status_url": "https://api.apidatatools.com/jobs/JOB_ID",
"request_id": "REQUEST_ID"
}
Check the job status using the URL in status_url.
Async job status¶
Retrieve a job with:
curl -X GET "https://api.apidatatools.com/jobs/JOB_ID" \
-H "x-api-key: YOUR_API_KEY"
The status endpoint returns HTTP 200 for a successful status lookup. Its response includes request_id, job_id, status, created_at, and updated_at.
Queued and processing¶
For queued and processing jobs, the response also includes the same processing message and retry interval:
{
"request_id": "REQUEST_ID",
"job_id": "JOB_ID",
"status": "queued",
"created_at": 1700000000,
"updated_at": 1700000000,
"message": "Your job is being processed.",
"retry_after": 2
}
For a processing job, status is "processing"; the other fields have the same shape.
Success¶
A successful job includes its result object:
{
"request_id": "REQUEST_ID",
"job_id": "JOB_ID",
"status": "success",
"created_at": 1700000000,
"updated_at": 1700000001,
"result": {
"status": "success",
"file": "TEMPORARY_DOWNLOAD_URL",
"preview": "ENCODED_OUTPUT_PREVIEW"
}
}
Failed¶
A failed job includes an error object. Its details contains the error details, including message:
{
"request_id": "REQUEST_ID",
"job_id": "JOB_ID",
"status": "failed",
"created_at": 1700000000,
"updated_at": 1700000001,
"error": {
"code": "ERROR_CODE",
"message": "Failure message",
"details": {
"message": "Failure message"
}
}
}
Error handling¶
Errors use this envelope. Additional fields may be present in details.
{
"status": "error",
"error": "ERROR_CODE",
"request_id": "REQUEST_ID",
"details": {
"message": "Description of the error"
}
}
The following statuses are established for this endpoint’s request handling:
| HTTP status | Error codes | When it applies |
|---|---|---|
400 | INVALID_SOURCE_TYPE, EMPTY_BODY | Unsupported input mode or empty request body. |
400 | INVALID_BODY | The asynchronous request body is not valid JSON or is not a JSON object. |
400 | INVALID_URL, URL_UNREACHABLE, URL_NOT_OK | URL mode input is invalid, unreachable, or does not return an accepted response status. |
400 | INVALID_FILE, FILE_UNAVAILABLE, INVALID_FILE_EXTENSION | File-mode input is invalid or unavailable, or a URL/file extension is unsupported. |
400 | Tool execution errors | Tool-level errors are returned as HTTP 400; no Base32-specific tool error codes are established by the supplied source. |
401 | UNAUTHORIZED | Authentication is missing or invalid. |
404 | UNKNOWN_FUNCTION, USER_NOT_FOUND | The endpoint is not recognized, or the authenticated user cannot be found. |
413 | PAYLOAD_TOO_LARGE, FILE_TOO_LARGE | The body or input file exceeds the applicable plan limit. |
429 | QUOTA_EXCEEDED, RATE_LIMITED | The plan quota or rate limit is exceeded. |
500 | INTERNAL_ERROR, PLAN_NOT_FOUND, CONFIG_ERROR, PLAN_CONFIG_ERROR | A server, plan configuration, or asynchronous job configuration error occurred. |
For the job-status request, INVALID_JOB_ID, JOB_NOT_FOUND, FORBIDDEN, and DDB_ERROR are returned as tool errors with HTTP 400. Status requests also use the authentication and rate/quota handling described above.
Notes¶
- Body mode is synchronous. URL and file modes are asynchronous.
- Body-size, file-size, quota, rate, and output-retention limits depend on your plan. See API plan limits.
- Download URLs are temporary; their retention period depends on your plan.
- The supplied source does not establish Base32-specific validation error codes or behavior for
x-record-path,x-root-name, orx-tab-space.