Prusa Connect HTTP Request
 
Notifications
Clear all

Prusa Connect HTTP Request  

  RSS
gioelemo
(@gioelemo)
Member
Prusa Connect HTTP Request

Hi, I am trying to connect to Prusa Connect via a HTTP GET request but I am getting Permanent Redirect Error.

Is this the correct command that can I use to access the underlying API?

I also try changing the authentication to "Authentication: KEY" but I get the same error. I followed this link to get the url   https://connect-mobile-api.prusa3d.com/api/docs#/

Thanks for the help!

curl -X GET "http://connect.prusa3d.com/api/v1/printer" -H "X-Api-Key: KEY"

<html>

<head><title>308 Permanent Redirect</title></head>

<body>

<center><h1>308 Permanent Redirect</h1></center>

<hr><center>nginx</center>

</body>

</html>
Posted : 16/10/2025 10:42 am
gioelemo
(@gioelemo)
Member
Topic starter answered:
RE: Prusa Connect HTTP Request

I just tried with the following url: https://connect.prusa3d.com/app/printers and accessing directly via browser seems to work. The problem is that the authentication is not working if I run the command via terminal. I tried both X-Api-Key and Authentication/Authorization but it doesn't work properly. Do you have any suggestions?

Posted : 21/10/2025 1:00 pm
mrchristian
(@mrchristian)
Active Member
RE: Prusa Connect HTTP Request

Couple of things I notice - 

You are calling the http URI, the 301 you're seeing is probably trying to redirect to the https (SSL) URI

The other thing I notice is a cursory glance a the API doc suggests the endpoint is printers , not printer.

 

Those esses seem to be your headache 😀 

Posted : 31/10/2025 6:07 am
gioelemo
(@gioelemo)
Member
Topic starter answered:
RE: Prusa Connect HTTP Request

Hi, thanks for the answer.

In my second answer to my question I actually use httpand printers

In the meantime I was able to construct a simple working POST request (see code below) for sending a command to the printer which works for very simple command via Cookie Authentication (which is not ideal...). Which API doc are you referring to? The only API that Prusa officially supports (according to chat support) should be https://connect.prusa3d.com/docs/cameras/openapi /" target="_blank" rel="noopener"> https://connect.prusa3d.com/docs/cameras/openapi/  .  

I was not able to run more complex command like START_PRINT because it is difficult to construct the exact structure of the request. A full list of command is available at https://connect.prusa3d.com/app/printers/UUID/supported-commands. This should be the description {"command": "START_PRINT", "args": [{"name": "path", "type": "string", "required": true, "input": true, "output": true, "description": "Path to file"}, {"name": "tool_mapping", "type": "object", "required": false, "input": true, "output": true, "description": "Printer's tool mapping"}], "description": "Start printing gcode file", "duplicates_allowed": false, "executable_from_state": ["IDLE", "READY", "FINISHED", "STOPPED"]},

I have tried multiple body version but I always get: { "message": "The server cannot or will not process the request due to something that is perceived to be a client error", "reason": "Missing required request body", "code": "BAD_REQUEST"}. It is very difficult to construct the actual request without knowing exactly what the body structure is expected to be. It would be very nice from Prusa to release some documentation about that.

I only found this in Github as example of official request in a code: https://github.com/prusa3d/PrusaSlicer/blob/f1776c0a6347bb84986d10eac8db1021f5bd8548/src/slic3r/Utils/PrusaConnect.cpp#L79

Are you able to help me further?

 

curl --location 'https://connect.prusa3d.com/app/printers/UUID/commands' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Cookie: _sleek_session=.....' \
--data '{"command":"BEEP"}'


{
    "id": 226,
    "state": "CREATED",
    "command": "BEEP",
    "received": 1761898522,
    "source": "CONNECT_USER",
    "source_info": {
        "id": 272333,
        "first_name": “NAME”,
        "last_name": “LASTNAME,
        "public_name": “USERNAME,
        "avatar": ""
    },
    "kwargs": {},
    "kwargs_output": {},
    "gcode_str": "M300 S100 P20\r\n"
}
Posted : 31/10/2025 8:54 am
Share: