forked from trheyi/Ghost
-
Notifications
You must be signed in to change notification settings - Fork 0
[WIP] API Documentation
Hannah Wolfe edited this page Apr 28, 2014
·
13 revisions
Skip to:
- 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 aredraftandpublished.statushas 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
{
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: [{ ... }]
}
]
}
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.
-
id or slug: required
ID of the post you would like to retrieve.
| 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 |
api.posts.read({id: id})GET /ghost/api/v0.1/posts/{id}/
Retrieves a list of existing posts you have created.
-
status: optional
Possible values aredraft,publishedandall. -
staticPages: optional
Include posts where thepageattribute istrue. Possible values aretrue,falseandall.
| 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 |
api.posts.browse({status: 'draft'})GET /ghost/api/v0.1/posts/?status=draft
-
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.
{
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
}]
}
api.tags.browse()GET /ghost/api/v0.1/tags/
- id: integer
-
uuid: string
Unique identifier generated automatically as UUIDv4.
{
users: [
{
}
]
}