Rest doc?

Newsgator Forums
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        


12»»

Rest doc? Expand / Collapse
Author
Message
Posted 9/13/2005 10:50:46 PM
Forum Member

Forum Member

Group: Forum Members
Last Login: 1/11/2006 7:17:00 PM
Posts: 2, Visits: 1
I see plenty of soap doc, is there some rest doc also?
Post #8170
Posted 9/14/2005 11:18:46 AM
Rockstar

Rockstar

Group: Forum Members
Last Login: 3/27/2007 8:15:46 AM
Posts: 173, Visits: 19
Hi,

No we (well, *I*) haven't got around to documenting the REST interface, partly because we wanted to evaluate demand and partly because I've changed my mind about how to handle POSTing data into the endpoint and am working on the cycles. With respect to the first point, anybody else who's more interested in a REST version than a SOAP version, leave a comment here or send mail to support@newsgator.com so we can get a feel for the demand. With respect to the second point, I had started just creating a page that accepted certain parameters on a POST for things like create and modify operations, but now I'm rolling around towards POSTing back data in the same form that the GET returns it in. Let me walk through this a little:
In general, if you change the extension of the ASMX endpoint to .aspx, that's the endpoint for the REST version and you can explore simple GETs. For example, you can start with http://services.newsgator.com/ngws/svc/Location.aspx
This returns an OPML document with elements, for example:
<outline title="NewsGator Web Edition" ng:id="3" xmlUrl="http://services.newsgator.com/ngws/svc/Subscription.aspx/NewsGator%20Web%20Edition"/>
So the idea is that to create a location, you would post an OPML document with something like this:
<outline title="My New Location" />
Though in truth, that's not implemented yet, but that's where I'm going. DELETEs will work, but I'll provide some sort of overloaded operation on POST to allow for user agents that can't do DELETE.
Anyway, continuing from the Location.aspx GET response if you follow the xmlUrl, this takes you to the Subscription endpoint. Similarly, Subscription.aspx returns OPML that contains an ng:syncXmlUrl attribute that leads you to Feed.aspx, which produces RSS with extension elements that cover things like read/deleted states and ratings.
The one exception to all this is the PostItem.asmx service, which has no REST counterpart.
Post #8172
Posted 9/15/2005 10:57:45 AM
Forum Member

Forum Member

Group: Forum Members
Last Login: 11/25/2005 11:22:00 AM
Posts: 6, Visits: 1
Oh my yes, would much rather work with REST than SOAP.

Having said that, I would also much rather see something other than a Visual Studio C# application as the only example for the SOAP API because it's become a bear to convert it into nusoap -- especially since I'm having to figure in both credentials and the token, as well as intuit much of the workings.



Shelley
Post #8182
Posted 9/18/2005 9:27:03 PM
Rockstar

Rockstar

Group: Forum Members
Last Login: 3/27/2007 8:15:46 AM
Posts: 173, Visits: 19
Sorry Shelley, I thought I had responded to this a couple days ago, but apparently I never hit post. I have been working on a Python implementation on the side, but also have been frustrated by SOAPPy (yeah, I know, that should have been a warning to me). I'll try to see what I can get together and post it soon. My knowlege of PHP is next to nil, but we have at least one other customer using PHP and nusoap, so perhaps my efforts would be better spent on that?
Post #8221
Posted 9/19/2005 4:45:42 AM
Forum Member

Forum Member

Group: Forum Members
Last Login: 11/25/2005 11:22:00 AM
Posts: 6, Visits: 1
Gordon, no worries. I have it working nicely now with nuSOAP, and will post a general how to on this to my own site when I'm finished building the wrapper for my cilent.



Shelley
Post #8222
Posted 9/19/2005 10:43:40 AM
Rockstar

Rockstar

Group: Forum Members
Last Login: 3/27/2007 8:15:46 AM
Posts: 173, Visits: 19
Thanks Shelley, that's great news on both fronts, I'm glad to hear you're up and running and I'd love to hear the PHP implementation details when you get a chance.
Post #8225
Posted 10/18/2005 12:37:28 PM
Forum Member

Forum Member

Group: Forum Members
Last Login: 10/2/2007 6:06:36 AM
Posts: 6, Visits: 13
Regarding the REST implementation, is there an REST implementation of SetState available? Thanks.

-Karl
Post #8846
Posted 10/18/2005 1:54:39 PM
Rockstar

Rockstar

Group: Forum Members
Last Login: 3/27/2007 8:15:46 AM
Posts: 173, Visits: 19
Unfortunately, PostItem.asmx has no REST equivalent. One thing you can do is use the HTTP POST SOAP binding, which is actually effectively what the REST version would end up doing anyway. For instance, you can mark post IDs 1234 and 5678 "read" using the following CURL command line (for a Windows command line, you have to escape & with the ^ symbol, I think in a unix shell you'd just omit the carets and quote the whole argument to -d)

curl -u username:password -H "X-NGAPIToken:YOURAPITOKENHERE" -d locationName=NewsGator+Web+Edition^&readPosts=1234&readPosts=5678^&unreadPosts=0^&deletedPosts=0 http://services.newsgator.com/ngws/svc/PostItem.asmx/SetState
Post #8849
Posted 11/3/2005 12:47:52 PM
Forum Member

Forum Member

Group: Forum Members
Last Login: 10/2/2007 6:06:36 AM
Posts: 6, Visits: 13
Perhaps I am missing something, but I would like to allow a user to create a new location and modify the subscription list for that new location and so I have a few procedural questions:

1. Is there a post equivalent of addLocation. The documentation states that it is SOAP only. I haven't tried yet but was since I needed some other questions answered thought I'd ask.

2. Once the new location has been added, I would like to get a complete list of all subscriptions to choose from like the web interface - so I can provide a similar checkbox interface. I see how to get a list of subscriptions for the location, but not how to get the "master" list for the user.

3. Why does the getSubscriptionList require a syncToken. After adding a new location, I don't have a syncToken so the getSubscriptionList will fail.

Thanks for your time.

-Karl