apiDoc
POST /api/v1/articles
Name | Type | Description |
---|---|---|
TITLE | String | The Title of article to create |
Success-Response:
HTTP/1.1 201 OK
{
"ID": 1,
"TITLE" : "Lorem Ipsum"
}
Name | Type | Description |
---|---|---|
ID | Number | Id of the article created |
TITLE | String | Title of the article created |
GET /api/v1/articles
Success-Response:
HTTP/1.1 200 OK
[
{
"ID": 1,
"TITLE" : "Lorem Ipsum"
},
{
"ID": 2,
"TITLE" : "The game"
},
...
]
Name | Type | Description |
---|---|---|
ID | Number | Id of the article |
TITLE | String | Title of the article |
GET /api/v1/articles?paragraphs=true
Success-Response:
HTTP/1.1 200 OK
[
{
"ID": 1,
"TITLE" : "Lorem Ipsum",
"CONTENT": [
{
"ID": 1,
"CONTENT": "Lorem ipsum dolor sit amet.",
"POSITION": 1,
"ARTICLE_ID": 1
},
{
"ID": 2,
"CONTENT": "Ut enim ad minim veniam.",
"POSITION": 2,
"ARTICLE_ID": 1
},
...
},
{
"ID": 2,
"TITLE" : "The game",
"CONTENT" : [
{
"ID": 3,
"CONTENT": "Perdu !",
"POSITION": 1,
"ARTICLE_ID": 2
},
...
},
...
]
Name | Type | Description |
---|---|---|
ID | Number | Id of the article |
TITLE | String | Title of the article |
CONTENT | Object[] | List of paragraphs |
CONTENT.ID | Number | Id of the article patched |
CONTENT.TITLE | String | Title of the article patched |
CONTENT.POSITION | Number | The position of the paragraph in the article |
CONTENT.ARTICLE_ID | Number | The Id of the article associated to the paragraph |
GET /api/v1/paragraphs/:id
Success-Response:
HTTP/1.1 200 OK
{
"ID": 1,
"CONTENT": "Lorem ipsum dolor sit amet.",
"POSITION": 1,
"ARTICLE_ID": 1
}
Name | Type | Description |
---|---|---|
ID | Number | Id of the paragraph |
CONTENT | String | Content of the article |
POSITION | Number | The position of the paragraph in the article |
ARTICLE_ID | Number | The Id of the article associated to the paragraphe |
DELETE /api/v1/articles/:id
201 Success-Response:
HTTP/1.1 201 OK
{
"Response" : "Successfully deleted article with ID <code>ID</code>",
}
Name | Type | Description |
---|---|---|
ID | Number | Id of the deleted article |
Name | Type | Description |
---|---|---|
ArticleNotFound | No article with the ID |
Error-Response:
HTTP/1.1 404 Not Found
{
"Error": "No article with the ID <code>ID</code> found"
}
GET /api/v1/articles/:id
Success-Response:
HTTP/1.1 201 OK
{
"ID": 1,
"TITLE" : "Lorem Ipsum"
}
Name | Type | Description |
---|---|---|
ID | Number | Id of the article |
TITLE | String | Title of the article |
Name | Type | Description |
---|---|---|
ArticleNotFound | No article with the ID |
PATCH /api/v1/articles/:id
Name | Type | Description |
---|---|---|
TITLE | String | The Title of article to patch |
Success-Response:
HTTP/1.1 201 OK
{
"ID": 1,
"TITLE" : "Lorem Ipsum"
}
Name | Type | Description |
---|---|---|
ID | Number | Id of the article patched |
TITLE | String | Title of the article patched |
POST /api/v1/articles/:idA/paragraphs
Name | Type | Description |
---|---|---|
CONTENT | String | Content of the paragraph patched |
POSITION | Number | Optional position of the paragraph in the article (if empty, the paragraph is added at the end of the article) |
ARTICLE_ID | Number | Id of the article associated to the paragraph |
Success-Response:
HTTP/1.1 201 OK
[
{
"ID": 2,
"CONTENT": "Ut enim ad minim veniam.",
"POSITION": 2,
"ARTICLE_ID": 1
},
...
]
Name | Type | Description |
---|---|---|
ID | Number | Id of the article |
TITLE | String | Title of the article |
POSITION | Number | The position of the paragraph in the article |
ARTICLE_ID | Number | The Id of the article associated to the paragraph |
DELETE /api/v1/paragraphs/:id
201 Success-Response:
HTTP/1.1 201 OK
{
"Response" : "Successfully deleted paragraph with ID <code>ID</code>",
}
Name | Type | Description |
---|---|---|
ID | Number | Id of the deleted paragraph |
Name | Type | Description |
---|---|---|
ArticleNotFound | No paragraph with the ID |
Error-Response:
HTTP/1.1 404 Not Found
{
"Error": "No paragraph with the ID <code>ID</code> found"
}
GET /api/v1/articles/:idA/paragraphs/:pos
Success-Response:
HTTP/1.1 201 OK
[
{
"ID": 2,
"CONTENT": "Ut enim ad minim veniam.",
"POSITION": 2,
"ARTICLE_ID": 1
},
...
]
Name | Type | Description |
---|---|---|
ID | Number | Id of the article patched |
TITLE | String | Title of the article patched |
POSITION | Number | The position of the paragraph in the article |
ARTICLE_ID | Number | The Id of the article associated to the paragraph |
PATCH /api/v1/paragraphs/:id
Name | Type | Description |
---|---|---|
ID | Number | Optional Id of the paragraph patched |
CONTENT | String | Optional Content of the paragraph patched |
POSITION | Number | Optional position of the paragraph in the article |
ARTICLE_ID | Number | Optional Id of the article associated to the paragraph |
Success-Response:
HTTP/1.1 201 OK
{
"ID": 2,
"CONTENT": "Ut enim ad minim veniam.",
"POSITION": 2,
"ARTICLE_ID": 1
}
Name | Type | Description |
---|---|---|
ID | Number | Id of the article patched |
TITLE | String | Title of the article patched |
POSITION | Number | The position of the paragraph in the article |
ARTICLE_ID | Number | The Id of the article associated to the paragraph |
GET /api/v1/articles/:idA/paragraphs
Success-Response:
HTTP/1.1 201 OK
[
{
"ID": 2,
"CONTENT": "Ut enim ad minim veniam.",
"POSITION": 2,
"ARTICLE_ID": 1
},
...
]
Name | Type | Description |
---|---|---|
ID | Number | Id of the paragraph |
CONTENT | String | Content of the paragraph |
POSITION | Number | The position of the paragraph in the article |
ARTICLE_ID | Number | The Id of the article associated to the paragraph |