Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Add initial read-only REST API endpoints for snapshots #63

Merged
merged 9 commits into from Jul 27, 2016

Conversation

westonruter
Copy link
Contributor

Examples:

Get all draft snapshots authored by user with username "jsmith":

http://src.wordpress-develop.dev/wp-json/wp/v2/customize_snapshots?status=draft&author=jsmith

Get a snapshot by a UUID:

http://src.wordpress-develop.dev/wp-json/wp/v2/customize_snapshots?status=any&slug=fcc0a3f0-2d6d-4e4b-906b-46025857b07a

An individual item will look like the following (take note of content):

{
  "id": 6030,
  "date": "2016-07-23T06:11:22",
  "date_gmt": null,
  "guid": {
    "rendered": "http://src.wordpress-develop.dev/?customize_snapshot_uuid=fcc0a3f0-2d6d-4e4b-906b-46025857b07a"
  },
  "modified": "2016-07-23T06:11:22",
  "modified_gmt": null,
  "slug": "fcc0a3f0-2d6d-4e4b-906b-46025857b07a",
  "type": "customize_snapshot",
  "link": "http://src.wordpress-develop.dev/?customize_snapshot_uuid=fcc0a3f0-2d6d-4e4b-906b-46025857b07a",
  "content": {
    "blogname": {
      "value": "WordPress Coool"
    }
  },
  "author": 4,
  "_links": {
    "self": [
      {
        "href": "http://src.wordpress-develop.dev/wp-json/wp/v2/customize_snapshots/6030"
      }
    ],
    "collection": [
      {
        "href": "http://src.wordpress-develop.dev/wp-json/wp/v2/customize_snapshots"
      }
    ],
    "about": [
      {
        "href": "http://src.wordpress-develop.dev/wp-json/wp/v2/types/customize_snapshot"
      }
    ],
    "author": [
      {
        "embeddable": true,
        "href": "http://src.wordpress-develop.dev/wp-json/wp/v2/users/4"
      }
    ],
    "version-history": [
      {
        "href": "http://src.wordpress-develop.dev/wp-json/wp/v2/customize_snapshots/6030/revisions"
      }
    ],
    "wp:attachment": [
      {
        "href": "http://src.wordpress-develop.dev/wp-json/wp/v2/media?parent=6030"
      }
    ],
    "curies": [
      {
        "name": "wp",
        "href": "https://api.w.org/{rel}",
        "templated": true
      }
    ]
  }
}

Fixes #29.

@westonruter westonruter merged commit b76be7c into feature/refactor Jul 27, 2016
@westonruter westonruter deleted the feature/issue-29-rest-api branch July 27, 2016 07:36
@westonruter westonruter mentioned this pull request Jul 27, 2016
3 tasks
@westonruter westonruter modified the milestone: 0.5.0 Aug 12, 2016
@westonruter
Copy link
Contributor Author

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants