Ga naar hoofdinhoud

Contacts API

De Contacts API biedt endpoints voor het beheren van contactpersonen in Joomla.

Base URL

/api/index.php/v1/contact

Endpoints Overzicht

MethodeEndpointBeschrijving
GET/contactAlle contacten ophalen
GET/contact/{id}Specifiek contact ophalen
POST/contactNieuw contact aanmaken
PATCH/contact/{id}Contact bijwerken
DELETE/contact/{id}Contact verwijderen

Alle contacten ophalen

GET /api/index.php/v1/contact

Response

{
"data": [
{
"type": "contacts",
"id": "1",
"attributes": {
"name": "Jan Jansen",
"alias": "jan-jansen",
"con_position": "Manager",
"address": "Hoofdstraat 1",
"suburb": "Amsterdam",
"state": "Noord-Holland",
"country": "Nederland",
"postcode": "1000 AA",
"telephone": "020-1234567",
"mobile": "06-12345678",
"email_to": "jan@example.com",
"webpage": "https://example.com",
"published": 1,
"catid": 4
}
}
]
}

Specifiek contact ophalen

GET /api/index.php/v1/contact/{id}

Parameters

ParameterTypeBeschrijving
idintegerContact ID

Voorbeeld

curl -X GET "https://jouwesite.nl/api/index.php/v1/contact/1" \
-H "X-Joomla-Token: JOUW_API_TOKEN"

Contact aanmaken

POST /api/index.php/v1/contact

Request Body

{
"name": "Piet Pietersen",
"alias": "piet-pietersen",
"con_position": "Directeur",
"address": "Dorpsstraat 10",
"suburb": "Utrecht",
"telephone": "030-9876543",
"mobile": "06-98765432",
"email_to": "piet@example.com",
"webpage": "https://pietersen.nl",
"catid": 4,
"published": 1,
"access": 1,
"language": "*"
}

Verplichte velden

VeldTypeBeschrijving
namestringNaam van het contact
catidintCategorie ID

Optionele velden

VeldTypeStandaardBeschrijving
aliasstringautoURL-vriendelijke naam
con_positionstring""Functie/positie
addressstring""Adres
suburbstring""Plaats
statestring""Provincie
countrystring""Land
postcodestring""Postcode
telephonestring""Telefoonnummer
mobilestring""Mobiel nummer
faxstring""Faxnummer
email_tostring""E-mailadres
webpagestring""Website URL
publishedint1Publicatiestatus
accessint1Toegangsniveau
languagestring"*"Taalcode

Voorbeeld

curl -X POST "https://jouwesite.nl/api/index.php/v1/contact" \
-H "X-Joomla-Token: JOUW_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Piet Pietersen",
"email_to": "piet@example.com",
"telephone": "030-9876543",
"catid": 4
}'

Contact bijwerken

PATCH /api/index.php/v1/contact/{id}

Request Body

{
"telephone": "030-1111111",
"email_to": "nieuw@example.com"
}

Voorbeeld

curl -X PATCH "https://jouwesite.nl/api/index.php/v1/contact/1" \
-H "X-Joomla-Token: JOUW_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"telephone": "030-1111111"
}'

Contact verwijderen

DELETE /api/index.php/v1/contact/{id}

Voorbeeld

curl -X DELETE "https://jouwesite.nl/api/index.php/v1/contact/1" \
-H "X-Joomla-Token: JOUW_API_TOKEN"

Contact States

WaardeStatus
-2Prullenbak
0Niet gepubliceerd
1Gepubliceerd
2Gearchiveerd

Contact Categorieën

Contacten worden georganiseerd in categorieën. Standaard is dit categorie ID 4.

Categorieën ophalen

GET /api/index.php/v1/contact/categories

Filtering

Op categorie

GET /api/index.php/v1/contact?filter[catid]=4

Op publicatiestatus

GET /api/index.php/v1/contact?filter[published]=1

Zoeken

GET /api/index.php/v1/contact?filter[search]=jan

Custom Fields

Contacten ondersteunen custom fields. Deze zijn beschikbaar via aparte endpoints:

  • GET /api/index.php/v1/fields/contact/contact - Contact velden ophalen
  • POST /api/index.php/v1/fields/contact/contact - Contact veld aanmaken