Skip to content

Authentication

GhostTypes edited this page Feb 22, 2026 · 2 revisions

Authentication

FlashForge printers use different authentication models depending on the printer series and protocol being used.

Authentication Models Overview

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

LAN HTTP API Authentication

Applicability: Adventurer 5M, 5M Pro, AD5X

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 (typically starts with "SN" followed by 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: 1

[multipart form data]

Note: Boolean header values use "0" or "1" string format, not "true"/"false".

Authentication Errors

Invalid credentials return HTTP 200 with error code 3:

{
  "code": 3,
  "message": "Unauthorized"
}

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
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 Request control session
M602 Release control session

Only one control session can be active at a time. If M601 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 session only)

Legacy Printers (A3, A4 Pro)

HTTP API:  Not available
TCP API:   No authentication (M601 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":3,"message":"Unauthorized"}

Clone this wiki locally