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

WP REST API

WP REST API

In Hans-Helge’s Session geht es um die WordPress REST API, mit deren Einführung WordPress zu einer erweiterten Framework wird. Der Kreativität sind damit kaum Grenzen gesetzt. Die Entwicklung sollte kein WordPress-Nutzer verpassen.

Hans-Helge Buerger

June 07, 2015
Tweet

More Decks by Hans-Helge Buerger

Other Decks in Programming

Transcript

  1. WP REST API
    WordCamp Köln 2015 – Hans-Helge Bürger 1

    View full-size slide

  2. Hans-Helge Bürger
    » @obstschale
    » Master Student an der TU Berlin
    » Freiberufler für WordPress Entwicklung
    WordCamp Köln 2015 – Hans-Helge Bürger 2

    View full-size slide

  3. 1
    WordCamp Köln 2015 – Hans-Helge Bürger 3

    View full-size slide

  4. “This plugin
    provides an easy to
    use REST API,
    available via HTTP.”
    WordCamp Köln 2015 – Hans-Helge Bürger 4

    View full-size slide

  5. WP, REST und andere Akronyme
    1.WP = WordPress
    2.API = Application Program Interface
    3.REST = Representational State Transfer
    4.JSON = JavaScript Object Notation
    WordCamp Köln 2015 – Hans-Helge Bürger 5

    View full-size slide

  6. WordCamp Köln 2015 – Hans-Helge Bürger 6

    View full-size slide

  7. REST
    » Create -> POST
    » Read -> GET
    » Update -> PUT
    » Delete -> DELETE
    WordCamp Köln 2015 – Hans-Helge Bürger 7

    View full-size slide

  8. GET https://poststatus.com/wp-json/posts/12432
    {
    "ID": 12432,
    "title": "WordPress 4.2, “Powell”, released",
    "status": "publish",
    "type": "post",
    "author": {
    "ID": 1,
    "username": "krogsgard",
    "name": "Brian Krogsgard",
    "first_name": "Brian",
    "last_name": "Krogsgard",
    "nickname": "krogsgard",
    "slug": "krogsgard",
    "URL": "",
    "avatar": "https://0.gravatar.com/avatar/6b89515a9781282ae3a66d4b6173523c?s=96",
    "description": "I'm a WordPress developer from Birmingham, Alabama. I'm the creator and editor of Post Status.",
    "registered": "2012-12-09T20:04:39+00:00",
    "meta": {
    "links": {
    "self": "https://poststatus.com/wp-json/users/1",
    "archives": "https://poststatus.com/wp-json/users/1/posts"
    }
    }
    },
    "content": "Blog Post",
    }
    WordCamp Köln 2015 – Hans-Helge Bürger 8

    View full-size slide

  9. https://wapuu.kölsch/wp-json/posts/12432
    https://wapuu.kölsch/wp-json/pages/
    https://wapuu.kölsch/wp-json/taxonomies/
    https://wapuu.kölsch/wp-json/comments/
    https://wapuu.kölsch/wp-json/users/
    https://wapuu.kölsch/wp-json/beer/
    WordCamp Köln 2015 – Hans-Helge Bürger 9

    View full-size slide

  10. https://wapuu.kölsch/wp-json/users
    WordCamp Köln 2015 – Hans-Helge Bürger 10

    View full-size slide

  11. https://wapuu.kölsch/wp-json/users
    [{
    "code": "json_user_cannot_list",
    "message": "Sorry, you are not allowed to list users."
    }]
    WordCamp Köln 2015 – Hans-Helge Bürger 11

    View full-size slide

  12. Authentication
    WordCamp Köln 2015 – Hans-Helge Bürger 12

    View full-size slide

  13. XML-RPC API
    XML-Remote Procedural Call API
    WordCamp Köln 2015 – Hans-Helge Bürger 13

    View full-size slide

  14. 2
    WordCamp Köln 2015 – Hans-Helge Bürger 14

    View full-size slide

  15. Wer steckt dahinter?
    WordCamp Köln 2015 – Hans-Helge Bürger 15

    View full-size slide

  16. » https://github.com/WP-API/WP-API
    » https://wordpress.org/plugins/json-rest-api/
    » http://v2.wp-api.org/
    WordCamp Köln 2015 – Hans-Helge Bürger 16

    View full-size slide

  17. Warum sollte mich
    das ganze interessieren?
    WordCamp Köln 2015 – Hans-Helge Bürger 17

    View full-size slide

  18. Oh My God!
    Das
    Ändert
    Alles!
    WordCamp Köln 2015 – Hans-Helge Bürger 18

    View full-size slide

  19. 3
    WordCamp Köln 2015 – Hans-Helge Bürger 19

    View full-size slide

  20. Anwendungsfälle
    Exponentielle Steigerung der Innovativen Möglichkeiten
    WordCamp Köln 2015 – Hans-Helge Bürger 20

    View full-size slide

  21. Angepasste
    Backends
    WordCamp Köln 2015 – Hans-Helge Bürger 21

    View full-size slide

  22. WordCamp Köln 2015 – Hans-Helge Bürger 22

    View full-size slide

  23. Erweiterte
    Frontends / Themes
    WordCamp Köln 2015 – Hans-Helge Bürger 23

    View full-size slide

  24. Tablet /
    Smartphone /
    Desktop Apps
    WordCamp Köln 2015 – Hans-Helge Bürger 24

    View full-size slide

  25. Custom Plugin APIs
    WordCamp Köln 2015 – Hans-Helge Bürger 25

    View full-size slide

  26. WordCamp Köln 2015 – Hans-Helge Bürger 26

    View full-size slide

  27. 4
    WordCamp Köln 2015 – Hans-Helge Bürger 27

    View full-size slide

  28. Wann wird die
    API im Core sein?
    WordCamp Köln 2015 – Hans-Helge Bürger 28

    View full-size slide

  29. ¯\_()_/¯
    WordCamp Köln 2015 – Hans-Helge Bürger 29

    View full-size slide

  30. Danke
    Hans-Helge Bürger | @obstschale
    Quellen: http://bit.ly/rest-evernote
    Slides: http://bit.ly/rest-presentation
    WordCamp Köln 2015 – Hans-Helge Bürger 30

    View full-size slide