Import API
Einführung
Die PressMatrix Import API ermöglicht Publishern, digitale Ausgaben für den PressMatrix Kiosk zu erstellen, zu aktualisieren, abzurufen, aufzulisten und zu löschen. Sie unterstützt Standard-PDF-Importe, geplante PDF-Importe und EPUB-Importe.
Die Basis-URL lautet:
https://pegasus.pressmatrix.com/api/v2/importer
OpenAPI-Spezifikation
OpenAPI YAML herunterladen
Die Spezifikation kann im Swagger Editor geöffnet werden.
Beispiel-Postman-Collection
Laden Sie eine Postman Collection herunter, um die API zu testen.
Postman Collection herunterladen.Authentifizierung
Alle Endpunkte benötigen tokenbasierte Authentifizierung über den Authorization-Header.
Authorization-Header
Authorization: Token {TOKEN_GENERATED_BY_PMX}
Übersicht
Die API stellt diese Endpunktgruppen bereit:
- Emags
GET /organizations/{organization_id}/publications/{publication_id}/emagsPOST /organizations/{organization_id}/publications/{publication_id}/emagsGET /organizations/{organization_id}/publications/{publication_id}/emags/{emag_id}PUT /organizations/{organization_id}/publications/{publication_id}/emags/{emag_id}DELETE /organizations/{organization_id}/publications/{publication_id}/emags/{emag_id}
- Geplante Emags
GET /organizations/{organization_id}/publications/{publication_id}/planned_emagsGET /organizations/{organization_id}/publications/{publication_id}/planned_emags/{planned_emag_id}
- Name
organization_id- Type
- integer
- Description
PressMatrix-Organization-ID.
- Name
publication_id- Type
- integer
- Description
PressMatrix-Publication-ID.
- Name
emag_id- Type
- integer
- Description
Emag-ID.
- Name
planned_emag_id- Type
- integer
- Description
Planned-Emag-ID.
- Name
page- Type
- integer
- Description
Optionale Seitennummer für paginierte Listen-Endpunkte. Minimum ist
1.
- Name
per- Type
- integer
- Description
Optionale Anzahl von Einträgen pro Seite für paginierte Listen-Endpunkte. Minimum ist
1.
Importmodi und Statusfelder
Pro Anfrage ist nur eines von import_attributes oder epub_import_attributes erlaubt.
Es gibt drei relevante Importvarianten:
- Standard-PDF-Import:
import_attributesohnepe_idverwenden - Geplanter PDF-Import:
import_attributeszusammen mitpe_idverwenden - EPUB-Import:
epub_import_attributesverwenden
Die Response verwendet je nach Importmodus unterschiedliche Import-Statusfelder:
- Name
import.status- Type
- enum
- Description
Wird für Standard-PDF-Importe ohne
pe_idverwendet.
- Name
import.ai_status- Type
- enum
- Description
Wird für geplante PDF-Importe und EPUB-Importe verwendet.
Unterstützte Enum-Werte für beide Felder:
Importstatus-Enum
pending
processing
finished
failed
emag erstellen
Erstellt ein neues emag.
Die Antwort gibt jetzt immer das vollständige emag-Objekt zurück.
- Name
name- Type
- string
- Description
Name der Ausgabe. Muss innerhalb der Publikation eindeutig sein.
- Name
released_at- Type
- string
- Description
Datum und Uhrzeit, ab denen die Ausgabe sichtbar ist.
- Name
pe_id- Type
- string
- Description
Identifier der geplanten Ausgabe. Nur für geplante Importe relevant.
- Name
preview- Type
- string
- Description
Kurzbeschreibung, die in der Detailansicht des Kiosks angezeigt wird.
- Name
apple_product_identifier- Type
- string
- Description
Identifier für den Apple App Store.
- Name
google_product_id- Type
- string
- Description
Identifier für Google Play.
- Name
external_id- Type
- string
- Description
Externer Identifier der Ausgabe.
- Name
hide_preview_widgets- Type
- boolean
- Description
Blendet Preview-Widgets aus, wenn der Wert
trueist.
- Name
single_purchase_required- Type
- boolean
- Description
Gibt an, ob ein Einzelkauf erforderlich ist.
- Name
for_subscribers_only- Type
- boolean
- Description
Gibt an, ob die Ausgabe nur für Abonnenten verfügbar ist.
- Name
cents- Type
- integer
- Description
Preis in Cent.
- Name
currency- Type
- string
- Description
Währungscode nach ISO 4217, zum Beispiel
EUR.
- Name
text_mode_enabled- Type
- boolean
- Description
Aktiviert den Textmodus.
- Name
language- Type
- string
- Description
Sprachcode, zum Beispiel
de.
- Name
category_ids- Type
- array
- Description
Array von Kategorie-IDs.
- Name
import_attributes- Type
- object
- Description
Konfiguration für den PDF-Import.
import_images(boolean)pdf_location(string, erforderlich)xml_location(string, optional)
- Name
epub_import_attributes- Type
- object
- Description
Konfiguration für den EPUB-Import.
import_articles(boolean)import_images(boolean)pdf_location(string, erforderlich)epub_location(string, erforderlich)
Beispiel für Standard-PDF-Import
curl --location 'https://pegasus.pressmatrix.com/api/v2/importer/organizations/{organization_id}/publications/{publication_id}/emags' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Token {TOKEN_GENERATED_BY_PMX}' \
--data '{
"emag": {
"name": "Generic PDF Issue",
"released_at": "2026-07-10T12:00:00.000Z",
"preview": "Generic short description for kiosk details.",
"apple_product_identifier": "com.example.kiosk.issue_generic_pdf",
"google_product_id": "com.example.kiosk.issue_generic_pdf",
"external_id": "ISSUE-GENERIC-PDF",
"hide_preview_widgets": false,
"single_purchase_required": false,
"for_subscribers_only": false,
"cents": 199,
"currency": "EUR",
"text_mode_enabled": true,
"language": "de",
"category_ids": [],
"import_attributes": {
"import_images": true,
"pdf_location": "https://cdn.example.com/issues/generic/issue.pdf",
"xml_location": "https://cdn.example.com/issues/generic/issue.xml"
}
}
}'
Beispiel für geplanten PDF-Import
curl --location 'https://pegasus.pressmatrix.com/api/v2/importer/organizations/{organization_id}/publications/{publication_id}/emags' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Token {TOKEN_GENERATED_BY_PMX}' \
--data '{
"emag": {
"name": "Generic Planned Issue",
"released_at": "2026-07-10T12:00:00.000Z",
"pe_id": "PUBCODE_20260710",
"preview": "Generic planned import preview.",
"apple_product_identifier": "com.example.kiosk.issue_generic_planned",
"google_product_id": "com.example.kiosk.issue_generic_planned",
"external_id": "ISSUE-GENERIC-PLANNED",
"hide_preview_widgets": false,
"single_purchase_required": false,
"for_subscribers_only": false,
"cents": 199,
"currency": "EUR",
"text_mode_enabled": true,
"language": "de",
"category_ids": [],
"import_attributes": {
"import_images": true,
"pdf_location": "https://cdn.example.com/issues/generic/issue.pdf"
}
}
}'
Beispiel für EPUB-Import
curl --location 'https://pegasus.pressmatrix.com/api/v2/importer/organizations/{organization_id}/publications/{publication_id}/emags' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Token {TOKEN_GENERATED_BY_PMX}' \
--data '{
"emag": {
"name": "Generic EPUB Issue",
"released_at": "2026-07-10T12:00:00.000Z",
"preview": "Generic EPUB import preview.",
"apple_product_identifier": "com.example.kiosk.issue_generic_epub",
"google_product_id": "com.example.kiosk.issue_generic_epub",
"external_id": "ISSUE-GENERIC-EPUB",
"hide_preview_widgets": false,
"single_purchase_required": false,
"for_subscribers_only": false,
"cents": 199,
"currency": "EUR",
"text_mode_enabled": true,
"language": "de",
"category_ids": [],
"epub_import_attributes": {
"import_articles": true,
"import_images": true,
"pdf_location": "https://cdn.example.com/issues/generic/issue.pdf",
"epub_location": "https://cdn.example.com/issues/generic/issue.epub"
}
}
}'
Beispiel für Erfolgsantwort
{
"emag": {
"id": 1001,
"created_at": "2026-01-22T12:41:00.000Z",
"updated_at": "2026-03-20T12:49:42.000Z",
"name": "Generic PDF Issue",
"released_at": "2026-07-10T12:00:00.000Z",
"preview": "Generic short description for kiosk details.",
"apple_product_identifier": "com.example.kiosk.issue_generic_pdf",
"google_product_id": "com.example.kiosk.issue_generic_pdf",
"external_id": "ISSUE-GENERIC-PDF",
"hide_preview_widgets": false,
"single_purchase_required": false,
"for_subscribers_only": false,
"cents": 199,
"currency": "EUR",
"text_mode_enabled": true,
"language": "de",
"pe_id": null,
"category_ids": [],
"import": {
"status": "finished"
},
"import_attributes": {
"import_images": true,
"pdf_location": "https://cdn.example.com/issues/generic/issue.pdf",
"xml_location": "https://cdn.example.com/issues/generic/issue.xml"
}
}
}
Beispiel für Fehlerantwort
{
"name": [
"has already been taken"
]
}
emag aktualisieren
Aktualisiert ein bestehendes emag.
Wenn neue Datei-URLs übergeben werden, werden die bestehenden Importdaten ersetzt und ein neuer Import gestartet.
Ein bestehendes emag kann per PUT nicht von PDF-Import auf EPUB-Import oder von EPUB-Import auf PDF-Import umgestellt werden.
Die Antwort gibt jetzt immer das vollständige emag-Objekt zurück.
Beispiel für minimale Aktualisierung
curl --location 'https://pegasus.pressmatrix.com/api/v2/importer/organizations/{organization_id}/publications/{publication_id}/emags/{emag_id}' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Token {TOKEN_GENERATED_BY_PMX}' \
--data '{
"emag": {
"name": "Updated Generic Issue"
}
}'
Beispiel für PDF-Reimport
curl --location 'https://pegasus.pressmatrix.com/api/v2/importer/organizations/{organization_id}/publications/{publication_id}/emags/{emag_id}' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Token {TOKEN_GENERATED_BY_PMX}' \
--data '{
"emag": {
"import_attributes": {
"import_images": false,
"pdf_location": "https://cdn.example.com/issues/generic/issue-v2.pdf",
"xml_location": "https://cdn.example.com/issues/generic/issue-v2.xml"
}
}
}'
Beispiel für Aktualisierung von EPUB-Dateien
curl --location 'https://pegasus.pressmatrix.com/api/v2/importer/organizations/{organization_id}/publications/{publication_id}/emags/{emag_id}' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Token {TOKEN_GENERATED_BY_PMX}' \
--data '{
"emag": {
"epub_import_attributes": {
"pdf_location": "https://cdn.example.com/issues/generic/issue-v2.pdf",
"epub_location": "https://cdn.example.com/issues/generic/issue-v2.epub"
}
}
}'
Beispiel für Erfolgsantwort
{
"emag": {
"id": 1001,
"created_at": "2026-01-22T12:41:00.000Z",
"updated_at": "2026-03-20T12:49:42.000Z",
"name": "Updated Generic Issue",
"released_at": "2026-07-10T12:00:00.000Z",
"preview": "Updated generic short description.",
"apple_product_identifier": "com.example.kiosk.issue_generic_pdf",
"google_product_id": "com.example.kiosk.issue_generic_pdf",
"external_id": "ISSUE-GENERIC-PDF-UPDATED",
"hide_preview_widgets": true,
"single_purchase_required": false,
"for_subscribers_only": false,
"cents": 299,
"currency": "EUR",
"text_mode_enabled": false,
"language": "de",
"pe_id": null,
"category_ids": [],
"import": {
"status": "finished"
},
"import_attributes": {
"import_images": false,
"pdf_location": "https://cdn.example.com/issues/generic/issue-v2.pdf",
"xml_location": "https://cdn.example.com/issues/generic/issue-v2.xml"
}
}
}
Beispiel für Fehlerantwort
{
"name": [
"has already been taken"
]
}
emags auflisten
Gibt eine paginierte Liste von emags zurück.
- Name
page- Type
- integer
- Description
Optionale Seitennummer.
- Name
per- Type
- integer
- Description
Optionale Anzahl von Einträgen pro Seite.
Beispiel für emags-Liste
curl --location 'https://pegasus.pressmatrix.com/api/v2/importer/organizations/{organization_id}/publications/{publication_id}/emags?page=1&per=2' \
--header 'Accept: application/json' \
--header 'Authorization: Token {TOKEN_GENERATED_BY_PMX}'
Beispielantwort
{
"emags": [
{
"id": 1001,
"created_at": "2026-01-22T12:31:54.000Z",
"updated_at": "2026-03-06T14:45:12.000Z",
"name": "Generic PDF Issue",
"released_at": "2026-01-21T00:00:00.000Z",
"preview": "Generic preview text.",
"apple_product_identifier": null,
"google_product_id": null,
"external_id": "ISSUE-001",
"hide_preview_widgets": false,
"single_purchase_required": false,
"for_subscribers_only": false,
"cents": 199,
"currency": "EUR",
"text_mode_enabled": false,
"language": "de",
"pe_id": "PUBCODE_20260121",
"category_ids": [],
"import": {
"status": "finished"
},
"import_attributes": {
"import_images": false,
"pdf_location": "https://cdn.example.com/issues/generic/issue-001.pdf",
"xml_location": null
}
},
{
"id": 1002,
"created_at": "2025-11-06T09:24:34.000Z",
"updated_at": "2026-01-21T08:23:31.000Z",
"name": "Generic EPUB Issue",
"released_at": "2025-11-30T23:00:00.000Z",
"preview": "Generic EPUB preview text.",
"apple_product_identifier": null,
"google_product_id": null,
"external_id": "ISSUE-002",
"hide_preview_widgets": false,
"single_purchase_required": false,
"for_subscribers_only": null,
"cents": 199,
"currency": "EUR",
"text_mode_enabled": true,
"language": "de",
"pe_id": null,
"category_ids": [],
"import": {
"ai_status": "processing"
},
"epub_import_attributes": {
"import_articles": true,
"import_images": true,
"pdf_location": "https://cdn.example.com/issues/generic/issue-002.pdf",
"epub_location": "https://cdn.example.com/issues/generic/issue-002.epub"
}
}
],
"current_page": 1,
"total_pages": 12,
"total_count": 24,
"per_page": 2,
"next_page": 2,
"prev_page": null
}
Einzelnes emag abrufen
Gibt ein einzelnes emag anhand seiner ID zurück.
Beispiel für einzelnes emag
curl --location 'https://pegasus.pressmatrix.com/api/v2/importer/organizations/{organization_id}/publications/{publication_id}/emags/{emag_id}' \
--header 'Accept: application/json' \
--header 'Authorization: Token {TOKEN_GENERATED_BY_PMX}'
Beispielantwort
{
"emag": {
"id": 1001,
"created_at": "2026-01-22T12:41:00.000Z",
"updated_at": "2026-03-20T12:49:42.000Z",
"name": "Generic PDF Issue",
"released_at": "2026-07-10T12:00:00.000Z",
"preview": "Generic short description for kiosk details.",
"apple_product_identifier": "com.example.kiosk.issue_generic_pdf",
"google_product_id": "com.example.kiosk.issue_generic_pdf",
"external_id": "ISSUE-GENERIC-PDF",
"hide_preview_widgets": false,
"single_purchase_required": false,
"for_subscribers_only": false,
"cents": 199,
"currency": "EUR",
"text_mode_enabled": true,
"language": "de",
"pe_id": null,
"category_ids": [],
"import": {
"status": "finished"
},
"import_attributes": {
"import_images": true,
"pdf_location": "https://cdn.example.com/issues/generic/issue.pdf",
"xml_location": "https://cdn.example.com/issues/generic/issue.xml"
}
}
}
emag löschen
Löscht ein emag.
Bei Erfolg gibt die API 204 No Content zurück.
Wenn das emag nicht existiert, gibt die API 404 Not Found zurück.
Beispiel für Löschen eines emags
curl --location --request DELETE 'https://pegasus.pressmatrix.com/api/v2/importer/organizations/{organization_id}/publications/{publication_id}/emags/{emag_id}' \
--header 'Authorization: Token {TOKEN_GENERATED_BY_PMX}'
Erfolgsantwort
HTTP/1.1 204 No Content
Nicht-gefunden-Antwort
HTTP/1.1 404 Not Found
Geplante emags auflisten
Gibt eine paginierte Liste geplanter emags zurück.
- Name
page- Type
- integer
- Description
Optionale Seitennummer.
- Name
per- Type
- integer
- Description
Optionale Anzahl von Einträgen pro Seite.
Beispiel für Liste geplanter emags
curl --location 'https://pegasus.pressmatrix.com/api/v2/importer/organizations/{organization_id}/publications/{publication_id}/planned_emags?page=1&per=2' \
--header 'Accept: application/json' \
--header 'Authorization: Token {TOKEN_GENERATED_BY_PMX}'
Beispielantwort
{
"planned_emags": [
{
"id": 2001,
"publication_id": 3001,
"emag_id": null,
"name": "Generic Planned Slot 1",
"release_date": "2026-03-15T11:40:00.000Z",
"pubcode": "PUBCODE",
"status": "planned",
"pe_id": "PUBCODE_20260315"
},
{
"id": 2002,
"publication_id": 3001,
"emag_id": 1001,
"name": "Generic Planned Slot 2",
"release_date": "2026-03-01T07:40:00.000Z",
"pubcode": "PUBCODE",
"status": "transferred",
"pe_id": "PUBCODE_20260301"
}
],
"current_page": 1,
"total_pages": 5,
"total_count": 10,
"per_page": 2,
"next_page": 2,
"prev_page": null
}
Einzelnes geplantes emag abrufen
Gibt ein einzelnes geplantes emag anhand seiner ID zurück.
Beispiel für einzelnes geplantes emag
curl --location 'https://pegasus.pressmatrix.com/api/v2/importer/organizations/{organization_id}/publications/{publication_id}/planned_emags/{planned_emag_id}' \
--header 'Accept: application/json' \
--header 'Authorization: Token {TOKEN_GENERATED_BY_PMX}'
Beispielantwort
{
"planned_emag": {
"id": 2001,
"publication_id": 3001,
"emag_id": null,
"name": "Generic Planned Slot 1",
"release_date": "2026-03-15T11:40:00.000Z",
"pubcode": "PUBCODE",
"status": "planned",
"pe_id": "PUBCODE_20260315"
}
}