New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 9 commits into from Jul 27, 2016

Conversation

Projects
None yet
2 participants
@westonruter
Member

westonruter commented Jul 23, 2016

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

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@westonruter westonruter deleted the feature/issue-29-rest-api branch Jul 27, 2016

@westonruter westonruter referenced this pull request Jul 27, 2016

Merged

Refactor #59

3 of 3 tasks complete

@westonruter westonruter modified the milestone: 0.5.0 Aug 12, 2016

@westonruter

This comment has been minimized.

Show comment
Hide comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment