Skip to content

Upload, Webhook, QR Code & Avatar API

Check uploads and webhooks from your app, and make QR codes and avatars on the fly.

Upload code is hard to test without a server. /upload accepts a multipart form or raw bytes up to 1 MB and tells you what arrived: field names, file names, sizes, detected file types and SHA-256 hashes, so you can confirm your app sends what you think. /webhooks/test is a receiver for webhook senders: it echoes the delivery, gives it an id, can answer with any status code to test retries, and checks an HMAC-SHA256 signature.

/images/qr makes a QR code for any text or link, and /images/avatar draws a round avatar with a person’s initials, in Khmer too. Nothing you send is stored.

Base URL https://toolorca.com/api/v1 No key · CORS open · JSON · conventions and limits

Endpoints

POST /api/v1/upload #

Upload one or more files (multipart/form-data) or raw bytes. Returns metadata for each file and the text fields. Up to 1 MB.

With curl: curl -F "file=@photo.jpg" -F "caption=Hello" https://toolorca.com/api/v1/upload. In Flutter use http.MultipartRequest, in Kotlin OkHttp’s MultipartBody. The example below sends a small JSON body, which is treated as one raw file.

Parameter In Type Description
file fields body file Any number of files, any field names.
text fields body string Returned in fields (first 500 characters).
X-Filename header string Optional file name for a raw upload.
curl -X POST 'https://toolorca.com/api/v1/upload' \
  -H 'Content-Type: application/json' \
  -d '{"hello":"world"}'
POST /upload
Example response
{
  "stored": false,
  "limitBytes": 1048576,
  "receivedBytes": 17,
  "contentType": "application/json",
  "receivedAt": "2026-11-21T19:15:57.640Z",
  "files": [
    {
      "field": null,
      "filename": null,
      "contentType": "application/json",
      "size": 17,
      "detectedType": "text/plain",
      "sha256": "93a23971a914e5eacbf0a8d25154cda309c3c1c72fbb9914d47c60f3cb681588",
      "md5": "fbc24bcc7a1794758fc1327fcfebdaf6",
      "firstBytes": "7b2268656c6c6f223a22776f726c6422"
    }
  ],
  "fields": {},
  "message": "Received the raw request body as one file. Nothing was saved."
}

POST /api/v1/webhooks/test #

Receives a webhook and returns what arrived with a fake delivery id.

To test signatures, send the header X-Signature: sha256=<hex HMAC-SHA256 of the raw body> (or X-Hub-Signature-256) and add ?secret=: the response says whether it is valid and shows the expected value.

Parameter In Type Description
status query integer Status code to answer with (200–599, default 200), e.g. 500 to test retries.
secret query string Shared secret for the HMAC check (only for testing).
… body any JSON, form or text.
curl -X POST 'https://toolorca.com/api/v1/webhooks/test?source=demo' \
  -H 'Content-Type: application/json' \
  -d '{"event":"order.paid","orderId":1042,"amount":25.5,"currency":"USD"}'
POST /webhooks/test?source=demo
Example response
{
  "received": true,
  "deliveryId": "whd_704675490a27028277a05077",
  "receivedAt": "2026-11-21T19:15:57.647Z",
  "method": "POST",
  "contentType": "application/json",
  "sizeBytes": 68,
  "query": {
    "source": "demo"
  },
  "headers": {
    "host": "toolorca.com",
    "user-agent": "curl/8.7.1",
    "accept": "*/*",
    "content-type": "application/json"
  },
  "body": {
    "event": "order.paid",
    "orderId": 1042,
    "amount": 25.5,
    "currency": "USD"
  },
  "bodyText": "{\"event\":\"order.paid\",\"orderId\":1042,\"amount\":25.5,\"currency\":\"USD\"}",
  "signature": null,
  "respondedWith": 200,
  "note": "Nothing is stored or forwarded. Use ?status=500 to test your retry logic and ?secret= to check HMAC signatures."
}

GET /api/v1/images/qr #

A QR code image for any text or link (PNG by default, or SVG).

Parameter In Type Description
text required query string Text or URL, up to 1,200 bytes (Khmer works).
format query string png (default) or svg.
size query integer Image size in pixels, 64–1024 (default 256; PNG is rounded to whole modules).
ecc query string Error correction L, M (default), Q or H.
margin query integer Quiet zone in modules, 0–10 (default 4).
fg / bg query hex colour Colours without #; bg=transparent works too.
curl 'https://toolorca.com/api/v1/images/qr?text=https%3A%2F%2Ftoolorca.com%2Fdevelopers%2F&size=300'
GET /images/qr?text=https%3A%2F%2Ftoolorca.com%2Fdevelopers%2…
Example image Placeholder image from /images/qr

GET /api/v1/images/avatar #

An avatar with the initials of a name on a colour chosen from the name (SVG by default, or PNG).

SVG avatars are round and can show any script, so “ចាន់ សុខា” becomes ចស. PNG avatars are square and draw Latin letters and digits.

Parameter In Type Description
name required query string Full name, e.g. Sokha Chan.
format query string svg (default) or png.
size query integer 16–1024 (default 128).
bg / fg query hex colour Override the colours.
rounded query boolean false for a square SVG.
curl 'https://toolorca.com/api/v1/images/avatar?name=Sokha%20Chan&size=160'
GET /images/avatar?name=Sokha%20Chan&size=160
Example image Placeholder image from /images/avatar

Checking a webhook signature

Most webhook senders sign the raw request body with a shared secret. Compute HMAC-SHA256(secret, rawBody) as hex, send it as X-Signature: sha256=… and call /webhooks/test?secret=yoursecret. If signature.valid is false, compare signature.expected with what you sent: the usual mistake is signing re-serialised JSON instead of the exact bytes.

Free daily limit

Shared with the other mock services: 50 requests per day and 10 per minute per IP address. QR and avatar images are cached for a day, so load each one once and let the browser or your image library keep it.

Frequently asked questions

Are uploaded files stored?

No. The server reads the request, measures and hashes the files, answers and forgets them.

What is the upload size limit?

1 MB per request. Larger bodies get 413 Payload Too Large, which is also worth testing in your app.

Can phones scan the QR codes?

Yes. They are standard QR codes (versions 1–40, byte mode, UTF-8), so any scanner app reads them, including Khmer text.

Can I hotlink the avatar and QR images?

In demos and prototypes, yes, but they count toward the 50-a-day limit for your users’ IP addresses. For production, generate them once and store them.

More free APIs