WordPress.com integration
In short
Write and update posts and upload media on a WordPress.com site. Connect it on the Integrations page; your app then calls WordPress.com through Sapilon without ever holding an Automattic credential.
Lets your app read and write posts and pages, upload media and read comments on the WordPress.com site you pick while connecting.
Connecting
On the Integrations page choose Connect on WordPress.com, sign in to Automattic and allow access. Under Advanced you can use your own Automattic OAuth app instead of Sapilon’s.
- You pick one site while connecting. Self-hosted WordPress sites are reached through Jetpack.
- Sapilon’s own WordPress.com app is being registered. Until it is, Advanced → Bring your own OAuth app connects today.
What your app can do
Only these requests are available; anything else is refused.
GET /*GET /*/postsPOST /*/posts/newGET|POST /*/posts/*GET /*/mediaPOST /*/media/newGET /*/comments
How the agent uses it
Use integrations.request('wordpress-com', …); paths are relative to https://public-api.wordpress.com/rest/v1.1/sites.
Every path starts with the site id from the connection’s account (or its domain).
GET /{site}— the site.GET /{site}/posts—query: { status: 'publish,draft', number: '20', type: 'post' }(type: 'page'for pages).POST /{site}/posts/new— Example:{ method: 'POST', path: '/2140/posts/new', body: { title: 'Autumn menu', content: '<p>…</p>', status: 'draft', categories: 'News' } }.GET|POST /{site}/posts/{id}— read or update.GET /{site}/media;POST /{site}/media/new—body: { media_urls: ['https://…/photo.jpg'] }.GET /{site}/comments.
Publish only when the user asked; otherwise save drafts. Deleting is not allowed.
More from Automattic: https://developer.wordpress.com/docs/api/