Discussion:
API layer
Christian Foster
2013-06-04 07:15:44 UTC
Permalink
Hi all,

I've been working on a developer oriented API layer for WordPress - it's a
separate (but smallish) application that sits alongside your WordPress
install to help ease development of mobile, flash, JS clients etc.

Mobile-------->
JS Clients---> A
Flash----------> P ----> WordPress Admin
Feeds/Data-> I
Other---------->

It lets us use WordPress for what it is awesome at - the content
management, and helps provide a nice clean interface to that content. It
returns content in any number of configured media types using the Accepts
header or a content type in the URL (/posts/123.json). In progress or
completed so far are:

xml
csv
text
yaml
plist
pdf (with templating)
json
hypermedia formats:
- hal+json
- collection+json
- json+api
- hal+xml

Oauth2 authentication is also implemented with a start on scopes and api
endpoint access restrictions. I've been researching the different
approaches to secure JS clients.

My questions are:

a) is anyone interested in the project?
b) are there any features that people would like to see in a project like
this

It's built using the Lithium PHP framework - which is incredibly flexible.
At the moment it is built as a basis to work off, but there is no reason it
can't be changed into a standalone application with custom
routes/controllers in your own plugin.

Cheers.
Matthias Breuer
2013-06-04 08:10:00 UTC
Permalink
Hi Christian,

I am highly interested. Is there any code or a repo to look at? I'd really like to see your approach and how it handles the processing of requests.

Best,
Matthias
Post by Christian Foster
Hi all,
I've been working on a developer oriented API layer for WordPress - it's a
separate (but smallish) application that sits alongside your WordPress
install to help ease development of mobile, flash, JS clients etc.
Mobile-------->
JS Clients---> A
Flash----------> P ----> WordPress Admin
Feeds/Data-> I
Other---------->
It lets us use WordPress for what it is awesome at - the content
management, and helps provide a nice clean interface to that content. It
returns content in any number of configured media types using the Accepts
header or a content type in the URL (/posts/123.json). In progress or
xml
csv
text
yaml
plist
pdf (with templating)
json
- hal+json
- collection+json
- json+api
- hal+xml
Oauth2 authentication is also implemented with a start on scopes and api
endpoint access restrictions. I've been researching the different
approaches to secure JS clients.
a) is anyone interested in the project?
b) are there any features that people would like to see in a project like
this
It's built using the Lithium PHP framework - which is incredibly flexible.
At the moment it is built as a basis to work off, but there is no reason it
can't be changed into a standalone application with custom
routes/controllers in your own plugin.
Cheers.
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
Christian Foster
2013-06-04 11:47:49 UTC
Permalink
Sure - the repo is private at the moment (no real reason, just not
complete) but send me your github id and I'll add you as a collaborator.
Post by Matthias Breuer
Hi Christian,
I am highly interested. Is there any code or a repo to look at? I'd really
like to see your approach and how it handles the processing of requests.
Best,
Matthias
Am 04.06.2013 um 09:15 schrieb Christian Foster <
Post by Christian Foster
Hi all,
I've been working on a developer oriented API layer for WordPress - it's
a
Post by Christian Foster
separate (but smallish) application that sits alongside your WordPress
install to help ease development of mobile, flash, JS clients etc.
Mobile-------->
JS Clients---> A
Flash----------> P ----> WordPress Admin
Feeds/Data-> I
Other---------->
It lets us use WordPress for what it is awesome at - the content
management, and helps provide a nice clean interface to that content. It
returns content in any number of configured media types using the Accepts
header or a content type in the URL (/posts/123.json). In progress or
xml
csv
text
yaml
plist
pdf (with templating)
json
- hal+json
- collection+json
- json+api
- hal+xml
Oauth2 authentication is also implemented with a start on scopes and api
endpoint access restrictions. I've been researching the different
approaches to secure JS clients.
a) is anyone interested in the project?
b) are there any features that people would like to see in a project like
this
It's built using the Lithium PHP framework - which is incredibly
flexible.
Post by Christian Foster
At the moment it is built as a basis to work off, but there is no reason
it
Post by Christian Foster
can't be changed into a standalone application with custom
routes/controllers in your own plugin.
Cheers.
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
Ryan McCue
2013-06-04 13:51:45 UTC
Permalink
Post by Christian Foster
Hi all,
I've been working on a developer oriented API layer for WordPress - it's a
separate (but smallish) application that sits alongside your WordPress
install to help ease development of mobile, flash, JS clients etc.
Hey Christian,

I'm working on something similar as part of GSoC this year, but as a
plugin (with the eventual goal of core integration). You can check it
out at https://github.com/rmccue/WP-API

I'd love to hear about your experiences building your application. I've
previously implemented my own in a similar method (external application
hooked into WordPress) and although it's a little easier to implement,
it's less distributable.

Thanks,
--
Ryan McCue
<http://ryanmccue.info/>
Christian Foster
2013-06-05 02:59:50 UTC
Permalink
Hey Ryan,

Just had a look at WP-API - looks great. There is definitely some stuff in
there I can use.

Main issues for me developing are:

a) should it accept all parameters to WP_Query/WP_Comments_Query etc or
provide a simplified subset of available parameters (like the rest api on
wordpress.com)
b) output json - some clients (Ember for example) like particular formats
and there are lots of different conventions. I.e. wrapping the response in
a top level element like "posts", and sideloading comments instead of
embedding in the post themselves.
c) how to output menus - in a hierarchical format or flat with parent/child
keys and let the client deal with it
d) outputting media - should it just provide the URL to the media file or
do more like convert/optimize etc.
e) security - how to authenticate securely, assume it's not possible unless
site is on SSL. Different oauth grant types, scopes etc and how to use from
a JS only client.

Anyway - have added you as a collaborator, would love any ideas/feedback
you have.

Cheers.
Post by Ryan McCue
Post by Christian Foster
Hi all,
I've been working on a developer oriented API layer for WordPress - it's
a
Post by Christian Foster
separate (but smallish) application that sits alongside your WordPress
install to help ease development of mobile, flash, JS clients etc.
Hey Christian,
I'm working on something similar as part of GSoC this year, but as a
plugin (with the eventual goal of core integration). You can check it
out at https://github.com/rmccue/WP-API
I'd love to hear about your experiences building your application. I've
previously implemented my own in a similar method (external application
hooked into WordPress) and although it's a little easier to implement,
it's less distributable.
Thanks,
--
Ryan McCue
<http://ryanmccue.info/>
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
Continue reading on narkive:
Loading...