You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

704 lines
17 KiB
YAML

swagger: '2.0'
info:
title: Dotclear API
description: Manage your(s) blogs with this API
version: 0.0.1
host: dotclear.localhost
schemes:
- http
basePath: /dotclear/index.php?rest
produces:
- application/json
paths:
/specs:
get:
summary: Get this API SWAGGER documentation
responses:
'200':
description: swagger.json
schema:
title: doc
type: string
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/blogs:
get:
summary: Get list of availables blogs
parameters:
- name: x_dc_key
in: header
required: false
type: string
responses:
'200':
description: array serving blogs properties
schema:
type: array
items:
type: string
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
post:
summary: Create a new blog
parameters:
- name: x_dc_key
in: header
type: string
required: true
- name: blog
in: body
description: The blog you want to create
schema:
$ref: '#/definitions/blog'
required: true
responses:
'201':
description: 'Success, array containing the new blog''s identifiant'
schema:
type: object
properties:
code:
type: integer
blog_id:
type: integer
message:
type: string
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
'/blogs/{blog-id}':
get:
summary: Get a blog poperties
parameters:
- name: x_dc_key
in: header
type: string
required: false
- name: blog-id
in: path
type: string
required: true
responses:
'200':
description: 'Core blog properties. use {blog_id}/settings methods for more settings.'
schema:
$ref: '#/definitions/blogProperties'
'404':
description: this blog id does not exists
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
patch:
summary: Update part of blog properties
parameters:
- name: x_dc_key
in: header
type: string
required: true
- name: blog-id
in: path
type: string
required: true
- name: blog
in: body
description: This list of parameters is not exhaustive
required: true
schema:
$ref: '#/definitions/blogProperties'
responses:
'200':
description: array containing the edited blog's identifiant
schema:
$ref: '#/definitions/Ids'
'404':
description: this blog id does not exists
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
put:
summary: 'Overwrite blog Properties (if an optional parameter is not set, his value will be erased by the default value)'
parameters:
- name: x_dc_key
in: header
type: string
required: true
- name: blog-id
in: path
type: string
required: true
- name: blog
in: body
description: This list of parameters is not exhaustive
required: true
schema:
$ref: '#/definitions/blogPropertiesPut'
responses:
'200':
description: array containing the edited blog's identifiant
schema:
$ref: '#/definitions/Ids'
'404':
description: this blog id does not exists
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
delete:
summary: Delete this blog
parameters:
- name: x_dc_key
in: header
type: string
required: true
- name: blog-id
in: path
type: string
required: true
responses:
'200':
description: array containing the deleted blog's identifiant
schema:
$ref: '#/definitions/Ids'
'404':
description: this blog id does not exists
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
'/{blog_id}/settings':
get:
summary: 'Get the about:config'
description: Get all parameters
parameters:
- name: x_dc_key
in: header
type: string
required: true
- name: blog_id
in: path
type: string
required: true
responses:
'200':
description: OK
'404':
description: this blog id does not exists
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
'/{blog-id}/posts':
get:
summary: Get list of posts
parameters:
- name: x_dc_key
in: header
type: string
required: true
- name: blog-id
in: path
type: string
required: true
- name: filters
in: query
description: sql like filters
type: array
items:
type: string
required: false
- name: fields
in: query
type: array
items:
type: string
required: false
description: 'Fields you want to get. If unset, fields are post_id, post_url, post_status, post_title, post_date'
responses:
'200':
description: list of posts
schema:
title: posts
type: array
items:
$ref: '#/definitions/dc_post'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
post:
summary: Create a new post
parameters:
- name: x_dc_key
in: header
type: string
required: true
- name: blog-id
in: path
type: string
required: true
- name: properties
in: body
description: Some non required fields you don't define will be set (default value) by the API
schema:
$ref: '#/definitions/new_dc_post'
responses:
'200':
description: Id of newly created post
schema:
$ref: '#/definitions/Ids'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
'/{blog-id}/posts/{post-id}':
get:
summary: Get a post entry
parameters:
- name: x_dc_key
in: header
type: string
required: false
- name: blog-id
in: path
type: string
required: true
- name: post-id
in: path
type: string
required: true
- name: filters
in: query
description: sql like filters
type: array
items:
type: string
required: false
- name: fields
in: query
type: array
items:
type: string
required: false
description: 'Fields you want to get. If unset, all available fields will be get.'
responses:
'200':
description: The post values
schema:
$ref: '#/definitions/dc_post'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
patch:
summary: Update part of a post entry's properties
parameters:
- name: x_dc_key
in: header
type: string
required: true
- name: blog-id
in: path
type: string
required: true
- name: post-id
in: path
type: string
required: true
- name: properties
in: body
schema:
$ref: '#/definitions/dc_post'
responses:
'200':
description: array containing the updated post's id
schema:
$ref: '#/definitions/Ids'
'404':
description: this post does not exists
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
put:
summary: Update full blog properties. Unsetted parameters will be erased
parameters:
- name: x_dc_key
in: header
type: string
required: true
- name: blog-id
in: path
type: string
required: true
- name: post-id
in: path
type: string
required: true
- name: properties
in: body
schema:
$ref: '#/definitions/new_dc_post'
responses:
'200':
description: array containing the updated post's id
schema:
$ref: '#/definitions/Ids'
'404':
description: this post does not exists
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
delete:
summary: Delete the post
parameters:
- name: x_dc_key
in: header
type: string
required: true
- name: blog-id
in: path
type: string
required: true
- name: post-id
in: path
type: string
required: true
responses:
'200':
description: array containing the deleted post's id
schema:
$ref: '#/definitions/Ids'
'404':
description: this post does not exists
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
'/{blog-id}/categories':
get:
summary: Get list of available categories
parameters:
- name: x_dc_key
in: header
type: string
required: false
- name: blog-id
in: path
type: string
required: true
responses:
'200':
description: array containing the categories properties
schema:
title: categories
type: array
items:
$ref: '#/definitions/category'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
post:
summary: Create a new category
parameters:
- name: x_dc_key
in: header
type: string
required: true
- name: blog-id
in: path
type: string
required: true
- name: properties
in: body
schema:
$ref: '#/definitions/new_category'
responses:
'200':
description: array containing the created category id
schema:
$ref: '#/definitions/Ids'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
'/{blog-id}/categories/{cat-id}':
get:
summary: get one category properties
parameters:
- name: x_dc_key
in: header
type: string
required: false
- name: blog-id
in: path
type: string
required: true
- name: cat-id
in: path
type: string
required: true
responses:
'200':
description: array containing the created category properties
schema:
$ref: '#/definitions/category'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
patch:
summary: Update some attributes
parameters:
- name: blog-id
in: path
type: string
required: true
- name: cat-id
in: path
type: string
required: true
- name: category
in: body
schema:
$ref: '#/definitions/category'
responses:
'200':
description: array containing the modified category id
schema:
$ref: '#/definitions/Ids'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
definitions:
blog:
type: object
required:
- blog_id
- blog_name
- blog_url
properties:
blog_id:
type: string
blog_name:
type: string
blog_url:
type: string
blog_desc:
type: string
lang:
type: string
blog_timezone:
type: string
url_scan:
type: string
enum:
- query_string
- path_info
Ids:
type: object
properties:
id:
type: integer
description: New blog id
blogPropertiesPut:
required:
- blog_id
- blog_name
- blog_url
- blog_desc
type: object
properties:
blog_id:
type: string
blog_name:
type: string
blog_url:
type: string
blog_desc:
type: string
blogProperties:
type: object
properties:
blog_id:
type: string
blog_name:
type: string
blog_url:
type: string
blog_desc:
type: string
new_dc_post:
type: object
required:
- post_content
- post_title
properties:
cat_id:
type: string
post_dt:
type: string
post_tz:
type: string
post_creadt:
type: string
post_upddt:
type: string
post_password:
type: string
post_type:
type: string
post_format:
type: string
post_url:
type: string
post_lang:
type: string
post_title:
type: string
post_excerpt:
type: string
post_excerpt_xhtml:
type: string
post_content:
type: string
post_content_xhtml:
type: string
post_notes:
type: string
post_meta:
type: string
post_words:
type: string
post_status:
type: string
enum:
- Pending
- Scheduled
- Unpublished
- Published
post_selected:
type: boolean
post_position:
type: string
post_open_comment:
type: boolean
post_open_tb:
type: boolean
dc_post:
type: object
properties:
post_id:
type: string
blog_id:
type: string
user_id:
type: string
cat_id:
type: string
post_dt:
type: string
post_tz:
type: string
post_creadt:
type: string
post_upddt:
type: string
post_password:
type: string
post_type:
type: string
post_format:
type: string
post_url:
type: string
post_lang:
type: string
post_title:
type: string
post_excerpt:
type: string
post_excerpt_xhtml:
type: string
post_content:
type: string
post_content_xhtml:
type: string
post_notes:
type: string
post_meta:
type: string
post_words:
type: string
post_status:
type: string
enum:
- Pending
- Scheduled
- Unpublished
- Published
post_selected:
type: boolean
post_position:
type: string
post_open_comment:
type: boolean
post_open_tb:
type: boolean
nb_comment:
type: integer
nb_trackback:
type: integer
post_firstpub:
type: string
category:
type: object
properties:
cat_id:
type: integer
cat_title:
type: string
cat_url:
type: string
cat_desc:
type: string
cat_position:
type: integer
temporary:
type: boolean
new_category:
type: object
required:
- cat_title
properties:
cat_title:
type: string
cat_url:
type: string
cat_desc:
type: string
cat_position:
type: integer
temporary:
type: boolean
Error:
type: object
properties:
code:
type: integer
format: int32
message:
type: string
fields:
type: string