How can i pass the parameter?

Hi,

Do anyone knows how can i pass the parameter to the demo API?
 
i put where is ACTION: "browseFolder" command and where is JSON Paylaoad: {"id":  1}

print screen: http://prntscr.com/mwugia

this information i took them from the getFolders command.


Comments

  • That will return ok: false since you have not set all parameter since docs say:
    browseFolder
    Parameter: folder (int) = folder id, root (string) = start position ,next (string) mod to root}

    As a trick open our gui in chrome, enable dev tools, reload and search in network for latest socket file. Check frames tab. There you see all communication going in and out. Then do the function you want to copy and see what gets send and what you would receive.
  • http://prntscr.com/mwvgcx

    i did it but i was expecting, when i receive the answer with the pl:false to receive what the socket was excpecting, so i can transform my parameters and make the fix.

    i parse all the parameter as well as the documentation asks, but i do something wrong. 

    If you can navigate me to find this would be perfect. Maybe is somewhere in there!
  • When I said to check the websocket I meant that of the gui where it works! If you do it there you see

    73
    08:46:16.779
    {"action":"browseFolder","data":{"folder":1,"next":"","root":""},"printer":"bla1","callback_id":77} 99
    08:46:16.908
    {"callback_id":77,"data":{"files":[{"isDir":true,"name":"pharaoh","path":"/pharaoh"},{"isDir":true,"name":"delta","path":"/delta"},{"isDir":false,"name":".DS_Store","path":"/.DS_Store","size":10244},{"isDir":true,"name":"ordbot","path":"/ordbot"},{"isDir":true,"name":"irapidmini","path":"/irapidmini"},{"isDir":true,"name":"felix","path":"/felix"},{"isDir":true,"name":"Stacker","path":"/Stacker"},{"isDir":true,"name":"irapid","path":"/irapid"},{"isDir":true,"name":"Packed","path":"/Packed"},{"isDir":false,"name":"Packed.zip","path":"/Packed.zip","size":4072063},{"isDir":true,"name":"Craftware","path":"/Craftware"},{"isDir":true,"name":"PrusaMK3","path":"/PrusaMK3"},{"isDir":true,"name":"Laser","path":"/Laser"},{"isDir":true,"name":"errors","path":"/errors"},{"isDir":true,"name":"Prusa","path":"/Prusa"},{"isDir":true,"name":"slicerdata","path":"/slicerdata"},{"isDir":true,"name":"orcabot","path":"/orcabot"},{"isDir":true,"name":"Packed 2","path":"/Packed 2"}],"ok":true,"root":"/"},"session":"Xv7J%QpNCVyE$!go1j6xeXuKPKLyz20m"} 1039

    Folders are numbered and depend on the start directories you have created. Use getFolders to get a list of available folder ids.
  • edited March 13
    Ah nice!  

    so in general this trick can work with all the things that i want to do.

    I can go to the " http://10.92.520.16:3344/ ", or whatever address the repetier running from, i can execute a command and through the web socket i can find what i exactly i have to give to the API as parameters and the way that i can do it! 

    So for example if i want to print something depending on an input, if i go and print a file from the working GUI i can take the command that i can use , to print a file directly from the script...
  • But still some commands with empty parameter, as listJobs they dont work, so i am trying to find them through the working gui
  • Yes, that is how you can check it. Together with API documentation it should be easy to understand.

    Why do you think listJobs does not work? It is the waiting queue and often it is empty. For jobs you could start that are stores you want listModels!
  • Actually i dont know why the "listModels" command returns empty brackets.

    I am interesting to get all the files from the print page of the printer.  ( http://prntscr.com/mxqu5n )

    They are not into a folder or something. 

    i was expecting with that the list model command will return this list, but it soesn't



  • Did you set the right slug name exactly like shown in url?
Sign In or Register to comment.