REST API setting read state

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



REST API setting read state Expand / Collapse
Author
Message
Posted 9/21/2007 8:17:15 AM
Forum Member

Forum Member

Group: Forum Members
Last Login: 10/2/2007 6:06:36 AM
Posts: 6, Visits: 13
Hello, I'm having some difficulty in setting the read state of an item using the REST API. I'm issuing:

curl http://services.newsgator.com/ngws/svc/PostItem.aspx?loc=Egress&r=3532702849 --user : --header "X-NGAPIToken: " --request POST

and I receive a 401.2 Access Denied. Is there something obvious that I'm doing wrong? Any help would be appreciated. Thanks.


Post #31463
Posted 9/24/2007 11:09:23 AM
NewsGator

NewsGator

Group: NewsGator Staff
Last Login: 11/5/2007 3:20:31 PM
Posts: 6, Visits: 16
Hi Garish, I've been looking into this and can't seem to repeat the access denied response.  We currently do not have any restrictions on this method.  However, I was able to repeat this with invalid credentials.  Is the crendential issue a possibility?
Post #31522
Posted 9/25/2007 9:02:53 AM
Forum Member

Forum Member

Group: Forum Members
Last Login: 10/2/2007 6:06:36 AM
Posts: 6, Visits: 13
Chris,

Thanks very much for the response. It was a "loose nut at the keyboard" as I had neglected to add --digest to the curl command line. On a related note, if I issue an "unread" command (u=xxxxx) should I then see the item reappear in the web reader?

-Karl
Post #31545
Posted 9/25/2007 9:59:18 AM
NewsGator

NewsGator

Group: NewsGator Staff
Last Login: 11/5/2007 3:20:31 PM
Posts: 6, Visits: 16
Hi Karl, no the item will not show up again in the web reader.  I've submitted this issue as a bug (item not reappearing) and will follow up on this when a resolution is availble.

Thanks,

Chris

Post #31547
Posted 10/5/2007 11:22:04 AM


Forum Member

Forum Member

Group: NewsGator Staff
Last Login: 7/11/2008 5:06:31 PM
Posts: 3, Visits: 61
Karl,

We do have a fix for this now, and we will reply when it has been pushed to production.

Thanks,

Rob

Post #31931
Posted 10/31/2007 2:13:08 PM
NewsGator

NewsGator

Group: NewsGator Staff
Last Login: 11/5/2007 3:20:31 PM
Posts: 6, Visits: 16
Karl,

The fix for this is now available ! ! !  We appreciate your support Karl.

Thanks,

Chris

Post #32748
Posted 11/1/2007 10:41:07 AM
Forum Member

Forum Member

Group: Forum Members
Last Login: 2/6/2008 5:46:23 AM
Posts: 2, Visits: 20
Hello guys,

Setting unread state still doesn't work for me.

First I'm setting read state (works fine)


POST /ngws/svc/PostItem.aspx HTTP/1.0
Pragma: no-cache
X-NGAPIToken: ****************
Authorization: Basic ****************=
Content-Type: application/x-www-form-urlencoded
Content-Length: 42
Host: services.newsgator.com
User-Agent: Foobar

loc=NewsGator%20Web%20Edition&r=3729785502



HTTP/1.1 200 OK
Connection: close
Date: Thu, 01 Nov 2007 15:56:56 GMT
Server: Microsoft-IIS/6.0
MicrosoftOfficeWebServer: 5.0_Pub
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Cache-Control: private
Content-Type: application/application/xml+xml
Content-Length: 313548

... XML stuff


Then I'm trying to set unread state (looks ok from the HTTP point of view)


POST /ngws/svc/PostItem.aspx HTTP/1.0
Pragma: no-cache
X-NGAPIToken: ****************
Authorization: Basic ****************=
Content-Type: application/x-www-form-urlencoded
Content-Length: 42
Host: services.newsgator.com
User-Agent: Foobar

loc=NewsGator%20Web%20Edition&u=3729785502



HTTP/1.1 200 OK
Connection: close
Date: Thu, 01 Nov 2007 15:57:05 GMT
Server: Microsoft-IIS/6.0
MicrosoftOfficeWebServer: 5.0_Pub
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Cache-Control: private
Content-Type: application/application/xml+xml
Content-Length: 313548

... XML stuff


But the item doesn't reappear in my interface (a tiny reader for the Archos 605 PMP, by the way).

Did I miss something ?

Anyway, Newsgator is a great product.

Thanks for that !

Yannick
Post #32803
Posted 11/5/2007 3:20:31 PM
NewsGator

NewsGator

Group: NewsGator Staff
Last Login: 11/5/2007 3:20:31 PM
Posts: 6, Visits: 16
Hi Yannick,

here is the link to the REST API

http://www.newsgator.com/ngs/api/NewsGatorRESTAPI.pdf

if you look on page 26 this call is detailed.  Essentially, your "loc=NewsGator%20Web%20Edition&u=3729785502" needs to be in the post data portion of the request, not part of the URI.  This call is a little different from the others in that the post data cannot be part of the URI.

Hope that helps!

Regards,

Chris

Post #32958
Posted 11/6/2007 2:57:08 PM
Forum Member

Forum Member

Group: Forum Members
Last Login: 2/6/2008 5:46:23 AM
Posts: 2, Visits: 20
Hello Chris,

Thanks for your response, but I do use POST method for the query.


POST /ngws/svc/PostItem.aspx HTTP/1.0
Pragma: no-cache
X-NGAPIToken: ****************
Authorization: Basic ****************=
Content-Type: application/x-www-form-urlencoded
Content-Length: 42
Host: services.newsgator.com
User-Agent: Foobar

loc=NewsGator%20Web%20Edition&u=3729785502


I'm going to do some more tests side by side with Newsgator online reader...

Yannick
Post #33016
« Prev Topic | Next Topic »