4. W H A T I S A R E S T A P I ?
‣ Separation Between Client and Server
‣ Stateless: No State, You Should Get Same
Data From Same Requests
‣ Cacheable
‣ Layerable: Load-Balancing, etc.
‣ Uniform: REST APIs typically tell you how to
access the data.
‣ Flexible: Doesn’t Matter Where Server/Client
Area, Or What They Are
‣ Simple: Uses Standard/Established Methods
5. C R U D A N D H T T P M E T H O D S
‣ CREATE -> POST
‣ READ -> GET
‣ UPDATE -> PUT
‣ DELETE -> DELETE
10. P O S T M A N
https://www.getpostman.com/
Allows us to build and send
requests to our API and also
process and handle responses. A
really great tool for working with
any type of REST API, not just the
WordPress API.
47. T H E R E A R E 4 B A S I C T Y P E S O F
A U T H E N T I C A T I O N A VA I L A B L E F O R U S E R I G H T N O W:
‣ Basic Authentication – via a plugin
‣ Cookie Authentication – out of the box
‣ Oauth2 Authentication – via a plugin (third party)
‣ Oauth1 Authentication – via a plugin
48. T H E R E A R E 4 B A S I C T Y P E S O F
A U T H E N T I C A T I O N A VA I L A B L E F O R U S E R I G H T N O W:
‣ Basic Authentication – via a plugin
‣ Cookie Authentication – out of the box
‣ Oauth2 Authentication – via a plugin (third party)
‣ Oauth1 Authentication – via a plugin
49.
50. B A S I C - A U T H
https://github.com/WP-API/Basic-Auth
51. TA D A ! B A S I C A U T H G E T S Y O U T H E S A M E
A C C E S S / R O L E S A S Y O U R W P U S E R
52. F O R E X A M P L E , I F Y O U H A V E A D M I N
A C C E S S Y O U C A N S E E A L L U S E R S
53. T H E R E A R E 4 B A S I C T Y P E S O F
A U T H E N T I C A T I O N A VA I L A B L E F O R U S E R I G H T N O W:
‣ Basic Authentication – via a plugin
‣ Cookie Authentication – out of the box
‣ Oauth2 Authentication – via a plugin (third party)
‣ Oauth1 Authentication – via a plugin
54. T H E R E A R E 4 B A S I C T Y P E S O F
A U T H E N T I C A T I O N A VA I L A B L E F O R U S E R I G H T N O W:
‣ Basic Authentication – via a plugin
‣ Cookie Authentication – out of the box
‣ Oauth2 Authentication – via a plugin (third party)
‣ Oauth1 Authentication – via a plugin
55. T H E R E A R E 4 B A S I C T Y P E S O F
A U T H E N T I C A T I O N A VA I L A B L E F O R U S E R I G H T N O W:
‣ Basic Authentication – via a plugin
‣ Cookie Authentication – out of the box
‣ Oauth2 Authentication – via a plugin (third party)
‣ Oauth1 Authentication – via a plugin
56. D I G G I N G I N T O T H E A P I :
C R E AT I N G A N E W P O S T
57.
58.
59. D I G G I N G I N T O T H E A P I :
A D D N I N G & U P D AT I N G P O S T
M E TA T O A P O S T
60.
61. D I G G I N G I N T O T H E A P I :
D E L E T I N G A P O S T
62.
63. W H Y T H I S I S C O O L
‣ “Reverse Mullet”: Business in back, party in the front
‣ You don’t have to write PHP (write what you want)
‣ WordPress Can Now Power Native Mobile
Applications
‣ Desktop Applications Possible
‣ More engaging user experience
‣ Offline: Control over failed connections, etc.
64. T H E M E S W I T H T H E
W O R D P R E S S R E S T A P I
65.
66. B U I L D I N G A P L U G I N U S I N G
W P - A P I A N D A J A X
68. T H I N K A B O U T T H E A P I R E Q U E S T U R L
69. ‣ New WordPress 4.4 Install
‣ Used FakerPress To Add Random Content/
Categories
‣ Installed the WP REST API Plugin
‣ Using Popper As My Theme
B U I L D T H E P L U G I N : S E T U P
70. B U I L D T H E P L U G I N : F I R S T S T E P S
71. B U I L D T H E P L U G I N : F I R S T S T E P S
72. B U I L D T H E P L U G I N : S E T U P
F U N C T I O N S
73.
74. S O O N 2 5 % O F T H E W E B
W I L L H A V E A C C E S S T O T H E W O R D P R E S S R E S T A P I
A N D W I L L B E U S E D F O R I N T E R E S T I N G T H I N G S
75. R E S O U R C E S
http://wp-api.org/ Official Documentation