Skip to content

Authentication

GhostTypes edited this page Nov 14, 2026 · 9 revisions

Authentication

FlashForge printers use different authentication models. The model depends on the printer series and the protocol.

Authentication Models Overview

Printer Series HTTP API (8898) TCP API (8899)
Adventurer 3 Series N/A None
Adventurer 4 Series N/A None
Adventurer 5M CheckCode None
Adventurer 5M Pro CheckCode None
AD5X CheckCode None
Creator 5 CheckCode Not available (no TCP service)
Creator 5 Pro CheckCode Not available (no TCP service)

LAN HTTP API Authentication

Applicability: Adventurer 5M, 5M Pro, AD5X, Creator 5, Creator 5 Pro

Modern printers use a static shared secret authentication model for the HTTP REST API.

Credentials

Field Description Location
serialNumber Printer's unique serial number Printer settings menu
checkCode Static registration code Printer settings menu (called "Check Code" or "Verify Code")

Obtaining Credentials

  1. Navigate to the printer's Settings menu on the LCD display
  2. Look for "Network", "About", or "Device Info" section
  3. Find the Serial Number (it typically starts with "SN" and includes the model identifier).
  4. Find the Check Code on the network-mode screen (the same screen as the LAN-only mode switch).

On the Adventurer 5M series and the AD5X, the printer makes the check code itself. The code has 8 characters. It can contain the digits 0–9 and the letters a–f, for example 3f9a0c1e. If the user makes a new code on the printer, the old code stops working.

Authentication Methods

JSON Body Authentication

Used for most HTTP endpoints (/detail, /control, /gcodeList, etc.).

POST http://10.0.0.42:8898/detail
Content-Type: application/json

{
  "serialNumber": "SNADVA5MXXXXX",
  "checkCode": "3f9a0c1e"
}

Header Authentication

Used for the /uploadGcode endpoint (multipart/form-data requests).

POST http://10.0.0.42:8898/uploadGcode
Content-Type: multipart/form-data
serialNumber: SNADVA5MXXXXX
checkCode: 3f9a0c1e
fileSize: 1234567
printNow: true

[multipart form data]

Note: Boolean header values are the lowercase words true and false (for example printNow: true), not 0 and 1.

Authentication Errors

The HTTP status is always 200, even on failure. Check the code field in the JSON body instead.

If LAN mode is off, the response has code: -2:

{
  "code": -2,
  "message": "Lan mode error"
}

The printer checks the network mode before it reads the credentials. Every endpoint except /notifyWanBind does this check. /getThum also does this check, although it needs no credentials.

What the HTTP API does in cloud mode depends on the model and the firmware version:

  • Locked: the printer answers with code: -2.
  • Closed: the printer does not accept the connection on port 8898.
  • Open: the API works as in LAN-only mode.
Model Firmware Cloud mode after power-on After a switch from LAN-only to cloud mode
Adventurer 5M / 5M Pro 2.6.x Closed Closed
Adventurer 5M / 5M Pro 3.1.3 – 5.1.4 Locked Locked
Adventurer 5M / 5M Pro 5.1.8 and later Open Open
AD5X 1.0.x Locked Locked
AD5X 1.1.6 – 3.1.4 Closed Locked
AD5X 3.1.5 and later Closed Open (until the next restart)
Creator 5 / 5 Pro All official firmware Locked Locked

If the API is locked or closed, ask the user to turn on LAN-only mode. If the API stays closed after the switch, the user must restart the printer.

Note: This table is not yet verified on hardware.

Creator 5 firmware 2.0.0 (third-party build) does not send code: -2: on that firmware the HTTP API accepts requests in LAN-only mode and in cloud mode. If no check code exists yet, the 2.0.0 printer makes one (8 lowercase letters and digits) and shows it on the network-mode screen.

Note: The firmware 2.0.0 behaviour is not yet verified on hardware.

If credentials are wrong, the response has code: 1:

{
  "code": 1,
  "message": "SN is different"
}
{
  "code": 1,
  "message": "Access code is different"
}

If a credential field is missing, or the body is not valid JSON, the response has code: -1 and message Parameters is error.

The printer checks the serial number first, then the check code. A field that is not a string counts as an empty string. The response is then SN is different or Access code is different, not -1.

Two endpoints use different rules:

Endpoint Missing field Body is not valid JSON Other differences
/checkCode -1 Parameters is different Empty reply (HTTP 200, no body) If the check code is correct, the reply is 0 Success, also when the serial number is wrong.
/uploadGcode 1 SN is different (a missing header counts as empty) Not applicable (credentials are in headers) The printer checks for a busy printer (code: 2) before the credentials. It never sends Parameters is error.

Note: These rules are not yet verified on hardware.

Legacy TCP Authentication

Applicability: Adventurer 3, Adventurer 4 Pro, and all series on port 8899

Connection Model

Connect to: 10.0.0.42:8899
Send: ~M601 S1
Response: CMD M601 Received.
          Control Success V2.1.
          ok

Session Control

While there is no credential validation, the TCP protocol uses a session model:

Command Purpose
M601 S1 Request control session
M602 Release control session

Only one control session can be active at a time. If M601 S1 fails with "Control Failed", another client is connected.

Quick Reference

Modern Printers (5M, 5M Pro, AD5X)

HTTP API:  serialNumber + checkCode required
TCP API:   No authentication (M601 S1 session only)

Creator 5 / Creator 5 Pro

HTTP API:  serialNumber + checkCode required
TCP API:   Not available (no TCP service)

Legacy Printers (A3, A4 Pro)

HTTP API:  Not available
TCP API:   No authentication (M601 S1 session only)

Example: Testing Authentication

Valid Request:

POST http://10.0.0.42:8898/detail HTTP/1.1
Content-Type: application/json

{"serialNumber":"SNADVA5MXXXXX","checkCode":"3f9a0c1e"}

Response: {"code":0,"message":"Success","detail":{...}}

Invalid Request:

POST http://10.0.0.42:8898/detail HTTP/1.1
Content-Type: application/json

{"serialNumber":"SNADVA5MXXXXX","checkCode":"wrong"}

Response: {"code":1,"message":"Access code is different"}

Clone this wiki locally