Upgrade to Pro — share decks privately, control downloads, hide ads and more …

WordPress REST API un Calypso

Kaspars
November 26, 2015

WordPress REST API un Calypso

Introduction to WordPress REST API and WordPress.com Calypso for a WordPress Meetup in Rīga, Latvia.

Kaspars

November 26, 2015
Tweet

More Decks by Kaspars

Other Decks in Technology

Transcript

  1. Saņemt jaunākos rakstus GET http://demo.wp-api.org/wp-json/wp/v2/posts [ { "id": 36, "date":

    "2015-11-20T13:09:26", "title": { "rendered": "Kāda ir dzīves jēga?" }, "content": { "rendered": "Kāpēc man nav sarkans Mersedes?" }, }, { "id": 146, "link": "http://demo.wp-api.org/2015/10/22/quaerat-del…" } ]
  2. Saņemt jaunākos komentārus [ { "id": 91, "post": 49, "author_name":

    "Luisa Bayer", "author_url": "https://www.Boyer.com/ea-error-et-quae-venia", "date": "2015-12-29T03:00:52", "date_gmt": "2015-12-29T03:00:52", "content": { "rendered": "Superīgs blogs, paldies tev!!11" }, "link": "http://demo.wp-api.org/2015/05/26/commodi-…", "status": "approved", "type": "comment", }, { "id": 136, } GET http://demo.wp-api.org/wp-json/wp/v2/comments
  3. Publicēt jaunu rakstu { "ID": 1002, "date": "2015-11-26T17:58:47+00:00", "modified": "2015-11-26T17:58:47+00:00",

    "title": "Santa Barbara birojā", "content": "..." } POST http://demo.wp-api.org/wp-json/wp/v2/posts 
 { "title": "Santa Barbara birojā", "content": "Šodien notika kaut kas nenormāls..." }
  4. [ { "id": 36, "date": "2015-11-20T13:09:26", "title": { "rendered": "Kāda

    ir dzīves jēga?" }, "content": { "rendered": "Kāpēc man nav sarkans Mersedes?" }, }, { "id": 146, "link": "http://demo.wp-api.org/2015/10/22/quaerat-del…" } ] Lietotnes saskarsni veido
 Objective-C vai Java
  5. POST http://demo.wp-api.org/wp-json/wp/v2/posts 
 { "title": "Santa Barbara birojā", "content": "Šodien

    notika kaut kas nenormāls..." } { "ID": 1002, "date": "2015-11-26T17:58:47+00:00", "modified": "2015-11-26T17:58:47+00:00", "title": "Santa Barbara birojā", "content": "..." } Vietnes saskarsni veido
 HTML, CSS un JavaScript