Back to overview

Updating an Image with the paperlesspaper API

Current instructions

Update an image with the paperlesspaper API

To replace the picture on an e-paper display, you can upload a single image using this paperlesspaper API endpoint. No signed URL or extra metadata is needed.

  • Image upload: POST /papers/uploadSingleImage/:paperId

This guide covers the single-image upload from start to finish. Choose the picture to update, upload the file and check the result.

See the API documentation for instructions on generating an API key.

paperlesspaper-url-schema

Open the picture in the editor. The API calls this entry a paper. The last part of the editor URL is its paperId.

Endpoint POST /papers/uploadSingleImage/:paperId

curl -X POST "https://api.paperlesspaper.de/v1/papers/uploadSingleImage/<PAPER_ID>" \
  -H "x-api-key: <API_KEY>" \
  -F "picture=@/path/to/image.png;type=image/png"

Refresh the Current tab in the web app to check that the new picture appears.

If you prefer code over terminal commands, here’s the same flow using fetch + FormData. Send a multipart request with a single picture field, and you’re done.

import fetch from "node-fetch";
import FormData from "form-data";
import fs from "fs";
import path from "path";

const API_BASE = "https://api.paperlesspaper.de/v1";
const API_KEY = process.env.PAPERLESSPAPER_API_KEY;

export async function uploadPaperImage(paperId, filePath) {
  const form = new FormData();
  const filename = path.basename(filePath);
  form.append("picture", fs.createReadStream(filePath), { filename });
  const res = await fetch(`${API_BASE}/papers/uploadSingleImage/${paperId}`, {
    method: "POST",
    headers: {
      "x-api-key": API_KEY,
      // Important: node-fetch won't auto-add the multipart boundary header.
      ...form.getHeaders(),
    },
    body: form,
  });
  return res.json();
}

For a working example, see our Node.js samples.

If you have questions about this example, open an issue on GitHub.