Project API
Base URL
/api
All endpoints require authentication using Authorization: Bearer <token>.
Endpoints
GET /project
Retrieve a list of all projects.
Headers:
Authorization: Bearer <token>
Response:
{
"projects": [
{
"id": "string",
"name": "string",
"description": "string",
"created_at": "datetime",
"updated_at": "datetime"
}
]
}
POST /project
Create a new project.
Headers:
Authorization: Bearer <token>
Request Body:
{
"categoryId": "string",
"endDate": "string",
"exclude": "string",
"group": "string",
"keyword": "string",
"startDate": "string",
"type": "string"
}
Response:
{
"data": {
"categoryid": "string",
"exclude": "string",
"group": "string",
"id": "string",
"islisten": 0,
"keyword": "string",
"start_date": "string",
"type": "string",
"updatedAt": "string"
},
"message": "string"
}
DELETE /project
Delete a project.
Headers:
Authorization: Bearer <token>
Request Body:
{
"project_id": "string"
}
Response:
{
"message": "Project deleted successfully"
}
GET /project/content-count
Retrieve content counts for projects.
Headers:
Authorization: Bearer <token>
Query Parameters:
project_id(optional): ID project spesifik
Response:
{
"total_content": 100,
"content_by_project": [
{
"project_id": "string",
"project_name": "string",
"count": 50
}
]
}
PATCH /project/listen-status
Update the listen status of a project.
Headers:
Authorization: Bearer <token>
Request Body:
{
"project_id": "string",
"listen_status": "boolean"
}
Response:
{
"project_id": "string",
"listen_status": true,
"updated_at": "datetime"
}
GET /project/summary/:keywordID
Get a summary based on a keyword ID.
Headers:
Authorization: Bearer <token>
Path Parameters:
keywordID: ID keyword
Response:
{
"keyword_id": "string",
"summary": "string",
"generated_at": "datetime",
"content_count": 25
}
POST /project/generate-summary/:keywordID
Generate a new summary for a keyword.
Headers:
Authorization: Bearer <token>
Path Parameters:
keywordID: ID keyword
Response:
{
"keyword_id": "string",
"summary": "string",
"generated_at": "datetime",
"content_count": 25
}
Error Responses
401 Unauthorized
{
"error": "Invalid or missing token"
}
403 Forbidden
{
"error": "Access denied"
}
404 Not Found
{
"error": "Project not found"
}
500 Internal Server Error
{
"error": "Internal server error"
}