Overview
RelatedContent API is an API for managing Fess related content. You can display custom content related to specific keywords.
Base URL
/api/admin/relatedcontent
Endpoint List
| Method | Path | Description |
|---|---|---|
| GET/PUT | /settings | List related content |
| GET | /setting/{id} | Get related content |
| POST | /setting | Create related content |
| PUT | /setting | Update related content |
| DELETE | /setting/{id} | Delete related content |
List Related Content
Request
GET /api/admin/relatedcontent/settings
PUT /api/admin/relatedcontent/settings
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
size | Integer | No | Number of items per page (default: 20) |
page | Integer | No | Page number (starts from 0) |
Response
{
"response": {
"status": 0,
"settings": [
{
"id": "content_id_1",
"term": "fess",
"content": "<div>Fess is an open source search server.</div>",
"sortOrder": 0
}
],
"total": 5
}
}
Get Related Content
Request
GET /api/admin/relatedcontent/setting/{id}
Response
{
"response": {
"status": 0,
"setting": {
"id": "content_id_1",
"term": "fess",
"content": "<div>Fess is an open source search server.</div>",
"sortOrder": 0,
"virtualHost": ""
}
}
}
Create Related Content
Request
POST /api/admin/relatedcontent/setting
Content-Type: application/json
Request Body
{
"term": "search",
"content": "<div class='related'><h3>About Search</h3><p>Learn more about search features...</p></div>",
"sortOrder": 0,
"virtualHost": ""
}
Field Description
| Field | Required | Description |
|---|---|---|
term | Yes | Search keyword |
content | Yes | HTML content to display |
sortOrder | No | Display order |
virtualHost | No | Virtual host |
Response
{
"response": {
"status": 0,
"id": "new_content_id",
"created": true
}
}
Update Related Content
Request
PUT /api/admin/relatedcontent/setting
Content-Type: application/json
Request Body
{
"id": "existing_content_id",
"term": "search",
"content": "<div class='related updated'><h3>About Search</h3><p>Updated information...</p></div>",
"sortOrder": 0,
"virtualHost": "",
"versionNo": 1
}
Response
{
"response": {
"status": 0,
"id": "existing_content_id",
"created": false
}
}
Delete Related Content
Request
DELETE /api/admin/relatedcontent/setting/{id}
Response
{
"response": {
"status": 0,
"id": "deleted_content_id",
"created": false
}
}
Usage Examples
Product Information Related Content
curl -X POST "http://localhost:8080/api/admin/relatedcontent/setting" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"term": "product",
"content": "<div class=\"product-info\"><h3>Our Products</h3><ul><li>Product A</li><li>Product B</li></ul></div>",
"sortOrder": 0
}'
Support Information Related Content
curl -X POST "http://localhost:8080/api/admin/relatedcontent/setting" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"term": "support",
"content": "<div><p>Need help? Contact: support@example.com</p></div>",
"sortOrder": 0
}'
Reference
Admin API Overview - Admin API Overview
RelatedQuery API - Related Query API
Related Content - Related Content Management Guide