Get the History via a Single dynamic requests (API)

Hi there,

Is it possible to get a history list (txt or json) via a single dynamic requests (API) ?

Or if not, maybe get the export CSV by the same way ?

I saw that it's possible to get a log file this way : http://localhost:3344/printer/log/<slug>?a=download&sess=<session key>&l=<log name>

And that works pretty fine...

Thanks in advance,
Regards,
Fred 

Comments

  • Yes, it is possible. The command is just not documented.

    Action is historyList and required parameter are:
    {
    start: 0,
    limit: 50,
    slug: slug
    uuid: '',
    allPrinter: false
    } uuid needs to be there but is not used. Set limit = 0 to get all entries, otherwise you get the newest x extries starting at start.
  • Hello,

    Thank you for your answer.

    I have tried these two syntaxes :
    http://192.168.1.251:3344/historyList/PP3D?apikey=ourAPIKEY&limit=10&uuid=&allPrinter=false
    (slug=PP3D)

    But in both case, I receive this message : Requested file not found.
    Our Repetier Server version is 0.86.2

    Is there something wrong in my syntax ?

    Best regards,
    Fred
  • Yes that does not work. It is a websocket command, not a direct link command. Read
    https://www.repetier-server.com/manuals/programming/API/index.html
    especially how to issue websocket commands directly. All params go into the data parameter which is the json string in url encoded form.
  • Great ! It works. Thank you.
  • edited October 27
    HI,
    I have a problem retrieving the history via api call
    I followed the directions but I always get: {"list": []} I don't understand where I'm wrong
    I have Repetier Server Pro 1.2.0
    the request I send is:
    192.168.12.169:3344/printer/api/P430?a=historyList&data=%7Bstart%3A0%2Climit%3A0%2Cslug%3AP430%2Cuuid%3A%2CallPrinter%3Atrue%7D&apikey= <MyAPI-KEY>

    Regards,
  • Yes, you have limit = 0 so you want the first 0 entries. Increase limit to the number of hits you want.
  • I tried to bring it to 10 but I have the same result
    if I look from the web interface in the history I have 4 items

    192.168.2.169:3344/printer/api/P430?a=historyList&data=%7Bstart%3A0%2Climit%3A10%2Cslug%3AP430%2CallPrinter%3Atrue%7D&apikey=
  • instead if I send:
    192.168.2.169:3344/printer/api/P430?a=listPrinter&apikey=
    i get this:
    [{"active":true,"job":"none","name":"peek","online":0,"pauseState":0,"paused":false,"slug":"peek"},{"active":true,"job":"none","name":"P430","online":0,"pauseState":0,"paused":false,"slug":"P430"}]
  • If you open debug tools, reload and go to network and select the websocket. If you set filter to historyList and go to function in gui you see how it gets called.

    But when I decode your data part I get
    {start:0,limit:10,slug:P430,allPrinter:true}

    which is no valid json. Valid json would be
    {"start":0,"limit":10,"slug":P430,"allPrinter":true}

    See the double quotes for strings and names!
Sign In or Register to comment.