Articles API
De Articles API biedt endpoints voor het beheren van artikelen (content) in Joomla.
Base URL
/api/index.php/v1/content/articles
Endpoints Overzicht
| Methode | Endpoint | Beschrijving |
|---|---|---|
| GET | /content/articles | Alle artikelen ophalen |
| GET | /content/articles/{id} | Specifiek artikel ophalen |
| POST | /content/articles | Nieuw artikel aanmaken |
| PATCH | /content/articles/{id} | Artikel bijwerken |
| DELETE | /content/articles/{id} | Artikel verwijderen |
Alle artikelen ophalen
GET /api/index.php/v1/content/articles
Response
{
"data": [
{
"type": "articles",
"id": "1",
"attributes": {
"title": "Welkom bij Joomla",
"alias": "welkom-bij-joomla",
"introtext": "Dit is de introductie...",
"fulltext": "Dit is de volledige tekst...",
"state": 1,
"catid": 2,
"created": "2024-01-01 12:00:00",
"created_by": 42,
"modified": "2024-10-26 10:30:00"
}
}
],
"meta": {
"total-pages": 5
}
}
Specifiek artikel ophalen
GET /api/index.php/v1/content/articles/{id}
Parameters
| Parameter | Type | Beschrijving |
|---|---|---|
| id | integer | Artikel ID |
Voorbeeld
curl -X GET "https://jouwesite.nl/api/index.php/v1/content/articles/1" \
-H "X-Joomla-Token: JOUW_API_TOKEN"
Artikel aanmaken
POST /api/index.php/v1/content/articles
Request Body
{
"title": "Nieuw artikel",
"alias": "nieuw-artikel",
"introtext": "Dit is de introductie van het nieuwe artikel",
"fulltext": "Dit is de volledige tekst van het nieuwe artikel",
"catid": 2,
"state": 1,
"access": 1,
"language": "*"
}
Verplichte velden
| Veld | Type | Beschrijving |
|---|---|---|
| title | string | Titel van het artikel |
| catid | int | Categorie ID |
Optionele velden
| Veld | Type | Standaard | Beschrijving |
|---|---|---|---|
| alias | string | auto | URL-vriendelijke naam |
| introtext | string | "" | Introductie tekst |
| fulltext | string | "" | Volledige tekst |
| state | int | 1 | Publicatiestatus |
| access | int | 1 | Toegangsniveau |
| language | string | "*" | Taalcode of * voor alle talen |
| featured | int | 0 | Uitgelicht artikel |
| metadesc | string | "" | Meta beschrijving |
| metakey | string | "" | Meta keywords |
Voorbeeld
curl -X POST "https://jouwesite.nl/api/index.php/v1/content/articles" \
-H "X-Joomla-Token: JOUW_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Nieuw artikel",
"alias": "nieuw-artikel",
"introtext": "Introductie tekst",
"fulltext": "Volledige tekst",
"catid": 2,
"state": 1
}'
Artikel bijwerken
PATCH /api/index.php/v1/content/articles/{id}
Request Body
Alleen de velden die je wilt wijzigen:
{
"title": "Bijgewerkte titel",
"state": 0
}
Voorbeeld
curl -X PATCH "https://jouwesite.nl/api/index.php/v1/content/articles/1" \
-H "X-Joomla-Token: JOUW_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Bijgewerkte titel"
}'
Artikel verwijderen
DELETE /api/index.php/v1/content/articles/{id}
Voorbeeld
curl -X DELETE "https://jouwesite.nl/api/index.php/v1/content/articles/1" \
-H "X-Joomla-Token: JOUW_API_TOKEN"
Let op
Het verwijderen van een artikel verplaatst het naar de prullenbak (state = -2).
Article States
| Waarde | Status |
|---|---|
| -2 | Prullenbak |
| 0 | Niet gepubliceerd |
| 1 | Gepubliceerd |
| 2 | Gearchiveerd |
Filtering
Op categorie
GET /api/index.php/v1/content/articles?filter[category]=2
Op status
GET /api/index.php/v1/content/articles?filter[state]=1
Op auteur
GET /api/index.php/v1/content/articles?filter[author]=42
Zoeken
GET /api/index.php/v1/content/articles?filter[search]=joomla
Gerelateerde Endpoints
- Categories API - Categorie beheer
- Tags API - Tags koppelen aan artikelen