PDF-rapporten
Genereer professionele PDF-rapporten voor geboortehoroscopen, synastrie, zonneretour en meer. De PDF-rapportenmodule stelt u in staat aanpasbare astrologierapporten te maken met interpretaties, horoscopen en tabellen.
Overzicht
De PDF-rapportenfunctie biedt:
- Meerdere rapporttypes: Geboortehoroscoop, synastrie, composiet, transit, zonneretour, maanretour, progressies, numerologie en Chinese astrologie
- Aanpasbare templates: Maak en beheer uw eigen PDF-templates met aangepaste lay-outs
- Automatische berekeningen: Astrologiegegevens worden direct berekend en samengevoegd in uw template
- Professionele output: Hoogwaardige PDF-generatie met ondersteuning voor kop- en voetteksten, paginanummers en aangepaste CSS
Ondersteunde rapporttypes
| Rapporttype | Beschrijving |
|---|---|
natal | Geboortehoroscoopanalyse met planetaire posities, huizen en aspecten |
synastry | Relatiecompatibiliteit tussen twee horoscopen |
composite | Gecombineerde horoscoop voor relaties |
transit | Huidige planetaire transits naar geboortehoroscoop |
solar-return | Jaarlijkse verjaardagshoroscoop |
lunar-return | Maandelijkse maanretourhoroscoop |
progressions | Secundaire progressies |
numerology | Numerologieberekeningen en -analyse |
chinese | Chinees astrologierapport |
Een PDF-rapport genereren
Genereer een PDF-rapport door geboortegegevens op te geven en optioneel een template te specificeren.
curl -X POST "https://api.astroapi.cloud/api/pdf-reports/generate" \
-H "X-Api-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"reportType": "natal",
"subject": {
"name": "John Doe",
"birthDate": {
"year": 1990,
"month": 6,
"day": 15,
"hour": 14,
"minute": 30
},
"birthPlace": {
"name": "London, UK",
"latitude": 51.5074,
"longitude": -0.1278,
"timezone": "Europe/London"
}
}
}' \
--output natal-report.pdfVerzoekparameters
| Parameter | Type | Verplicht | Beschrijving |
|---|---|---|---|
reportType | string | Ja | Type rapport (zie ondersteunde types hierboven) |
templateId | string | Nee | Specifiek template-ID om te gebruiken (gebruikt standaard indien niet opgegeven) |
subject | object | Ja | Geboortegegevens van het hoofdonderwerp |
partner | object | Nee | Geboortegegevens van partner (verplicht voor synastrie/composiet) |
transitDate | object | Nee | Doeldatum voor transit-/retourrapporten |
Subject-object
| Veld | Type | Verplicht | Beschrijving |
|---|---|---|---|
name | string | Ja | Naam van de persoon |
birthDate | object | Ja | Geboortedatum en -tijd |
birthDate.year | number | Ja | Geboortejaar |
birthDate.month | number | Ja | Geboortemaand (1-12) |
birthDate.day | number | Ja | Geboortedag (1-31) |
birthDate.hour | number | Ja | Geboorteuur (0-23) |
birthDate.minute | number | Ja | Geboorteminuut (0-59) |
birthPlace | object | Ja | Geboortelocatie |
birthPlace.name | string | Ja | Locatienaam |
birthPlace.latitude | number | Ja | Breedtegraad (-90 tot 90) |
birthPlace.longitude | number | Ja | Lengtegraad (-180 tot 180) |
birthPlace.timezone | string | Ja | IANA tijdzone-identifier |
Response
Het endpoint retourneert een PDF-bestand (application/pdf) met het gegenereerde rapport.
Synastrie-rapportvoorbeeld
Genereer een synastrierapport dat twee geboortehoroscopen vergelijkt:
curl -X POST "https://api.astroapi.cloud/api/pdf-reports/generate" \
-H "X-Api-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"reportType": "synastry",
"subject": {
"name": "Person A",
"birthDate": {
"year": 1990,
"month": 6,
"day": 15,
"hour": 14,
"minute": 30
},
"birthPlace": {
"name": "London, UK",
"latitude": 51.5074,
"longitude": -0.1278,
"timezone": "Europe/London"
}
},
"partner": {
"name": "Person B",
"birthDate": {
"year": 1988,
"month": 3,
"day": 22,
"hour": 9,
"minute": 15
},
"birthPlace": {
"name": "Paris, France",
"latitude": 48.8566,
"longitude": 2.3522,
"timezone": "Europe/Paris"
}
}
}' \
--output synastry-report.pdfZonneretour-rapportvoorbeeld
Genereer een zonneretourhoroscoop voor een specifiek jaar:
curl -X POST "https://api.astroapi.cloud/api/pdf-reports/generate" \
-H "X-Api-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"reportType": "solar-return",
"subject": {
"name": "John Doe",
"birthDate": {
"year": 1990,
"month": 6,
"day": 15,
"hour": 14,
"minute": 30
},
"birthPlace": {
"name": "London, UK",
"latitude": 51.5074,
"longitude": -0.1278,
"timezone": "Europe/London"
}
},
"transitDate": {
"year": 2025,
"month": 6,
"day": 15,
"hour": 0,
"minute": 0
}
}' \
--output solar-return-2025.pdfTemplatebeheer
Templates definiëren de lay-out en inhoud van uw PDF-rapporten. Elke template is gekoppeld aan een specifiek rapporttype.
Templates opvragen
curl -X GET "https://api.astroapi.cloud/api/pdf-reports/templates" \
-H "X-Api-Key: your-api-key"Retourneert zowel organisatiespecifieke templates als globale (gedeelde) templates.
Een specifiek template ophalen
curl -X GET "https://api.astroapi.cloud/api/pdf-reports/templates/{templateId}" \
-H "X-Api-Key: your-api-key"Een template aanmaken
curl -X POST "https://api.astroapi.cloud/api/pdf-reports/templates" \
-H "X-Api-Key: your-api-key" \
-H "Content-Type: application/vnd.api+json" \
-d '{
"data": {
"type": "templates",
"attributes": {
"name": "My Natal Report Template",
"description": "Custom natal chart report",
"reportType": "natal",
"editorConfig": {},
"pageSettings": {
"format": "A4",
"orientation": "portrait",
"margins": {
"top": 20,
"right": 20,
"bottom": 20,
"left": 20
}
},
"isDefault": true
}
}
}'Template-attributen
| Attribuut | Type | Beschrijving |
|---|---|---|
name | string | Templatenaam (1-100 tekens) |
description | string | Optionele beschrijving |
reportType | string | Rapporttype waarvoor dit template is |
editorConfig | object | Editor.js blokconfiguratie |
pageSettings | object | Pagina-indelingsinstellingen |
customCss | string | Aangepaste CSS-stijlen |
isDefault | boolean | Instellen als standaard voor dit rapporttype |
isActive | boolean | Of het template actief is |
Pagina-instellingen
| Instelling | Type | Beschrijving |
|---|---|---|
format | string | Paginaformaat: "A4" of "Letter" |
orientation | string | "portrait" of "landscape" |
margins | object | Paginamarges in mm (top, right, bottom, left) |
header | object | Koptekstconfiguratie |
footer | object | Voettekstconfiguratie |
pageNumbers | object | Paginanummerinstellingen |
Kop-/voettekstconfiguratie
{
"header": {
"enabled": true,
"height": 15,
"content": "My Astrology Report"
},
"footer": {
"enabled": true,
"height": 15,
"content": "Generated by AstroAPI"
},
"pageNumbers": {
"enabled": true,
"position": "bottom-center",
"format": "Page <span class=\"pageNumber\"></span> of <span class=\"totalPages\"></span>"
}
}Een template bijwerken
curl -X PATCH "https://api.astroapi.cloud/api/pdf-reports/templates/{templateId}" \
-H "X-Api-Key: your-api-key" \
-H "Content-Type: application/vnd.api+json" \
-d '{
"data": {
"type": "templates",
"attributes": {
"name": "Updated Template Name"
}
}
}'Een template verwijderen
curl -X DELETE "https://api.astroapi.cloud/api/pdf-reports/templates/{templateId}" \
-H "X-Api-Key: your-api-key"Een template dupliceren
Kopieer een bestaand template (inclusief globale templates) naar uw organisatie:
curl -X POST "https://api.astroapi.cloud/api/pdf-reports/templates/{templateId}/duplicate" \
-H "X-Api-Key: your-api-key"Standaardtemplate instellen
Stel een template in als standaard voor het bijbehorende rapporttype:
curl -X POST "https://api.astroapi.cloud/api/pdf-reports/templates/{templateId}/set-default" \
-H "X-Api-Key: your-api-key"Een template voorbekijken
Bekijk hoe een template wordt weergegeven met voorbeeldgegevens (retourneert HTML):
curl -X POST "https://api.astroapi.cloud/api/pdf-reports/preview" \
-H "X-Api-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"templateId": "your-template-id"
}'Template-resolutie
Bij het genereren van een PDF bepaalt het systeem welk template wordt gebruikt in deze volgorde:
- Specifiek template: Als
templateIdis opgegeven in het verzoek - Organisatiestandaard: Het standaardtemplate van de organisatie voor het rapporttype
- Globale standaard: Een globaal (gedeeld) standaardtemplate voor het rapporttype
Vereiste permissies
| Endpoint | Permissie |
|---|---|
| Templates opvragen/ophalen | content:read |
| PDF genereren | content:read |
| Template voorbekijken | content:read |
| Template aanmaken | content:create |
| Template bijwerken | content:update |
| Template verwijderen | content:delete |
| Template dupliceren | content:create |
| Standaard instellen | content:update |
Rapportinhoud
Gegenereerde rapporten bevatten:
- Onderwerpsinformatie: Naam, geboortedatum, -tijd en -locatie
- Planetaire posities: Alle grote planeten met teken, huis en graad
- Huiscuspen: Alle 12 huiscuspen met tekens
- Aspecten: Planetaire aspecten met orbs en interpretaties
- Interpretaties: CMS-afkomstige tekstinhoud voor elke plaatsing en elk aspect
De daadwerkelijke inhoud is afhankelijk van de templateconfiguratie en beschikbare CMS-content.