Skip to content

Authentication ​

Every request is authenticated with a Token header and a Fingerprint header.

Headers ​

HeaderRules
TokenExactly 20 characters, [A-Za-z0-9]. Issued when the camera is created. See getting a token.
Fingerprint16 to 64 characters. Generated by the camera, unique per device and stable for the device's lifetime.

Both are required on every request. Every request also needs a non-empty User-Agent header that names your firmware and version, for example MyCam/1.2.0. Without it the request is rejected with 400.

bash
curl https://camera-service.prusa3d.com/v1/camera-info \
  -H "Token: $TOKEN" -H "Fingerprint: $FINGERPRINT" -H "User-Agent: MyCam/1.2.0"

Choosing a fingerprint ​

The fingerprint identifies one physical device. It must be:

  • Unique per device. No two devices may share a fingerprint. Never hardcode one value in firmware shared by many devices, and never reuse another device's fingerprint (for example the printer's).
  • Stable. Keep it the same for the device's whole lifetime. Do not generate a new random value on each boot: store it permanently, or derive it from a stable identifier.

A good source is a hash of the MAC address or the serial number, or a random value generated once on first boot and stored permanently.

Unique per device

A camera is identified by its fingerprint, for example when a printer registers its camera. Devices that share a fingerprint can be resolved to the wrong camera and receive another device's token.

Binding ​

The first authenticated call to any of the three endpoints (GET /v1/camera-info, PUT /v1/camera-info, PUT /v1/snapshot) binds the fingerprint to the token permanently. After that, a request with a different fingerprint gets 403.

To move a token to another device, delete the camera and create a new one.

Registration window

The first authenticated call must arrive within 15 minutes of creating the camera. After that the token stops working and the camera disappears. See getting a token.

Query parameters ​

The ?token= and ?fingerprint= query parameters work too. Prefer headers, because query strings end up in logs and browser history.

Keep the fingerprint 16 to 64 characters. A fingerprint longer than 64 characters is currently rejected with a server error (500) on the first call, so do not retry: shorten it.

Authentication errors ​

StatusMeaning
400User-Agent header missing or empty
401Token or Fingerprint header missing
403Unknown token, fingerprint mismatch, or registration window expired
422Token not 20 characters, or fingerprint shorter than 16

On /v1/snapshot, a missing or empty Fingerprint or Token may be answered by the upload gateway, without a JSON body. Full bodies and troubleshooting are in errors.