Ga naar hoofdinhoud

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

MethodeEndpointBeschrijving
GET/content/articlesAlle artikelen ophalen
GET/content/articles/{id}Specifiek artikel ophalen
POST/content/articlesNieuw 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

ParameterTypeBeschrijving
idintegerArtikel 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

VeldTypeBeschrijving
titlestringTitel van het artikel
catidintCategorie ID

Optionele velden

VeldTypeStandaardBeschrijving
aliasstringautoURL-vriendelijke naam
introtextstring""Introductie tekst
fulltextstring""Volledige tekst
stateint1Publicatiestatus
accessint1Toegangsniveau
languagestring"*"Taalcode of * voor alle talen
featuredint0Uitgelicht artikel
metadescstring""Meta beschrijving
metakeystring""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

WaardeStatus
-2Prullenbak
0Niet gepubliceerd
1Gepubliceerd
2Gearchiveerd

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