Page 1 of 2

Restful API and Json API

Posted: Tue Jan 21, 2014 6:43 pm
by Duke Blogger

I'm trying to use the JsonAPI plugin in wordpress to bring in pieces of my site, like blog posts and so forth. Im not sure how the request/response works. I know my base url is http://dukeblogger.com/api/get_recent...


Restful API and Json API

Posted: Tue Jan 21, 2014 6:47 pm
by maxkatz

If you are new to Appery.io, please read the Getting Started section: http://docs.appery.io/getting-started and try some of the tutorials: http://docs.appery.io/tutorials. All tutorials cover how to work with REST services.

There is also documentation on using REST APIs: http://docs.appery.io/documentation/r...


Restful API and Json API

Posted: Wed Jan 22, 2014 5:48 pm
by Shawn Johnson

Duke,

Did you get this to work?, I was also doing the same thing, i was using wordpress as my backend and pulling posts via jquery.

I didn't have any issues with the url you posted,

just create a service and use your posted url and then go to test and test it from test click create a response, then you can map items in your view to the response object it took me a few tries before i got it down


Restful API and Json API

Posted: Wed Jan 22, 2014 6:18 pm
by Duke Blogger

when i click test i get the data but test response i get an error:

Incorrect format. Please verify sample response data and try again.


Restful API and Json API

Posted: Wed Jan 22, 2014 6:31 pm
by Shawn Johnson

Duke,

check your response json, I think there is an error in it, I ran in by jsonlit
http://pro.jsonlint.com/
just paste the url and hit the check button

and it returned an error "<!--PagenotcachedbyWPSuperCache.NoclosingHTMLtag.Checkyourtheme.--"

that is probably was causing the issue

you can try choosing a different theme and pulling the data again


Restful API and Json API

Posted: Wed Jan 22, 2014 6:43 pm
by Duke Blogger

I think i may have gotten it, it wasnt the theme but the wordpress cache plugin i was using. thank you so much for your help. nExt is mapping, wish me luck.


Restful API and Json API

Posted: Wed Jan 22, 2014 7:49 pm
by Duke Blogger

I thought i had it but it keeps returning nothing, perhaps a different error?


Restful API and Json API

Posted: Wed Jan 22, 2014 8:19 pm
by Shawn Johnson

Hey Duke,

It's seems to be working for me, check out my screen shots
I was able to create a test and generate a response object

I also ran the url through the json validator and it's valid

Image Image


Restful API and Json API

Posted: Wed Jan 22, 2014 8:27 pm
by Duke Blogger

Everything in your graphics i got to work, when i mapped the fields is when nothing showed up, but when i enabled the echo it finally worked for me. Thank you again. Clearly i'm a novice..lol


Restful API and Json API

Posted: Wed Jan 22, 2014 8:33 pm
by Shawn Johnson

it's all good, we are all an novice at some point. Glad you are making progress