Can't start job on the demo version via API
Hi,
I'm new to using the API but I can get it work for a few things:
- List Files present on the Printer
- Stop the print in progress
Sadly I can't seem to make the following work:
- Start a job : demo.repetier-server.com:4001/printer/api/Cartesian&apikey=7075e377-7472-447a-b77e-86d481995e7b?a=startJob&data={id:1}
- continue a paused job : http://demo.repetier-server.com:4001/printer/api/Cartesian&apikey=7075e377-7472-447a-b77e-86d481995e7b?a=continueJob&data={}
I get the following "Authorization Required" even though there are no users defined, so no authentifcation needed, right?
I'm currently working on the demo version of the Repetier server since I'm not in the same network as the printer and, for technical reasons, we don't want this one to be accessible from anywhere.
Is it not working because i'm using the demo or am I doing something wrong?
Thanks by advance,
Jocelyn
Comments
parameters start after ? so apikey is most likely never been parsed and hence you are not authorized.
Also note that data parameter needs to be url encoded. It often contains chars not allowed in a url parameter.
There is no job 1 to start. In fact normally there are no jobs at all. Jobs are files in waiting queue, not models.
http://demo.repetier-server.com:4001/printer/api/Cartesian?a=listModels&data={id:14}&apikey=7075e377-7472-447a-b77e-86d481995e7b
will list all models with id available.
http://demo.repetier-server.com:4001/printer/api/Cartesian?a=copyModel&data={%22id%22:1}&apikey=7075e377-7472-447a-b77e-86d481995e7b
would start it if queue is empty, otherwise add to queue.
One error is {id:1} - that is javascript style, but not valid json. {"id":1} is the correct json string oyu need to urlencode in case it contains special chars like ".