Skip to content

Base85 Decoder API Documentation

Overview

The Base85 Decoder API decodes a Base85-encoded string into UTF-8 text.
It supports three input modes:

  • Body Mode (Synchronous) – Directly send Base85 text in the request body.
  • URL Mode (Asynchronous) – Provide a remote file URL containing Base85 text.
  • File Mode (Asynchronous) – Provide a previously uploaded file reference.

The decoded output is returned as a downloadable .txt file hosted on a secure link.


Endpoint (POST)

POST https://api.apidatatools.com/base85-decoder-api

Headers

Header Type Required Description
x-api-key string Yes Your API key for authentication
Content-Type string Yes Must be application/json for body mode
x-source-type string Optional Defines input mode: body (default), url, or file

Accepted File Extensions

Mode Allowed Extensions
URL / File txt, log

Input Example (Body Mode)

87cURD]i,\"Ebo80

The value should be a valid Base85-encoded string.


Input Example (URL Mode)

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

The remote file must contain Base85 text and have an allowed extension (.txt or .log).


Input Example (File Mode)

{
  "file": "user123/upl_abc123/sample_base85.txt"
}

The file must be uploaded previously using the upload API and have a valid extension.


Example Request

Synchronous (Body Input)

curl -X POST "https://api.apidatatools.com/base85-decoder-api" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '87cURD]i,\"Ebo80'

Asynchronous (Remote File URL)

curl -X POST "https://api.apidatatools.com/base85-decoder-api" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "x-source-type: url" \
  -d '{"url": "https://example.com/sample_base85.txt"}'

Asynchronous (Input File)

curl -X POST "https://api.apidatatools.com/base85-decoder-api" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "x-source-type: file" \
  -d '{"file": "user123/upl_abc123/sample_base85.txt"}'

Example Response

Successful (Body Mode)

{
  "status": "success",
  "request_id": "b3e7f6c1-4a2b-4f7b-bb2a-9e2c1d9b8a4f",
  "file": "https://downloads.apidatatools.com/apidatatools_convert_123abc456def.txt",
  "preview": "Decoded text preview up to 100KB..."
}

Async Job Accepted

{
  "status": "accepted",
  "job_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "status_url": "https://api.apidatatools.com/jobs/a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "request_id": "b3e7f6c1-4a2b-4f7b-bb2a-9e2c1d9b8a4f"
}

Error Handling

Error Code HTTP Status Description Example
BASE85_DECODING_FAILED 400 Input string is empty or invalid Base85 text {"status":"error","error":"BASE85_DECODING_FAILED","details":{"message":"Empty Base85 input cannot be decoded."}}
INVALID_BODY_ENCODING 400 Request body could not be base64-decoded {"status":"error","error":"INVALID_BODY_ENCODING","details":{"message":"Failed to base64-decode request body."}}
EMPTY_BODY 400 Request body is empty {"status":"error","error":"EMPTY_BODY","details":{"message":"Request body is empty."}}
PAYLOAD_TOO_LARGE 413 Request body exceeds plan limit {"status":"error","error":"PAYLOAD_TOO_LARGE","details":{"message":"Request body exceeds 5120KB limit for your plan."}}
INVALID_URL 400 URL missing or invalid {"status":"error","error":"INVALID_URL","details":{"message":"Missing or invalid 'url'."}}
URL_UNREACHABLE 400 Could not reach provided URL {"status":"error","error":"URL_UNREACHABLE","details":{"message":"Could not reach URL: ..."}}
URL_NOT_OK 400 URL returned non-200 status {"status":"error","error":"URL_NOT_OK","details":{"message":"URL returned HTTP 404, expected 200."}}
FILE_TOO_LARGE 413 File exceeds plan limit {"status":"error","error":"FILE_TOO_LARGE","details":{"message":"Remote file exceeds plan limit."}}
INVALID_FILE 400 File path missing or invalid {"status":"error","error":"INVALID_FILE","details":{"message":"Missing or invalid 'file'."}}
INVALID_FILE_EXTENSION 400 File extension not allowed {"status":"error","error":"INVALID_FILE_EXTENSION","details":{"message":"Invalid or unsupported file extension."}}
INTERNAL_ERROR 500 Unexpected server error {"status":"error","error":"INTERNAL_ERROR","details":{"message":"Failed to process your request"}}

Async Job Status

Endpoint

GET https://api.apidatatools.com/jobs/{job_id}

Example Status Response for Async

Queued / Processing

{
  "job_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "status": "queued",
  "created_at": 1712345678,
  "updated_at": 1712345678,
  "message": "Your job is being processed.",
  "retry_after": 2
}

Success

{
  "job_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "status": "success",
  "created_at": 1712345678,
  "updated_at": 1712345690,
  "result": {
    "status": "success",
    "request_id": "b3e7f6c1-4a2b-4f7b-bb2a-9e2c1d9b8a4f",
    "file": "https://downloads.apidatatools.com/apidatatools_convert_123abc456def.txt",
    "preview": "Decoded text preview..."
  }
}

Failed

{
  "job_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "status": "failed",
  "created_at": 1712345678,
  "updated_at": 1712345680,
  "error": {
    "code": "BASE85_DECODING_FAILED",
    "message": "Failed to decode Base85.",
    "details": {
      "message": "Incorrect padding"
    }
  }
}

Notes for Developers

  • The API supports synchronous decoding for small Base85 strings and asynchronous processing for remote or uploaded files.
  • For asynchronous jobs, use the status_url provided in the 202 response to poll job progress.
  • The decoded output is stored temporarily and accessible via a secure link.
  • Each response includes a unique request_id for traceability.
  • Ensure that your Base85 input is valid UTF-8 text after decoding.
  • Preview data is limited to 100 KB for performance reasons.
  • Allowed file extensions for URL/File mode are strictly enforced (txt, log).
  • Always handle HTTP 202 responses by polling the job status endpoint until completion.