API Blog
Gérez les articles du blog.
Lister les articles
GET /api/projects/{projectId}/articlesParamĂštres
| ParamĂštre | Type | Description |
|---|---|---|
status | string | DRAFT, PUBLISHED, ARCHIVED |
page | number | Numéro de page |
limit | number | Nombre par page |
Réponse (200)
{
"data": [
{
"id": "art_123",
"projectId": "proj_123",
"title": "Mon Article",
"slug": "mon-article",
"content": "<h1>Contenu</h1>",
"excerpt": "Court résumé",
"status": "PUBLISHED",
"createdAt": "2024-01-15T10:30:00Z",
"publishedAt": "2024-01-15T10:30:00Z"
}
]
}Obtenir un article
GET /api/projects/{projectId}/articles/{articleId}Créer un article
POST /api/projects/{projectId}/articles
Authorization: Bearer TOKEN
Content-Type: application/jsonRequĂȘte
{
"title": "Mon nouvel article",
"slug": "mon-nouvel-article",
"content": "<h1>Titre</h1><p>Contenu riche...</p>",
"excerpt": "Court résumé",
"status": "DRAFT"
}Réponse (201)
{
"data": { ... }
}Modifier un article
PUT /api/projects/{projectId}/articles/{articleId}
Authorization: Bearer TOKEN
Content-Type: application/jsonRequĂȘte
{
"title": "Nouveau titre",
"content": "<p>Nouveau contenu</p>",
"status": "PUBLISHED"
}Supprimer un article
DELETE /api/projects/{projectId}/articles/{articleId}
Authorization: Bearer TOKENPublier un article
Pour passer un article en PUBLISHED :
PUT /api/projects/{projectId}/articles/{articleId}
Authorization: Bearer TOKEN
Content-Type: application/jsonRequĂȘte
{
"status": "PUBLISHED",
"publishedAt": "2024-01-15T10:30:00Z"
}Voir Blog CMS pour plus de détails.
Last updated on