Skip to content

Base32 Decoder API Documentation

Overview

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

  • Body Mode (synchronous) — Direct Base32 text in the request body.
  • URL Mode (asynchronous) — Remote file URL containing Base32 text.
  • File Mode (asynchronous) — Uploaded file reference containing Base32 text.

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


Endpoint (POST)

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

Headers

Header Type Required Description
x-api-key API key Yes <api_key>
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)

JBSWY3DPEBLW64TMMQ======

Input Example (URL Mode)

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

Input Example (File Mode)

{
  "file": "user_uploads/upl_1234567890abcdef/sample_base32.txt"
}

Example Request

Synchronous (Body Input)

curl -X POST "https://api.apidatatools.com/base32-decoder-api" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "x-source-type: body" \
  -d '{"content": "JBSWY3DPEBLW64TMMQ======"}'

Asynchronous (Remote File URL)

curl -X POST "https://api.apidatatools.com/base32-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_base32.txt"}'

Asynchronous (Input File)

curl -X POST "https://api.apidatatools.com/base32-decoder-api" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "x-source-type: file" \
  -d '{"file": "user_uploads/upl_1234567890abcdef/sample_base32.txt"}'

Example Response

Successful (Body Mode)

Status Code: 200 OK

{
  "status": "success",
  "request_id": "b9f2c8e7-1234-4a56-9f0a-abcdef123456",
  "file": "https://downloads.apidatatools.com/apidatatools_convert_abc123.txt",
  "preview": "Hello World"
}

Async Job Accepted (URL/File Mode)

Status Code: 202 Accepted

{
  "status": "accepted",
  "job_id": "job_1234567890abcdef",
  "status_url": "https://api.apidatatools.com/jobs/job_1234567890abcdef",
  "request_id": "b9f2c8e7-1234-4a56-9f0a-abcdef123456"
}

Error Handling

Error Code HTTP Status Description Example
BASE32_DECODING_FAILED 400 Input could not be decoded or was empty {"status":"error","error":"BASE32_DECODING_FAILED","details":{"message":"Failed to decode Base32."}}
EMPTY_BODY 400 Request body is empty {"status":"error","error":"EMPTY_BODY","details":{"message":"Request body is empty."}}
INVALID_BODY_ENCODING 400 Body could not be base64-decoded {"status":"error","error":"INVALID_BODY_ENCODING","details":{"message":"Failed to base64-decode request body."}}
INVALID_URL 400 URL missing or invalid {"status":"error","error":"INVALID_URL","details":{"message":"URL must be valid http/https."}}
URL_UNREACHABLE 400 URL could not be reached {"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_EXTENSION 400 File extension not allowed {"status":"error","error":"INVALID_FILE_EXTENSION","details":{"message":"Invalid or unsupported file extension."}}
INVALID_FILE 400 File reference missing or invalid {"status":"error","error":"INVALID_FILE","details":{"message":"Missing or invalid 'file'."}}
UNKNOWN_FUNCTION 404 Endpoint not recognized {"status":"error","error":"UNKNOWN_FUNCTION","details":{"message":"Unsupported API endpoint."}}
INTERNAL_ERROR 500 Unexpected internal 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}

Headers:

Header Type Required Description
x-api-key string Yes API key for authentication

Example Status Response for Async

Queued / Processing

{
  "job_id": "job_1234567890abcdef",
  "status": "queued",
  "created_at": 1712345678,
  "updated_at": 1712345678,
  "message": "Your job is being processed.",
  "retry_after": 2
}

Successful

{
  "job_id": "job_1234567890abcdef",
  "status": "success",
  "created_at": 1712345678,
  "updated_at": 1712345690,
  "result": {
    "status": "success",
    "request_id": "b9f2c8e7-1234-4a56-9f0a-abcdef123456",
    "file": "https://downloads.apidatatools.com/apidatatools_convert_abc123.txt",
    "preview": "Hello World"
  }
}

Failed

{
  "job_id": "job_1234567890abcdef",
  "status": "failed",
  "created_at": 1712345678,
  "updated_at": 1712345680,
  "error": {
    "code": "BASE32_DECODING_FAILED",
    "message": "Failed to decode Base32.",
    "details": {
      "message": "Incorrect padding"
    }
  }
}

Notes for Developers

  • The API supports synchronous decoding for small Base32 strings and asynchronous processing for remote or uploaded files.
  • The output file is stored temporarily and accessible via the returned S3 link.
  • Always include the x-source-type header to specify the input mode.
  • For asynchronous jobs, use the status_url to poll job progress.
  • Each response includes a unique request_id for tracking and debugging.
  • Ensure that remote URLs or uploaded files have allowed extensions (.txt, .log).
  • The preview field in responses contains the first 100 KB of decoded text for quick inspection.