Jump to content
Ultimaker Community of 3D Printing Experts


  • Content Count

  • Joined

  • Last visited

Posts posted by JurgenMK

  1. Hello,

    I am trying to start a print via the RUST-API, but unable to do so because I don't understand what the problem is,

    I have written some code, which is attached, and when I try to run the start_print.py, I don't understand how it sends the gcode via this CURL request:

    curl -X POST --header 'Content-Type: multipart/form-data' --header 'Accept: application/json' -F jobname=test ''


    Thanks in advance,

    Jurgen Kuyper


  2. 2 hours ago, tinkergnome said:

    dunno... but i would not use the "api" object at all for this task.

    The cluster-api works different, no authentification, and does not know the "jobname" parameter (AFAIK).


    Can't you simply mimic the curl command with a python library or such....?


    I tried that already, but then I still get the 200 back instead of 201

  3. 14 hours ago, tinkergnome said:


    I'm not sure, either this (older) network printing doesn't work anymore or we use it in a wrong way?

    I use only the new API for this, i hope it still works in the same way in this new "digital factory" age (my UM3 has not heard yet of those fancy things... 😏)


    Have a look at the documentation on the printer.


    Something like this (from a windows batch file):


    set URL=
    set FILENAME=UM3_UltimakerRobot_support.gcode
    curl -X POST --header "Content-Type: multipart/form-data" --header "Accept: application/json" -F "file=@%FILENAME%" %URL%

    okey that works, but when I try to do the exact same thing in my python code I get a response 200 back, and the print doesn't start.

    import UM3_API
    def start_print(file):
        api = initAPI("")  
        if os.path.exists(file):
            jobname = os.path.basename(file)
            filepath = file
            print(api.post("cluster-api/v1/print_jobs", headers={"Content-Type": "multipart/form-data", "Accept": "application/json"}, files={"file": (jobname, open(filepath, "rb"))}))

    what am I doing wrong?


  4. Quote

    I learned here that Postman and the firmware do not speak the same dialect of "http digest" somehow...

    But the python script works like a charm

    I tried that, but I get a missing argument error on the api.loadauth subroutine, cus the "auth.data" is going in to self, and the filename is not specified, if I add that it doesn't work either, I am using python 3.7.5

  • Create New...