Delete a model via Websocket Command
Hi,
I tried to delete a model from this command.
I tried to delete a model from this command.
http://localhost:3344/printer/api/my_printer?a=removeModel&data=46&apikey=my_key
However the file doesn't get deleted.
I guess my problem is the "data=" parameter.
How do I pass the "id" for the gcode file here? (<json object properly url-escaped>)
Thanks for your help!
Kind regards,
Andreas
Comments
removeModel
Parameter: id (int) = id of g-code that will be deleted.
So json representation is {"id":46} which is url encoded %7B%22id%22%3A46%7D which you enter as data.
In javascript console you can enter
encodeURIComponent('{"id":46}')
To encode a string.
Now it's clear, thank you!
List shows command and data required.
https://www.repetier-server.com/manuals/programming/API/index.html
Do I miss something? I need some more commands, but I don't want to bother you for each single commands.
So if you have a full list, I would appreciate it.
Thanks for your help!
Best way to find them is open debug tools->Network in chrome and reload. Then search for file socket and see frames being send. Then execute the operation needing them in our gui and see what it sends. Also gives nice examples on send data and answer.
I hope to get some time to add newer api calls.
I'm sorry to bother you again, however I struggle to get the commands from the Network-Console as you mentioned.
I also struggle with the "listJobs" command. I always get an empty object back, although the print is running.
Is this command deprecated?
Those commands are missing so that I can finish my application.
Thank you for your time and assistance!
Best,
Andreas
What is the problem with network console. Open it reload page so file appears, search for sock and you will see it. It is always the last one that is active. Select frames and you see full communication.
To start a stored model you need copyModel with autostart=true. Works only if no job is running. Otherwise it will just queue the model.
startJob starts a queued job.
Uploads are not done over websocket, see
https://www.repetier-server.com/using-simplify-3d-repetier-server/
how to do. group is the upload group. # is default group.
shutdown/reboot are no server commands. On pi they are added as external commands so you need
listExternalCommands
Parameter: None.
Response
Lists all available external commands. Some commands should ask a question to confirm it.
runExternalCommand
Parameter: id (int) = Command to run.
Response
Starts a command by command id.
To run them.
Action stateList returns basic state for all printers.