Api questions and issues

Post Reply
Posts: 1
Joined: Sun Mar 22, 2015 4:27 am

Api questions and issues

Post by BobCratchett » Sun Mar 22, 2015 4:46 am

Hi all, and may I thank you in advance for any answers you can provide to the following queries - I've been working with Argus' rest API for a couple of weeks and, in that time, I've come to the conclusion that there probably is an obvious answer to all of my questions. But, to be frank, I'm not intelligent to get them on my own :)

Long story short, I'm working on my own IOS client for Argus - one that works, unlike the recent keychain problems that have plagued the client linked on the forums, even if it will be completely incompatible with that client from a technical perspective (OK, I'll admit, I don't understand that clients code for toffee, let alone know how to get it working). And one written in Swift (Apple's comparatively new program language, for IOS 8+), not Objective-C. Ignoring the fact that I'm not a paid Apple IOS Developer - which obviously presents its own problems, and means I'm planning on presenting open source code, not an App Store App - I've had a couple issue, which are preventing me actually completing this project, which I hope someone might be able to provide some help with :)

First issue I'm having is registering for event listeners - using the deprecated method SubscribeEvents/{eventGroups} works great (and then getting GetServiceEvents/{uniqueClientId} to keep up to date) - but using the current api - /ServiceEvents/{uniqueClientId}/Subscribe/{eventGroups} - doesn't! I feel like I'm missing something obvious with this, but I can't figure out what!

To be clear, using the (deprecated) uri "Core/SubscribeServiceEvents/15" (obviously against the local Argus TV server instance) works perfectly. However, using "Core/ServiceEvents/[ID]/Subscribe/15" (where ID is a GUID uniquely generate by my app) doesn't - the first example returns a UniqueClientId, as the docs say it should, and I'm able to get service events via the relevant API. The other doesn't provide any error (no error in the returned data, and a http code of 500) but no GUID is returned (as the docs say should be), and I don't get any new ServiceEvents when I call that functions. I'm obviously doing something wrong, and would appreciate any suggestions as to what (please say if specific code examples would help!)

Once I get past that, the only other issue I'm working against is keeping up to date a list of which programs are scheduled by which schedule. When just using one client this obviously isn't an issue, but when deleting recording/schedule on one client, there doesn't appear to be a notification for other clients that this information has been updated.

(If it helps, the client I'm designing is reactive rather then pro-active - that is to say, it gets ALL relevant information on startup - channels, scheduled, recording, alerts, schedules, suggestions, recordings, etc - then relies on Service Events to know when it needs to update any aspect of the information it has. I suspect, having spend some time with the api, the it's primarily intended to be reactive (e.g. when the user wants to display something, the information is then retrieved), but this doesn't really fit the IOS design pattern :))

Thanks for any information you can provide. Whilst I'll undoubtedly have questions about schedules to ask later - for example, I don't understand how channels are selected in a s schedule, but I'm not at the stage of looking seriously into that ;) , any information you can provide will get me that much closer to an OSS IOS solution and so I thank you in advance :)

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests