Skip to content

Authentication

GhostTypes edited this page Sep 7, 2026 · 8 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 (typically a 4-5 digit numeric code)

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": "12345"
}

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: 12345
fileSize: 1234567
printNow: "true"

[multipart form data]

Note: Boolean header values use the lowercase string format "true"/"false" (e.g. printNow: "true"), not "0"/"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"
}

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

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

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

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":"12345"}

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