Web Server Specifications and API
  • Hello,

    Is there an up to date version of this page? https://www.bensoftware.com/securityspy/web-server-spec.html

    Most of the methods described here have been expanded, and I'm guessing there are new methods not documented. The ++getfile method isn't documented at all, but referenced by ++download and expected to be used by consumers. I'm writing a full-featured Golang library for the SecuritySpy API; having accurate docs will certainly speed up the process.

    Thanks!
  • Are there any examples available of how to use ++eventStream? I'm trying to test it with curl and simply getting zilch for output. Curl "hangs open" like it's waiting for data, but nothing is ever printed; even if I go force things to happen like arm/disarm. The following is an example. Curl never exits, and nothing is ever printed again.

    $ curl -is "127.0.0.1:8000/++eventStream/"
    HTTP/1.1 200 OK
    Server: BBVS/4.0
    Cache-Control: max-age=0, must-revalidate
    Pragma: no-cache
    Keep-Alive: timeout=20, max=100
    Connection: Keep-Alive
    SS-UUID: C03L1333F8J3AkXIZS1O
    Content-Type: text/plain
  • Adding -N to curl to remove the buffer helps, but the lines printed appear to be missing carriage returns. Very odd output indeed; I'd love to see client code (in any language) that works with this stream. The (cynic) Indigo plugin I once used caused high CPU load, so a different example would be ideal.
  • I'm quickly cooking up a list of "I wish I had..." - is there anywhere in particular you'd like to see API feature requests? We can start with: Can we put the server timezone in ++systemInfo?

    EDIT: A local timestamp as one of the output fields that includes the time zone would probably be best. Then it's easy to identify the server's time as skewed.
  • I would love more documentation, with examples.
  • I'm happy to document the requests that aren't currently documented (e.g. ++getfile). Please let me know any other "hidden" requests you need, or any further clarification to existing documented requests.

    As for ++eventStream - curl won't render this properly, as it will be waiting for the end of the data, which never comes. You'll have to use an alternative method where you have access to the data as it comes in. Lines are terminated by CR (Ox13) rather than LF (0x10).

    We can add both the time zone and current time in ++systemInfo in the next update.
  • I'll write my list of requests. A lot of it revolves around documenting the XML data that is returned. i.e., what is each field a presentation of. I've also run across typos/un-edited copy/pastas and missing data, like the bitwise mask for ptz caps. Would you like my list pasted here, or into an email? Thanks!
  • If anyone is interested in interacting with SecuritySpy using Golang, please open an Issue under this project and tell me your use case. https://github.com/davidnewhall/go-securityspy/pull/1
  • OK it sounds like there might be a number of things to over, so perhaps it's best in an email - please send the list to support@bensoftware.com and we'll do our best to accommodate your requests (and please let us know about any typos in the documentation, no matter how small - we'll definitely want to fix all of these!).
  • Email Sent. Hope it's helpful!
  • Oh, and for anyone looking for a way to watch the event stream (++eventStream) with curl, use tr to change \r to \n. like this:

    curl -sN "127.0.0.1:8000/++eventStream/" | tr '\r' '\n'
  • The updates on this page are great! Thank you so much for updating the docs! The new go library supports nearly everything provided in the API, but I have a few more things to add with the new doc exposing previously-unknown methods.

    I also put together a simple CLI tool that prints out camera info, or event stream data. Find it here: https://github.com/davidnewhall/SecSpyCLI - I'll add some docs on how to use it soon, but the tech savvy can probably figure it out pretty quick. If anyone has other use cases for a CLI tool, please let me know through a github issue request.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!