Automattic / Automattic/o2

Add an xposts endpoint to REST API

Open
#202 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
338
Forks
56
Avg merge
24m
Merged PRs (30d)
16

Description

Add an xposts endpoint to the REST API of sites that have the O2 plugin installed.

We are bringing xpost support to the Gutenberg editor in the WordPress mobile apps (see [here for WPAndroid](https://github.com/wordpress-mobile/WordPress-Android/pull/13184) and [here for WPiOS](https://github.com/wordpress-mobile/WordPress-iOS/pull/15139)) but will not be able to support self-hosted sites that are not connected to WP.com via Jetpack.

This is because the endpoint we use is WP.com specific. If the O2 plugin can expose a REST API endpoint on sites where it is installed, we could add xpost support for all self-hosted sites that use the O2 plugin.

A possible workaround would be to use `/?get-xpost-data` (e.g. `mysite.com/?get-xpost-data`), which is an cookie-authenticated endpoint that returns xpost suggestions. While using this might be an alternative to constructing a new endpoint, it's not practical on mobile which uses a authentication bearer based token (instead of a cookie) to authenticate.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the existing cookie-authenticated `/?get-xpost-data` handler and the O2 plugin's REST route registration. Compare the authentication and response expectations for the WordPress mobile clients; done means sites with O2 installed expose an equivalent REST endpoint that returns xpost suggestions using bearer authentication.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.