esme-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ethan Jewett <esjew...@gmail.com>
Subject Re: JQuery based client: Help needed
Date Wed, 17 Mar 2010 14:55:47 GMT
Hi Dick,

Would love to help. API2 is my favorite topic :-)

Are you trying to do this from within the web interface? Within a
browser? If so, then I think your requests will already have a session
attached. If not, then you should take the contents of the response
from your post to api2/session and include the value in the header of
your subsequent requests. I don't think this is native JQuery
functionality, but we can work through it.

Also, the API2 returns XML, not JSON, so you should probably use the
generic get/post methods and specify the content type as "xml".

Did the code you have below work for you or were you having an issue with it?

Ethan

On Wed, Mar 17, 2010 at 8:00 AM, Richard Hirsch <hirsch.dick@gmail.com> wrote:
> I have some cool ideas about using a JQuery based client application in a
> few integration scenarios. I'd like to use the API2 to login and return
> messages that are filtered by terms passed in Query params. I'dl ike to use
> the existing jquery scripts / HTML code to display the information.
>
> I've tried to do this on my own but haven't gotten very far.
>
>  $.postJSON("http://localhost:8080.com
> /api2/session?token=33UD2J50T5APTWOWXGZFME3VYFBCPVYA")
>
> $.getJSON("http://localhost:8080.com/api2/user/&callback=?",
>       function(data){
>
>               $.each(data, function(i,item){
>
>                       $("#tweets").append(item.text + "<BR/>");
>
>               });
>       });
>
> Could somebody give me hand?
>
> D.
>

Mime
View raw message