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.

943 lines
24 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}/settings/{name_space}':
get:
summary: 'Get the settings inside the name-space'
description: same
parameters:
- name: x_dc_key
in: header
type: string
required: true
- name: blog_id
in: path
type: string
required: true
- name: name_space
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'
post:
summary: Create or edit a new namespace and or a new setting'
description: "Let body empty if you just want to create a namespace without setting. Note that if the setting already exists, it will be erased. So, PUT and PATCH methods are useless."
parameters:
- name: x_dc_key
in: header
type: string
required: true
- name: blog_id
in: path
type: string
required: true
- name: name_space
in: path
type: string
required: true
- name: setting
description: Can be empty, Can pass many settings. [{"id":"string","type":"string","value":"string","value_change":"string Optional","global":"bool optional"},{"id2":...}]
in: body
schema:
$ref: '#/definitions/settings'
responses:
'201':
description: OK
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
'/{blog_id}/settings/{name_space}/{setting_id}':
get:
summary: Get value and type for one setting'
description: ""
parameters:
- name: x_dc_key
in: header
type: string
required: true
- name: blog_id
in: path
type: string
required: true
- name: name_space
in: path
type: string
required: true
- name: setting_id
in: path
type: string
required: true
responses:
'200':
description: OK
schema:
$ref: '#/definitions/OneSetting'
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: limit-start
in: query
required: false
type: integer
- name: limit-count
in: query
type: integer
required: false
- name: cat_id
in: query
type: string
required: false
- name: post_status
type: string
in: query
required: false
- name: password
type: string
in: query
required: false
- name: post_selected
type: boolean
in: query
required: false
- name: post_open_comment
type: boolean
in: query
required: false
- name: post_open_tb
type: boolean
in: query
required: false
- name: post_month
type: string
in: query
required: false
- name: post_year
type: string
in: query
required: false
- name: post_lang
type: string
in: query
required: false
- name: post_format
type: string
in: query
required: false
- name: sortby
type: string
in: query
required: false
description: If many, separate them by a comma
responses:
'200':
description: list of posts
schema:
title: posts
type: array
items:
$ref: '#/definitions/dc_post'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
'/{blog-id}/post':
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. You can post many posts once by putting them on an array like [{'post_title':'blah',...},{'post_title':'bluh',...}]
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}/post/{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: 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: Not yet developed 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: Not yet developed 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: Not yet developed 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}/metas':
post:
summary: Create a new Postr meta
parameters:
- name: x_dc_key
in: header
type: string
required: false
- name: blog-id
in: path
type: string
required: true
- name: properties
in: body
schema:
$ref: '#/definitions/new_meta'
responses:
'200':
description: New meta id
schema:
title: categories
type: array
items:
$ref: '#/definitions/category'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
'/{blog-id}/{post-id}/metas':
get:
summary: get metas for a post
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: integer
required: true
responses:
'200':
description: New meta id
schema:
title: categories
type: array
items:
$ref: '#/definitions/metas'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
'/{blog-id}/categories':
get:
summary: Not yet developed 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: Not yet developed 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: Not yet developed 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
OneSetting:
type: object
properties:
ns:
type: string
value:
type: string
type:
type: string
label:
type: string
global:
type: boolean
settings:
type: array
items:
type: object
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
new_meta:
required:
- meta_id
- meta_type
- post_id
type: object
properties:
meta_id:
type: string
meta_type:
type: string
post_id:
type: integer
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_format
- post_status
- post_content
- post_title
properties:
post_title:
type: string
post_format:
type: string
description: generally 'xhtml' or 'wiki'. If you put another value, not managed by Dotclear or a plugin, Fill in the post_content_xhtml field.
post_content:
type: string
description: The content on WhatYouWant format
post_content_xhtml:
type: string
description: If post_format is wiki or xhtml and not set, It will be generated from post_content
post_status:
type: string
enum:
- Pending
- Scheduled
- Unpublished
- Published
cat_id:
type: integer
new_cat_id:
type: string
description: If creating a new category, this is the only required cat_ field. If given cat_id must not be given
new_cat_parent_id:
type: integer
description: Only if new_cat_id is given
new_cat_desc:
type: string
description: the new category description.
new_cat_url:
type: string
description: the new category url
post_dt:
type: string
description: \'YY-MM-dd hh:mm:ss\' If not set, Current dateTime will be used.
post_password:
type: string
description: Don\'t set that value if your new post won\'t be protected
post_url:
type: string
description: If not set, will be created using the date and the post_titlke
post_lang:
type: string
description: If not set, User lang will be used
post_excerpt:
type: string
post_excerpt_xhtml:
type: string
description: If post_format is wiki or xhtml, It will be generated from post_excerpt
post_notes:
type: string
post_selected:
type: boolean
post_open_comment:
type: boolean
post_open_tb:
type: boolean
post_tags:
type: array
description: post tags
dc_post:
type: object
properties:
post_id:
type: string
post_title:
type: string
post_format:
type: string
description: generally 'xhtml' or 'wiki'. If you put another value, not managed by Dotclear or a plugin, Fill in the post_content_xhtml field.
post_content:
type: string
description: The content on WhatYouWant format
post_content_xhtml:
type: string
description: If post_format is wiki or xhtml and not set, It will be generated from post_content
post_status:
type: string
enum:
- Pending
- Scheduled
- Unpublished
- Published
cat_id:
type: integer
new_cat_id:
type: string
description: If creating a new category, this is the only required cat_ field. If given cat_id must not be given
new_cat_parent_id:
type: integer
description: Only if new_cat_id is given
new_cat_desc:
type: string
description: the new category description.
new_cat_url:
type: string
description: the new category url
post_dt:
type: string
description: \'YY-MM-dd hh:mm:ss\' If not set, Current dateTime will be used.
post_password:
type: string
description: Don\'t set that value if your new post won\'t be protected
post_url:
type: string
description: If not set, will be created using the date and the post_titlke
post_lang:
type: string
description: If not set, User lang will be used
post_excerpt:
type: string
post_excerpt_xhtml:
type: string
description: If post_format is wiki or xhtml, It will be generated from post_excerpt
post_notes:
type: string
post_selected:
type: boolean
post_open_comment:
type: boolean
post_open_tb:
type: boolean
post_tags:
type: array
description: post tags
nb_comment:
type: integer
nb_trackback:
type: integer
post_firstpub:
type: string
metas:
type: array
items:
type: object
metas:
type: array
items:
type: object
category:
type: object
properties:
cat_id:
type: integer
cat_title:
type: string
cat_url:
type: string
cat_desc:
type: string
cat_position:
type: integer
cat_parent_id:
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_parent_id:
type: integer
cat_position:
type: integer
temporary:
type: boolean
Error:
type: object
properties:
code:
type: integer
format: int32
message:
type: string
fields:
type: string