SlideShare a Scribd company logo
1 of 15
Download to read offline
Getting Started with 
WordPress JSON REST API 
Takuro Hishikawa 
concrete5 Japan Inc. 
! 
An author of Really Simple CSV Importer plugin 
(20,000+ download! Thanks!)
What Is the JSON REST 
API? 
• Started as GSOC project 
• Now provided as plugin 
• Planned merge into core at future release
“Access your WordPress site’s data through 
an easy-to-use HTTP REST API.” 
–http://wp-api.org/
“JSON is a data format based on 
Javascript’s representation of objects, but 
it’s widely used because it can be easily 
represented in almost every programming 
language.” 
–Ryan McCue 
http://wptavern.com/ryan-mccue-on-creating-the-json-rest-api-for-wordpress
Resources 
• Posts (Create/Retrieve/Edit/Delete) 
• Meta (Create/Retrieve/Edit/Delete) 
• Media (Create/Get) 
• Users (Create/Retrieve/Edit/Delete) 
• Taxonomy/Terms (Retrieve)
Building App Example 
• Framework = concrete5 
• Library = Zend_Oauth, Zend_Http_Client
Demo 
• Get posts from WordPress 
• Get the specific post from WordPress 
• Insert a new post to WordPress
Step by step
Set up the plugin 
• https://github.com/WP-API/WP-API/ 
• https://github.com/WP-API/OAuth1/
Get Access Token from 
WordPress 
• Blog post (Japanese) 
• http://notnil-creative.com/blog/archives/ 
3301
Send HTTP Request to 
WordPress 
$client = Loader::helper('wp_api','rest_wordpress')->getClient(); 
$client->setUri($wp_rest_api_url.’/posts'); 
$client->setMethod(Zend_Http_Client::GET); 
$client->setParameterGet('filter[posts_per_page]',$num); 
$client->setParameterGet(‘filter[cat]',$cat); 
$client->setParameterGet('filter[orderby]','title'); 
$client->setParameterGet(‘filter[order]','ASC'); 
$response = $client->request();
Send HTTP Request to 
WordPress 
$client = Loader::helper('wp_api','rest_wordpress')->getClient(); 
$client->setUri($wp_rest_api_url.'/posts'); 
$client->setMethod(Zend_Http_Client::POST); 
$data = array( 
'title' => $this->post('post_title'), 
'content_raw' => $this->post('post_body'), 
'status' => 'publish' 
); 
$client->setRawData(Loader::helper('json')->encode($data),'application/ 
json'); 
$res = $client->request();
Easy, right?
• As you can see, working with JSON REST API requires 
little knowledge of OAuth and building HTTP 
Request… 
• Use library! 
JSON is a popular object type, OAuth is also popular 
• Some issues… 
https://github.com/WP-API/OAuth1/issues/37 
https://github.com/WP-API/OAuth1/issues/34
Thanks! 
Follow me! 
! 
Twitter: @HissyNC 
GitHub: @hissy

More Related Content

What's hot

How WordPress Sites Get Hacked
How WordPress Sites Get HackedHow WordPress Sites Get Hacked
How WordPress Sites Get HackedAndrew Marks
 
Single Page Application Development with backbone.js and Simple.Web
Single Page Application Development with backbone.js and Simple.WebSingle Page Application Development with backbone.js and Simple.Web
Single Page Application Development with backbone.js and Simple.WebChris Canal
 
Real World Rails Deployment
Real World Rails DeploymentReal World Rails Deployment
Real World Rails DeploymentAlan Hecht
 
Presentation on Gatsby to SF Static Web Tech Meetup
Presentation on Gatsby to SF Static Web Tech MeetupPresentation on Gatsby to SF Static Web Tech Meetup
Presentation on Gatsby to SF Static Web Tech MeetupKyle Mathews
 
Javascript Myths and its Evolution
Javascript Myths and its  EvolutionJavascript Myths and its  Evolution
Javascript Myths and its EvolutionDeepu S Nath
 
Moving from PHP to a nodejs full stack CMS
Moving from PHP to a nodejs full stack CMSMoving from PHP to a nodejs full stack CMS
Moving from PHP to a nodejs full stack CMSMake & Build
 
User-percieved performance
User-percieved performanceUser-percieved performance
User-percieved performanceMike North
 
Wordpress as a Backend
Wordpress as a BackendWordpress as a Backend
Wordpress as a BackendAndrew Duthie
 
AppFx.ServiceBus - Simple Messaging with Windows Azure Service Bus
AppFx.ServiceBus - Simple Messaging with Windows Azure Service BusAppFx.ServiceBus - Simple Messaging with Windows Azure Service Bus
AppFx.ServiceBus - Simple Messaging with Windows Azure Service BusMichael Stephenson
 
Ruby on Rails Crash course
Ruby on Rails Crash courseRuby on Rails Crash course
Ruby on Rails Crash courseandreanodari
 
Writing a Fullstack Application with Javascript - Remote media player
Writing a Fullstack Application with Javascript - Remote media playerWriting a Fullstack Application with Javascript - Remote media player
Writing a Fullstack Application with Javascript - Remote media playerTikal Knowledge
 
Wix Apps in WP TLV
Wix Apps in WP TLVWix Apps in WP TLV
Wix Apps in WP TLVdsero
 
How to build a rest api
How to build a rest apiHow to build a rest api
How to build a rest apiHoang Nguyen
 
Scaling Tech in Asia
Scaling Tech in AsiaScaling Tech in Asia
Scaling Tech in AsiaLester Chan
 

What's hot (20)

How WordPress Sites Get Hacked
How WordPress Sites Get HackedHow WordPress Sites Get Hacked
How WordPress Sites Get Hacked
 
Single Page Application Development with backbone.js and Simple.Web
Single Page Application Development with backbone.js and Simple.WebSingle Page Application Development with backbone.js and Simple.Web
Single Page Application Development with backbone.js and Simple.Web
 
Real World Rails Deployment
Real World Rails DeploymentReal World Rails Deployment
Real World Rails Deployment
 
Keystone.js 101
Keystone.js 101Keystone.js 101
Keystone.js 101
 
Presentation on Gatsby to SF Static Web Tech Meetup
Presentation on Gatsby to SF Static Web Tech MeetupPresentation on Gatsby to SF Static Web Tech Meetup
Presentation on Gatsby to SF Static Web Tech Meetup
 
ASP.NET MVC 4
ASP.NET MVC 4ASP.NET MVC 4
ASP.NET MVC 4
 
Javascript Myths and its Evolution
Javascript Myths and its  EvolutionJavascript Myths and its  Evolution
Javascript Myths and its Evolution
 
Gatsby intro
Gatsby introGatsby intro
Gatsby intro
 
Moving from PHP to a nodejs full stack CMS
Moving from PHP to a nodejs full stack CMSMoving from PHP to a nodejs full stack CMS
Moving from PHP to a nodejs full stack CMS
 
User-percieved performance
User-percieved performanceUser-percieved performance
User-percieved performance
 
Wordpress as a Backend
Wordpress as a BackendWordpress as a Backend
Wordpress as a Backend
 
AppFx.ServiceBus - Simple Messaging with Windows Azure Service Bus
AppFx.ServiceBus - Simple Messaging with Windows Azure Service BusAppFx.ServiceBus - Simple Messaging with Windows Azure Service Bus
AppFx.ServiceBus - Simple Messaging with Windows Azure Service Bus
 
Ruby on Rails Crash course
Ruby on Rails Crash courseRuby on Rails Crash course
Ruby on Rails Crash course
 
Writing a Fullstack Application with Javascript - Remote media player
Writing a Fullstack Application with Javascript - Remote media playerWriting a Fullstack Application with Javascript - Remote media player
Writing a Fullstack Application with Javascript - Remote media player
 
Rest assured
Rest assuredRest assured
Rest assured
 
Wix Apps in WP TLV
Wix Apps in WP TLVWix Apps in WP TLV
Wix Apps in WP TLV
 
Api crash
Api crashApi crash
Api crash
 
How to build a rest api
How to build a rest apiHow to build a rest api
How to build a rest api
 
Scaling Tech in Asia
Scaling Tech in AsiaScaling Tech in Asia
Scaling Tech in Asia
 
Evolution of java script libraries
Evolution of java script librariesEvolution of java script libraries
Evolution of java script libraries
 

Viewers also liked

Gifted
GiftedGifted
Giftedsmwatt
 
My presentation
My presentationMy presentation
My presentationrdresher
 
Web conferencing
Web conferencingWeb conferencing
Web conferencingmazyooonah
 
Walk your pokemon
Walk your pokemonWalk your pokemon
Walk your pokemonYoonsin Oh
 
Web conferencing
Web conferencingWeb conferencing
Web conferencingmazyooonah
 
"Основные ошибки при запуске мобильной игры", Алекс Пацай, руководитель мобил...
"Основные ошибки при запуске мобильной игры", Алекс Пацай, руководитель мобил..."Основные ошибки при запуске мобильной игры", Алекс Пацай, руководитель мобил...
"Основные ошибки при запуске мобильной игры", Алекс Пацай, руководитель мобил...Julia Lebedeva
 
Klein mannetje heeft geen huis
Klein mannetje heeft geen huisKlein mannetje heeft geen huis
Klein mannetje heeft geen huisgroep12pius10
 
Julia 6A Tea Shop Photo Essay
Julia 6A Tea Shop Photo EssayJulia 6A Tea Shop Photo Essay
Julia 6A Tea Shop Photo EssayISYGrade6
 
Материалы выступления Т. Юрасовой
Материалы выступления Т. ЮрасовойМатериалы выступления Т. Юрасовой
Материалы выступления Т. ЮрасовойAcademiaSpb
 
It's not just about Apps
It's not just about AppsIt's not just about Apps
It's not just about AppsSaul Cozens
 
1 distance education
1 distance education1 distance education
1 distance educationmazyooonah
 
Status Board 面白いよ!
Status Board 面白いよ!Status Board 面白いよ!
Status Board 面白いよ!Hishikawa Takuro
 
Cradle mountain presentation.
Cradle mountain presentation.Cradle mountain presentation.
Cradle mountain presentation.jillclarke
 
Sikça sorulan sorular(1)
Sikça sorulan sorular(1)Sikça sorulan sorular(1)
Sikça sorulan sorular(1)eyyubi
 
Rancangan anggaran rumah tangga
Rancangan anggaran rumah tanggaRancangan anggaran rumah tangga
Rancangan anggaran rumah tanggaToto Wirjosoemarto
 

Viewers also liked (20)

Marco Talluri
Marco TalluriMarco Talluri
Marco Talluri
 
Gifted
GiftedGifted
Gifted
 
My presentation
My presentationMy presentation
My presentation
 
Comenius
ComeniusComenius
Comenius
 
Web conferencing
Web conferencingWeb conferencing
Web conferencing
 
Walk your pokemon
Walk your pokemonWalk your pokemon
Walk your pokemon
 
Web conferencing
Web conferencingWeb conferencing
Web conferencing
 
"Основные ошибки при запуске мобильной игры", Алекс Пацай, руководитель мобил...
"Основные ошибки при запуске мобильной игры", Алекс Пацай, руководитель мобил..."Основные ошибки при запуске мобильной игры", Алекс Пацай, руководитель мобил...
"Основные ошибки при запуске мобильной игры", Алекс Пацай, руководитель мобил...
 
Klein mannetje heeft geen huis
Klein mannetje heeft geen huisKlein mannetje heeft geen huis
Klein mannetje heeft geen huis
 
Julia 6A Tea Shop Photo Essay
Julia 6A Tea Shop Photo EssayJulia 6A Tea Shop Photo Essay
Julia 6A Tea Shop Photo Essay
 
Материалы выступления Т. Юрасовой
Материалы выступления Т. ЮрасовойМатериалы выступления Т. Юрасовой
Материалы выступления Т. Юрасовой
 
It's not just about Apps
It's not just about AppsIt's not just about Apps
It's not just about Apps
 
Solow1957
Solow1957Solow1957
Solow1957
 
1 distance education
1 distance education1 distance education
1 distance education
 
Status Board 面白いよ!
Status Board 面白いよ!Status Board 面白いよ!
Status Board 面白いよ!
 
Cradle mountain presentation.
Cradle mountain presentation.Cradle mountain presentation.
Cradle mountain presentation.
 
L'aspetto sociale del p2p
L'aspetto sociale del p2pL'aspetto sociale del p2p
L'aspetto sociale del p2p
 
Katerin betancur montoya
Katerin betancur montoyaKaterin betancur montoya
Katerin betancur montoya
 
Sikça sorulan sorular(1)
Sikça sorulan sorular(1)Sikça sorulan sorular(1)
Sikça sorulan sorular(1)
 
Rancangan anggaran rumah tangga
Rancangan anggaran rumah tanggaRancangan anggaran rumah tangga
Rancangan anggaran rumah tangga
 

Similar to Getting Started with WordPress JSON REST API

Progressive Web Apps and React
Progressive Web Apps and ReactProgressive Web Apps and React
Progressive Web Apps and ReactMike Melusky
 
JSON REST API for WordPress
JSON REST API for WordPressJSON REST API for WordPress
JSON REST API for WordPressTaylor Lovett
 
2010 code camp rest for the rest of us
2010 code camp   rest for the rest of us2010 code camp   rest for the rest of us
2010 code camp rest for the rest of usKen Yagen
 
Building APIs in an easy way using API Platform
Building APIs in an easy way using API PlatformBuilding APIs in an easy way using API Platform
Building APIs in an easy way using API PlatformAntonio Peric-Mazar
 
WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!
WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!
WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!Evan Mullins
 
WordCamp Wilmington 2017 WP-API Why?
WordCamp Wilmington 2017   WP-API Why?WordCamp Wilmington 2017   WP-API Why?
WordCamp Wilmington 2017 WP-API Why?Evan Mullins
 
Are you getting Sleepy. REST in SharePoint Apps
Are you getting Sleepy. REST in SharePoint AppsAre you getting Sleepy. REST in SharePoint Apps
Are you getting Sleepy. REST in SharePoint AppsLiam Cleary [MVP]
 
Migrating to Jakarta EE 10
Migrating to Jakarta EE 10Migrating to Jakarta EE 10
Migrating to Jakarta EE 10Josh Juneau
 
Build Modern Web Apps Using ASP.NET Web API and AngularJS
Build Modern Web Apps Using ASP.NET Web API and AngularJSBuild Modern Web Apps Using ASP.NET Web API and AngularJS
Build Modern Web Apps Using ASP.NET Web API and AngularJSTaiseer Joudeh
 
Decoupled Architecture and WordPress
Decoupled Architecture and WordPressDecoupled Architecture and WordPress
Decoupled Architecture and WordPressPantheon
 
PLAT-8 Spring Web Scripts and Spring Surf
PLAT-8 Spring Web Scripts and Spring SurfPLAT-8 Spring Web Scripts and Spring Surf
PLAT-8 Spring Web Scripts and Spring SurfAlfresco Software
 
React + Flux = Joy
React + Flux = JoyReact + Flux = Joy
React + Flux = JoyJohn Need
 
Test-Driven Documentation for your REST(ful) service
Test-Driven Documentation for your REST(ful) serviceTest-Driven Documentation for your REST(ful) service
Test-Driven Documentation for your REST(ful) serviceJeroen Reijn
 
REST In Action: The Live Coverage Platform at the New York Times
REST In Action: The Live Coverage Platform at the New York TimesREST In Action: The Live Coverage Platform at the New York Times
REST In Action: The Live Coverage Platform at the New York TimesScott Taylor
 
Using WordPress as a Headless CMS
Using WordPress as a Headless CMSUsing WordPress as a Headless CMS
Using WordPress as a Headless CMSAdam Rasheed
 
REST and ASP.NET Web API (Tunisia)
REST and ASP.NET Web API (Tunisia)REST and ASP.NET Web API (Tunisia)
REST and ASP.NET Web API (Tunisia)Jef Claes
 
(DVO308) Docker & ECS in Production: How We Migrated Our Infrastructure from ...
(DVO308) Docker & ECS in Production: How We Migrated Our Infrastructure from ...(DVO308) Docker & ECS in Production: How We Migrated Our Infrastructure from ...
(DVO308) Docker & ECS in Production: How We Migrated Our Infrastructure from ...Amazon Web Services
 
Custom Development in SharePoint – What are my options now?
Custom Development in SharePoint – What are my options now?Custom Development in SharePoint – What are my options now?
Custom Development in SharePoint – What are my options now?Talbott Crowell
 
Introduction to Google APIs
Introduction to Google APIsIntroduction to Google APIs
Introduction to Google APIsSiva Arunachalam
 

Similar to Getting Started with WordPress JSON REST API (20)

Progressive Web Apps and React
Progressive Web Apps and ReactProgressive Web Apps and React
Progressive Web Apps and React
 
JSON REST API for WordPress
JSON REST API for WordPressJSON REST API for WordPress
JSON REST API for WordPress
 
2010 code camp rest for the rest of us
2010 code camp   rest for the rest of us2010 code camp   rest for the rest of us
2010 code camp rest for the rest of us
 
Building APIs in an easy way using API Platform
Building APIs in an easy way using API PlatformBuilding APIs in an easy way using API Platform
Building APIs in an easy way using API Platform
 
WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!
WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!
WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!
 
WordCamp Wilmington 2017 WP-API Why?
WordCamp Wilmington 2017   WP-API Why?WordCamp Wilmington 2017   WP-API Why?
WordCamp Wilmington 2017 WP-API Why?
 
Fluxible
FluxibleFluxible
Fluxible
 
Are you getting Sleepy. REST in SharePoint Apps
Are you getting Sleepy. REST in SharePoint AppsAre you getting Sleepy. REST in SharePoint Apps
Are you getting Sleepy. REST in SharePoint Apps
 
Migrating to Jakarta EE 10
Migrating to Jakarta EE 10Migrating to Jakarta EE 10
Migrating to Jakarta EE 10
 
Build Modern Web Apps Using ASP.NET Web API and AngularJS
Build Modern Web Apps Using ASP.NET Web API and AngularJSBuild Modern Web Apps Using ASP.NET Web API and AngularJS
Build Modern Web Apps Using ASP.NET Web API and AngularJS
 
Decoupled Architecture and WordPress
Decoupled Architecture and WordPressDecoupled Architecture and WordPress
Decoupled Architecture and WordPress
 
PLAT-8 Spring Web Scripts and Spring Surf
PLAT-8 Spring Web Scripts and Spring SurfPLAT-8 Spring Web Scripts and Spring Surf
PLAT-8 Spring Web Scripts and Spring Surf
 
React + Flux = Joy
React + Flux = JoyReact + Flux = Joy
React + Flux = Joy
 
Test-Driven Documentation for your REST(ful) service
Test-Driven Documentation for your REST(ful) serviceTest-Driven Documentation for your REST(ful) service
Test-Driven Documentation for your REST(ful) service
 
REST In Action: The Live Coverage Platform at the New York Times
REST In Action: The Live Coverage Platform at the New York TimesREST In Action: The Live Coverage Platform at the New York Times
REST In Action: The Live Coverage Platform at the New York Times
 
Using WordPress as a Headless CMS
Using WordPress as a Headless CMSUsing WordPress as a Headless CMS
Using WordPress as a Headless CMS
 
REST and ASP.NET Web API (Tunisia)
REST and ASP.NET Web API (Tunisia)REST and ASP.NET Web API (Tunisia)
REST and ASP.NET Web API (Tunisia)
 
(DVO308) Docker & ECS in Production: How We Migrated Our Infrastructure from ...
(DVO308) Docker & ECS in Production: How We Migrated Our Infrastructure from ...(DVO308) Docker & ECS in Production: How We Migrated Our Infrastructure from ...
(DVO308) Docker & ECS in Production: How We Migrated Our Infrastructure from ...
 
Custom Development in SharePoint – What are my options now?
Custom Development in SharePoint – What are my options now?Custom Development in SharePoint – What are my options now?
Custom Development in SharePoint – What are my options now?
 
Introduction to Google APIs
Introduction to Google APIsIntroduction to Google APIs
Introduction to Google APIs
 

More from Hishikawa Takuro

これから concrete5 を始める Web 制作者に伝えたい concrete5 と WordPress ここが一緒、ここが違う!
これから concrete5 を始める Web 制作者に伝えたい concrete5 と WordPress ここが一緒、ここが違う!これから concrete5 を始める Web 制作者に伝えたい concrete5 と WordPress ここが一緒、ここが違う!
これから concrete5 を始める Web 制作者に伝えたい concrete5 と WordPress ここが一緒、ここが違う!Hishikawa Takuro
 
エンジニアのための営業入門
エンジニアのための営業入門エンジニアのための営業入門
エンジニアのための営業入門Hishikawa Takuro
 
concrete5 CMS「運用」ケーススタディ
concrete5 CMS「運用」ケーススタディconcrete5 CMS「運用」ケーススタディ
concrete5 CMS「運用」ケーススタディHishikawa Takuro
 
Calypso動かしてみたよ!
Calypso動かしてみたよ!Calypso動かしてみたよ!
Calypso動かしてみたよ!Hishikawa Takuro
 
concrete5 最新事情 2015
concrete5 最新事情 2015concrete5 最新事情 2015
concrete5 最新事情 2015Hishikawa Takuro
 
concrete5セミナー資料公開版
concrete5セミナー資料公開版concrete5セミナー資料公開版
concrete5セミナー資料公開版Hishikawa Takuro
 
WordPress使いのためのconcrete5入門
WordPress使いのためのconcrete5入門WordPress使いのためのconcrete5入門
WordPress使いのためのconcrete5入門Hishikawa Takuro
 
concrete5で行なうcms導入提案のポイント
concrete5で行なうcms導入提案のポイントconcrete5で行なうcms導入提案のポイント
concrete5で行なうcms導入提案のポイントHishikawa Takuro
 
はじめての concrete5 でウェブサイト作成〜入門チュートリアルガイド
はじめての concrete5 でウェブサイト作成〜入門チュートリアルガイドはじめての concrete5 でウェブサイト作成〜入門チュートリアルガイド
はじめての concrete5 でウェブサイト作成〜入門チュートリアルガイドHishikawa Takuro
 
CMS導入で企業のWebサイト運営はこう変わる!
CMS導入で企業のWebサイト運営はこう変わる!CMS導入で企業のWebサイト運営はこう変わる!
CMS導入で企業のWebサイト運営はこう変わる!Hishikawa Takuro
 
オープンソースCMSに学ぶ、前PSR時代のプロジェクトが脱レガシーする5つの方法
オープンソースCMSに学ぶ、前PSR時代のプロジェクトが脱レガシーする5つの方法オープンソースCMSに学ぶ、前PSR時代のプロジェクトが脱レガシーする5つの方法
オープンソースCMSに学ぶ、前PSR時代のプロジェクトが脱レガシーする5つの方法Hishikawa Takuro
 
concrete5
 バージョン5.7のご紹介
concrete5
 バージョン5.7のご紹介concrete5
 バージョン5.7のご紹介
concrete5
 バージョン5.7のご紹介Hishikawa Takuro
 
クライアントに感謝されるCMS導入のコツ
クライアントに感謝されるCMS導入のコツクライアントに感謝されるCMS導入のコツ
クライアントに感謝されるCMS導入のコツHishikawa Takuro
 
concrete5 5.6.3.1日本語版の紹介
concrete5 5.6.3.1日本語版の紹介concrete5 5.6.3.1日本語版の紹介
concrete5 5.6.3.1日本語版の紹介Hishikawa Takuro
 
concrete5デザインカスタマイズに必要なPHPの知識
concrete5デザインカスタマイズに必要なPHPの知識concrete5デザインカスタマイズに必要なPHPの知識
concrete5デザインカスタマイズに必要なPHPの知識Hishikawa Takuro
 
concrete5って何?〜Web制作者対象〜2014年版
concrete5って何?〜Web制作者対象〜2014年版concrete5って何?〜Web制作者対象〜2014年版
concrete5って何?〜Web制作者対象〜2014年版Hishikawa Takuro
 

More from Hishikawa Takuro (20)

これから concrete5 を始める Web 制作者に伝えたい concrete5 と WordPress ここが一緒、ここが違う!
これから concrete5 を始める Web 制作者に伝えたい concrete5 と WordPress ここが一緒、ここが違う!これから concrete5 を始める Web 制作者に伝えたい concrete5 と WordPress ここが一緒、ここが違う!
これから concrete5 を始める Web 制作者に伝えたい concrete5 と WordPress ここが一緒、ここが違う!
 
エンジニアのための営業入門
エンジニアのための営業入門エンジニアのための営業入門
エンジニアのための営業入門
 
concrete5 CMS「運用」ケーススタディ
concrete5 CMS「運用」ケーススタディconcrete5 CMS「運用」ケーススタディ
concrete5 CMS「運用」ケーススタディ
 
Calypso動かしてみたよ!
Calypso動かしてみたよ!Calypso動かしてみたよ!
Calypso動かしてみたよ!
 
concrete5の紹介
concrete5の紹介concrete5の紹介
concrete5の紹介
 
concrete5 最新事情 2015
concrete5 最新事情 2015concrete5 最新事情 2015
concrete5 最新事情 2015
 
concrete5セミナー資料公開版
concrete5セミナー資料公開版concrete5セミナー資料公開版
concrete5セミナー資料公開版
 
WordPress使いのためのconcrete5入門
WordPress使いのためのconcrete5入門WordPress使いのためのconcrete5入門
WordPress使いのためのconcrete5入門
 
concrete5で行なうcms導入提案のポイント
concrete5で行なうcms導入提案のポイントconcrete5で行なうcms導入提案のポイント
concrete5で行なうcms導入提案のポイント
 
concrete5.7のご紹介
concrete5.7のご紹介concrete5.7のご紹介
concrete5.7のご紹介
 
世界一即戦力なCMS
世界一即戦力なCMS世界一即戦力なCMS
世界一即戦力なCMS
 
はじめての concrete5 でウェブサイト作成〜入門チュートリアルガイド
はじめての concrete5 でウェブサイト作成〜入門チュートリアルガイドはじめての concrete5 でウェブサイト作成〜入門チュートリアルガイド
はじめての concrete5 でウェブサイト作成〜入門チュートリアルガイド
 
CMS導入で企業のWebサイト運営はこう変わる!
CMS導入で企業のWebサイト運営はこう変わる!CMS導入で企業のWebサイト運営はこう変わる!
CMS導入で企業のWebサイト運営はこう変わる!
 
オープンソースCMSに学ぶ、前PSR時代のプロジェクトが脱レガシーする5つの方法
オープンソースCMSに学ぶ、前PSR時代のプロジェクトが脱レガシーする5つの方法オープンソースCMSに学ぶ、前PSR時代のプロジェクトが脱レガシーする5つの方法
オープンソースCMSに学ぶ、前PSR時代のプロジェクトが脱レガシーする5つの方法
 
concrete5 in Japan 2014
concrete5 in Japan 2014concrete5 in Japan 2014
concrete5 in Japan 2014
 
concrete5
 バージョン5.7のご紹介
concrete5
 バージョン5.7のご紹介concrete5
 バージョン5.7のご紹介
concrete5
 バージョン5.7のご紹介
 
クライアントに感謝されるCMS導入のコツ
クライアントに感謝されるCMS導入のコツクライアントに感謝されるCMS導入のコツ
クライアントに感謝されるCMS導入のコツ
 
concrete5 5.6.3.1日本語版の紹介
concrete5 5.6.3.1日本語版の紹介concrete5 5.6.3.1日本語版の紹介
concrete5 5.6.3.1日本語版の紹介
 
concrete5デザインカスタマイズに必要なPHPの知識
concrete5デザインカスタマイズに必要なPHPの知識concrete5デザインカスタマイズに必要なPHPの知識
concrete5デザインカスタマイズに必要なPHPの知識
 
concrete5って何?〜Web制作者対象〜2014年版
concrete5って何?〜Web制作者対象〜2014年版concrete5って何?〜Web制作者対象〜2014年版
concrete5って何?〜Web制作者対象〜2014年版
 

Recently uploaded

So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfAarwolf Industries LLC
 
Kuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialKuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialJoão Esperancinha
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Jeffrey Haguewood
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Mark Simos
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sectoritnewsafrica
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...amber724300
 

Recently uploaded (20)

So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdf
 
Kuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialKuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorial
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
 

Getting Started with WordPress JSON REST API

  • 1. Getting Started with WordPress JSON REST API Takuro Hishikawa concrete5 Japan Inc. ! An author of Really Simple CSV Importer plugin (20,000+ download! Thanks!)
  • 2. What Is the JSON REST API? • Started as GSOC project • Now provided as plugin • Planned merge into core at future release
  • 3. “Access your WordPress site’s data through an easy-to-use HTTP REST API.” –http://wp-api.org/
  • 4. “JSON is a data format based on Javascript’s representation of objects, but it’s widely used because it can be easily represented in almost every programming language.” –Ryan McCue http://wptavern.com/ryan-mccue-on-creating-the-json-rest-api-for-wordpress
  • 5. Resources • Posts (Create/Retrieve/Edit/Delete) • Meta (Create/Retrieve/Edit/Delete) • Media (Create/Get) • Users (Create/Retrieve/Edit/Delete) • Taxonomy/Terms (Retrieve)
  • 6. Building App Example • Framework = concrete5 • Library = Zend_Oauth, Zend_Http_Client
  • 7. Demo • Get posts from WordPress • Get the specific post from WordPress • Insert a new post to WordPress
  • 9. Set up the plugin • https://github.com/WP-API/WP-API/ • https://github.com/WP-API/OAuth1/
  • 10. Get Access Token from WordPress • Blog post (Japanese) • http://notnil-creative.com/blog/archives/ 3301
  • 11. Send HTTP Request to WordPress $client = Loader::helper('wp_api','rest_wordpress')->getClient(); $client->setUri($wp_rest_api_url.’/posts'); $client->setMethod(Zend_Http_Client::GET); $client->setParameterGet('filter[posts_per_page]',$num); $client->setParameterGet(‘filter[cat]',$cat); $client->setParameterGet('filter[orderby]','title'); $client->setParameterGet(‘filter[order]','ASC'); $response = $client->request();
  • 12. Send HTTP Request to WordPress $client = Loader::helper('wp_api','rest_wordpress')->getClient(); $client->setUri($wp_rest_api_url.'/posts'); $client->setMethod(Zend_Http_Client::POST); $data = array( 'title' => $this->post('post_title'), 'content_raw' => $this->post('post_body'), 'status' => 'publish' ); $client->setRawData(Loader::helper('json')->encode($data),'application/ json'); $res = $client->request();
  • 14. • As you can see, working with JSON REST API requires little knowledge of OAuth and building HTTP Request… • Use library! JSON is a popular object type, OAuth is also popular • Some issues… https://github.com/WP-API/OAuth1/issues/37 https://github.com/WP-API/OAuth1/issues/34
  • 15. Thanks! Follow me! ! Twitter: @HissyNC GitHub: @hissy