PDFレポート
ネイタルチャート、シナストリー、ソーラーリターンなどのプロフェッショナルなPDFレポートを生成します。PDFレポートモジュールを使用すると、解釈テキスト、チャート、テーブルを含むカスタマイズ可能な占星術レポートを作成できます。
概要
PDFレポート機能が提供するもの:
- 複数のレポートタイプ:ネイタル、シナストリー、コンポジット、トランジット、ソーラーリターン、ルナーリターン、プログレッション、数秘術、中国占星術
- カスタマイズ可能なテンプレート:カスタムレイアウトで独自のPDFテンプレートを作成・管理する
- 自動計算:占星術データはオンザフライで計算され、テンプレートにマージされる
- プロフェッショナルな出力:ヘッダー、フッター、ページ番号、カスタムCSSのサポートを含む高品質なPDF生成
サポートされるレポートタイプ
| レポートタイプ | 説明 |
|---|---|
natal | 惑星位置、ハウス、アスペクトを含む出生チャート分析 |
synastry | 2つのチャートの関係性の相性 |
composite | 関係のためのコンポジットチャート |
transit | ネイタルチャートへの現在の惑星トランジット |
solar-return | 年間誕生日チャート |
lunar-return | 月間ルナーリターンチャート |
progressions | セカンダリプログレッション |
numerology | 数秘術計算と分析 |
chinese | 中国占星術レポート |
PDFレポートの生成
出生データを提供し、オプションでテンプレートを指定してPDFレポートを生成する。
bash
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.pdfリクエストパラメータ
| パラメータ | 型 | 必須 | 説明 |
|---|---|---|---|
reportType | string | はい | レポートタイプ(上記のサポートタイプを参照) |
templateId | string | いいえ | 使用する特定のテンプレートID(指定されない場合はデフォルトを使用) |
subject | object | はい | メイン対象者の出生データ |
partner | object | いいえ | パートナーの出生データ(シナストリー・コンポジットに必要) |
transitDate | object | いいえ | トランジット・リターンレポートの目標日付 |
Subjectオブジェクト
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
name | string | はい | 人物の名前 |
birthDate | object | はい | 出生日時 |
birthDate.year | number | はい | 出生年 |
birthDate.month | number | はい | 出生月(1〜12) |
birthDate.day | number | はい | 出生日(1〜31) |
birthDate.hour | number | はい | 出生時(0〜23) |
birthDate.minute | number | はい | 出生分(0〜59) |
birthPlace | object | はい | 出生地 |
birthPlace.name | string | はい | 地名 |
birthPlace.latitude | number | はい | 緯度(-90〜90) |
birthPlace.longitude | number | はい | 経度(-180〜180) |
birthPlace.timezone | string | はい | IANAタイムゾーン識別子 |
レスポンス
エンドポイントは生成されたレポートの入ったPDFファイル(application/pdf)を返します。
シナストリーレポートの例
2つの出生チャートを比較するシナストリーレポートを生成する:
bash
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.pdfソーラーリターンレポートの例
特定の年のソーラーリターンチャートを生成する:
bash
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.pdfテンプレート管理
テンプレートはPDFレポートのレイアウトとコンテンツを定義します。各テンプレートは特定のレポートタイプに関連付けられています。
テンプレートの一覧
bash
curl -X GET "https://api.astroapi.cloud/api/pdf-reports/templates" \
-H "X-Api-Key: your-api-key"組織固有のテンプレートとグローバル(共有)テンプレートの両方を返します。
特定のテンプレートの取得
bash
curl -X GET "https://api.astroapi.cloud/api/pdf-reports/templates/{templateId}" \
-H "X-Api-Key: your-api-key"テンプレートの作成
bash
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
}
}
}'テンプレート属性
| 属性 | 型 | 説明 |
|---|---|---|
name | string | テンプレート名(1〜100文字) |
description | string | オプションの説明 |
reportType | string | このテンプレートのレポートタイプ |
editorConfig | object | Editor.jsブロック設定 |
pageSettings | object | ページレイアウト設定 |
customCss | string | カスタムCSSスタイル |
isDefault | boolean | このレポートタイプのデフォルトとして設定 |
isActive | boolean | テンプレートがアクティブかどうか |
ページ設定
| 設定 | 型 | 説明 |
|---|---|---|
format | string | ページサイズ:"A4" または "Letter" |
orientation | string | "portrait" または "landscape" |
margins | object | ページマージン(mm)(上、右、下、左) |
header | object | ヘッダー設定 |
footer | object | フッター設定 |
pageNumbers | object | ページ番号設定 |
ヘッダー・フッター設定
json
{
"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>"
}
}テンプレートの更新
bash
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"
}
}
}'テンプレートの削除
bash
curl -X DELETE "https://api.astroapi.cloud/api/pdf-reports/templates/{templateId}" \
-H "X-Api-Key: your-api-key"テンプレートの複製
既存のテンプレート(グローバルテンプレートを含む)を組織にコピーする:
bash
curl -X POST "https://api.astroapi.cloud/api/pdf-reports/templates/{templateId}/duplicate" \
-H "X-Api-Key: your-api-key"デフォルトテンプレートの設定
テンプレートをそのレポートタイプのデフォルトとして設定する:
bash
curl -X POST "https://api.astroapi.cloud/api/pdf-reports/templates/{templateId}/set-default" \
-H "X-Api-Key: your-api-key"テンプレートのプレビュー
サンプルデータでテンプレートのレンダリングをプレビューする(HTMLを返す):
bash
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"
}'テンプレート解決
PDFを生成する際、システムは次の順序でどのテンプレートを使用するかを解決します:
- 特定のテンプレート:リクエストで
templateIdが指定されている場合 - 組織デフォルト:レポートタイプに対する組織のデフォルトテンプレート
- グローバルデフォルト:レポートタイプに対するグローバル(共有)デフォルトテンプレート
必要な権限
| エンドポイント | 権限 |
|---|---|
| テンプレートの一覧・取得 | content:read |
| PDFの生成 | content:read |
| テンプレートのプレビュー | content:read |
| テンプレートの作成 | content:create |
| テンプレートの更新 | content:update |
| テンプレートの削除 | content:delete |
| テンプレートの複製 | content:create |
| デフォルトの設定 | content:update |
レポートコンテンツ
生成されたレポートには以下が含まれます:
- 対象者情報:名前、出生日、時刻、場所
- 惑星位置:サイン、ハウス、度数を含むすべての主要惑星
- ハウスカスプ:サインを含むすべての12ハウスカスプ
- アスペクト:オーブと解釈を含む惑星アスペクト
- 解釈テキスト:各配置とアスペクトのCMSから取得したテキストコンテンツ
実際のコンテンツはテンプレート設定と利用可能なCMSコンテンツによって異なります。