Skip to content

Navigation Menu

Sign in
Sign up

[WIP] API Documentation

Hannah Wolfe edited this page Apr 28, 2014 · 13 revisions

Skip to:

Post

The Post Object

Attributes

  • id: integer
  • uuid: string
    Unique identifier generated automatically as UUIDv4.
  • title: string
    Title of your blog post.
  • slug: string
    Automatically generated unique slug that is based on the title of your blog post (e.g.: 'Test Post' will become 'test-post').
  • status: string
    Possible values are draft and published. status has influence on who can see your post and if it is shown on the frontpage of your blog.
  • markdown: string
    Content of your post encoded in markdown.
  • image: string
    Not used yet.
  • featured: boolean
    Indicate a featured post.
  • page: boolean
    Indicate if the post is a page.
  • language: string
    remark about language format, not used yet, defaults to
  • meta_title: string
    Not used yet.
  • meta_description: string
    Not used yet.
  • author_id: integer
  • created_at: string
    remark about date/time
  • created_by: integer, user - includeable
    includeable when implemented
  • updated_at: string
    remark about date/time format
  • updated_by: integer, user - includeable
    includeable when implemented
  • published_at: string
    remark about date/time
  • published_by: integer, user - includeable
    includeable when implemented
  • author: object, user
  • tags: array of objects, tags

Example Post Object

{
 posts: [
 {
 status: "published",
 id: 1,
 uuid: "ec630e45-3342-4d7f-a24c-e448263c975b",
 title: "Welcome to Ghost",
 slug: "welcome-to-ghost",
 markdown: "",
 image: null,
 featured: false,
 page: false,
 language: "en_US",
 meta_title: null,
 meta_description: null,
 author_id: 1,
 created_at: "2014-04-15T12:36:28.353Z",
 created_by: 1,
 updated_at: "2014-04-15T12:36:28.353Z",
 updated_by: 1,
 published_at: "2014-04-15T12:36:28.363Z",
 published_by: 1,
 author: { ... },
 tags: [{ ... }]
 }
 ]
}

Retrieve an existing post

Retrieves an existing post that has been created. In order to get a post the id or slug are needed to identify the post. The same information is returned when creating, updating or deleting a post.

Arguments

  • id or slug: required
    ID of the post you would like to retrieve.

Permissions

Admin Editor Author NoAuth
read all posts read all posts read posts with status published
or that were created by the user
read posts with status `published

Usage

  • api.posts.read({id: id})
  • GET /ghost/api/v0.1/posts/{id}/

List existing posts

Retrieves a list of existing posts you have created.

Arguments

  • status: optional
    Possible values are draft, published and all.
  • staticPages: optional
    Include posts where the page attribute is true. Possible values are true, false and all.

Permissions

Admin Editor Author NoAuth
read all posts read all posts read posts with status published
or that were created by the user
read posts with status `published

Usage

  • api.posts.browse({status: 'draft'})
  • GET /ghost/api/v0.1/posts/?status=draft

Create a new post

Update an existing post

Delete a post

Tag

The Tag Object

Attributes

  • id: increments
  • uuid: string
    Unique identifier generated automatically as UUIDv4.
  • name: string
    Name of the tag.
  • slug: string
    Automatically generated unique slug that is based on the name of your tag (e.g.: 'Test Tag' will become 'test-tag').
  • description: string
    Not currently used.
  • parent_id: integer
    Not currently used.
  • meta_title: string
    Not currently used.
  • meta_description: string
    Not currently used.
  • created_at: dateTime
    Remark about date/time
  • created_by: integer
    Includeable when implemented
  • updated_at: dateTime
    Remark about last updated date/time.
  • updated_by: integer
    User id of last update author.

Example Tag Object

{
 tags: [{
 "id": 1,
 "uuid": "c912cb47-fe10-4120-aca3-19feb1a931d6",
 "name": "Getting Started",
 "slug": "getting-started",
 "description": null,
 "parent_id": null,
 "meta_title": null,
 "meta_description": null,
 "created_at": "2014-03-12T17:04:00.819Z",
 "created_by": 1,
 "updated_at": "2014-03-12T17:04:00.819Z",
 "updated_by": 1
 }]
}

Usage

  • api.tags.browse()
  • GET /ghost/api/v0.1/tags/

User

Clone this wiki locally

AltStyle によって変換されたページ (->オリジナル) /