Add into /v1/projects/:id resources
{
"type": "phpwiki",
"uri": "projects/:id/phpwiki"
}
OPTIONS /v1/projects/:id/phpwiki
GET /v1/projects/:id/phpwiki
{
"pages": [
{
"id": 1234,
"uri": "phpwiki/1234",
"name": "HomePage",
},
{
"id": 5464,
"uri": "phpwiki/5464",
"name": "Some Other Page",
},
]
}
WARNING -> This route is paginated
GET /v1/projects/:id/phpwiki?pagename=Some+Other+Page
{
"id": 5464,
"uri": "/wiki/5464",
"name": "Some Other FPage",
}
GET /v1/projects/:id/phpwiki?pagename=With
{
"pages": [
{
"id": 6100,
"uri": "phpwiki/6100",
"name": "With Space"
},
{
"id": 6097,
"uri": "phpwiki/6097",
"name": "WithContent"
}
]
}
OPTIONS /v1/phpwiki/5464
GET /v1/phpwiki/5464
{
"id": 5464,
"uri": "/wiki/5464",
"name": "Some Other Page",
"last_version": 2,
"versions": [
{
"id": "1",
"uri": "phpwiki/5464/versions?version_id=1"
},
{
"id": "2",
"uri": "phpwiki/5464/versions?version_id=2"
}
]
}
OPTIONS phpwiki/5464/versions?version_id=2
GET phpwiki/5464/versions?version_id=2
{
"id": 5464,
"uri": "phpwiki/5464/versions?version_id=2",
"wiki_content": "_My content in italic_",
"formatted_content": "<div class ....> <i> My content in italic </i> ... </div>"
}
In order to have your HTML content, you can simply do a "json_decode" on the formatted content.
Accept: "text/html" GET /wiki/5464/2
-> returns the content in HTML
WARNING: this route relies on HTTP content negociation (Accept header) to return HTML (instead of param).