Skip to content

Base16 Encoder API

Overview

Encodes text as Base16. Body mode processes the request synchronously; URL and file modes create an asynchronous job.

Endpoint

Method URL
POST https://api.apidatatools.com/base16-encoder-api

Authentication

Include your API key in the x-api-key header:

x-api-key: YOUR_API_KEY

Input modes

Select a mode with x-source-type. Header names are case-insensitive; the lowercase spellings shown here are recommended.

Mode Behavior
body Sends raw text for synchronous processing. This is the default.
url Submits a URL for asynchronous processing.
file Submits a pre-uploaded file reference for asynchronous processing.

Headers

Header Type Required Default / values Description
x-api-key string Yes No default API key used for authentication.
x-source-type string No Default: body; values: body, url, file Selects the input mode.
x-record-path string No Not documented for this endpoint No effect is documented for the Base16 encoder.
x-root-name string No Not documented for this endpoint No effect is documented for the Base16 encoder.
x-tab-space string No Not documented for this endpoint No effect is documented for the Base16 encoder.

Accepted file extensions

URL and file modes accept these input extensions:

  • txt
  • log

Request body

Body mode

Send raw text as the request body. Do not wrap the text in a JSON object.

URL mode

Send a JSON object containing the input URL:

{
  "url": "https://example.com/input.txt"
}

File mode

Send a JSON object containing the exact storage key returned by the upload workflow:

{
  "file": "S3_KEY_RETURNED_BY_THE_UPLOAD_WORKFLOW"
}

curl examples

Body mode

curl --request POST \
  --url https://api.apidatatools.com/base16-encoder-api \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'x-source-type: body' \
  --header 'Content-Type: text/plain' \
  --data-raw 'Hello, world!'

URL mode

curl --request POST \
  --url https://api.apidatatools.com/base16-encoder-api \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'x-source-type: url' \
  --header 'Content-Type: application/json' \
  --data '{"url":"https://example.com/input.txt"}'

File mode

curl --request POST \
  --url https://api.apidatatools.com/base16-encoder-api \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'x-source-type: file' \
  --header 'Content-Type: application/json' \
  --data '{"file":"S3_KEY_RETURNED_BY_THE_UPLOAD_WORKFLOW"}'

Success responses

Synchronous body mode

A successful request returns HTTP 200 with request_id, status, file, and preview:

{
  "request_id": "REQUEST_ID",
  "status": "success",
  "file": "TEMPORARY_DOWNLOAD_URL",
  "preview": "BASE16_OUTPUT"
}

The file value is a temporary download URL. Its availability period depends on your plan.

Asynchronous URL and file modes

A successfully accepted request returns HTTP 202:

{
  "status": "accepted",
  "job_id": "JOB_ID",
  "status_url": "https://api.apidatatools.com/jobs/JOB_ID",
  "request_id": "REQUEST_ID"
}

Acceptance means the job was submitted; check its status URL for the result.

Async job status

Retrieve a job with:

curl --request GET \
  --url https://api.apidatatools.com/jobs/JOB_ID \
  --header 'x-api-key: YOUR_API_KEY'

The status response includes request_id, job_id, status, created_at, and updated_at. The timestamps are Unix timestamps.

Queued or processing

For either queued or processing, the response also includes message and retry_after:

{
  "request_id": "REQUEST_ID",
  "job_id": "JOB_ID",
  "status": "queued",
  "created_at": 1760000000,
  "updated_at": 1760000000,
  "message": "Your job is being processed.",
  "retry_after": 2
}

Successful job

A successful status response includes result, containing the job’s success response:

{
  "request_id": "REQUEST_ID",
  "job_id": "JOB_ID",
  "status": "success",
  "created_at": 1760000000,
  "updated_at": 1760000002,
  "result": {
    "status": "success",
    "file": "TEMPORARY_DOWNLOAD_URL",
    "preview": "BASE16_OUTPUT"
  }
}

Failed job

A failed status response includes an error object. Its details may contain additional fields:

{
  "request_id": "REQUEST_ID",
  "job_id": "JOB_ID",
  "status": "failed",
  "created_at": 1760000000,
  "updated_at": 1760000002,
  "error": {
    "code": "ERROR_CODE",
    "message": "Description of the failure.",
    "details": {
      "message": "Description of the failure."
    }
  }
}

A failed job is reported in the status response; the example does not specify an HTTP status for the job’s processing failure.

Error handling

Synchronous and asynchronous submission errors use this envelope. details may contain additional fields:

{
  "status": "error",
  "error": "ERROR_CODE",
  "request_id": "REQUEST_ID",
  "details": {
    "message": "Description of the error."
  }
}

The following HTTP statuses are established for this endpoint and its asynchronous submission flow:

HTTP status Error codes When it applies
400 INVALID_SOURCE_TYPE, EMPTY_BODY Unsupported input mode 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, URL, file reference, or extension; or an unavailable URL or file.
401 UNAUTHORIZED Authentication context is missing or invalid.
404 USER_NOT_FOUND, UNKNOWN_FUNCTION User record or endpoint is not found.
413 PAYLOAD_TOO_LARGE, FILE_TOO_LARGE Request body or remote/input file exceeds the applicable plan limit.
429 QUOTA_EXCEEDED, RATE_LIMITED Plan quota or request rate limit is exceeded.
500 PLAN_NOT_FOUND, INTERNAL_ERROR, CONFIG_ERROR, PLAN_CONFIG_ERROR Plan configuration, asynchronous service configuration, or request processing failure.

Errors from job processing, such as download or upload failures, appear in the failed job status rather than as the original submission’s HTTP response.

Notes

  • Body-size, file-size, quota, rate, and download-retention limits depend on your plan. See tool limits.
  • Download URLs are temporary; retention depends on your plan.
  • In file mode, provide the exact storage key returned by the upload workflow. Do not add a prefix.