Joomag API 2.0 Dokumentation

Magazine

Magazin-Liste abrufen

Gibt eine Liste aller Magazine Ihres Kontos zurück.

GET /api/2.0/magazines

Beispiel:

Ruft eine Liste aller Magazine in Ihrem Konto ab.

# Include the API wrapper class (see "Libraries" for instructions)
require 'JoomagREST.php';

# Instantiate the client.
$jmClient = new JoomagREST(
    'api_de81b9eb3ff797796edc0cd00020b6c8',
    'sec_e8ff4e7e74c64fcfd63dcf728040ba3e5b29aa398e5cc1cb414011661c75fd19'
);

# Make the call to the client.
$result = $jmClient->getMagazinesList();

Antwort:

{
  "error": 0,
  "message": "OK",
  "data": [
    {
      "ID": "M0250759001409245540",
      "title": "Cars Magazine Pro",
      "description": "Cars Magazine Pro",
      "language": "es",
      "type": 1,
      "category": 8,
      "adult_content": true,
      "subscription_status": "disabled"
    },
    {
      "ID": "M0863068001409245778",
      "title": "Health & Fitness",
      "description": "",
      "language": "en",
      "type": 1,
      "category": null,
      "adult_content": false,
      "subscription_status": "paid",
      "price": 24.99,
      "issue_price": 1.99,
      "preview_pages": "2-6"
    },
    {
      "ID": "M0166830001409317679",
      "title": "IT Mag",
      "description": "",
      "language": "en",
      "type": 1,
      "category": 186,
      "adult_content": false,
      "subscription_status": "free",
      "subscribe_popup": "auto_open"
    }
  ]
}

Listet Magazin Ausgaben auf

Gibt eine Liste mit den Ausgaben des angeforderten Magazins zurück.

GET /api/2.0/magazines/<id>/issues

Beispiel:

Alle Ausgaben des Magazins anfordern

# Include the API wrapper class (see "Libraries" for instructions)
require 'JoomagREST.php';

# Instantiate the client.
$jmClient = new JoomagREST(
    'api_de81b9eb3ff797796edc0cd00020b6c8',
    'sec_e8ff4e7e74c64fcfd63dcf728040ba3e5b29aa398e5cc1cb414011661c75fd19'
);

# ID of the magazine
$magazineID = 'M0250759001409245540';

# Make the call to the client.
$result = $jmClient->get( "magazines/$magazineID/issues" );

Antwort:

{
  "error": 0,
  "message": "OK",
  "data": [
    {
      "ID": "0727865001409319307",
      "title": "Cars Magazine Pro Aug 2014",
      "volume": "Aug 2014",
      "description": "",
      "language": "es",
      "type": 1,
      "category": 8,
      "category2": null,
      "price": 0,
      "privacy_level": "private",
      "creation_date": "2014-08-29 08:35:07",
      "page_height": 841,
      "page_width": 595,
      "preview_pages": null,
      "adult_content": false,
      "pages_count": 16,
      "cover": "http:\/\/s1.joomag.com\/res_mag\/0\/178\/178119\/316889\/thumbs\/7461943.jpg",
      "mobile_support": false,
      "allow_download": false,
      "allow_print": false,
      "tags": ["luxury", "retro", "exclusive"]
    },
    {
      "ID": "0649338001409248394",
      "title": "Cars Magazine Pro Jun 2014",
      "volume": "Jun 2014",
      "description": "",
      "language": "en",
      "type": 1,
      "category": null,
      "category2": 189,
      "price": 0,
      "privacy_level": "public",
      "creation_date": "2014-08-28 12:53:14",
      "page_height": 841,
      "page_width": 595,
      "preview_pages": null,
      "adult_content": false,
      "pages_count": 6,
      "cover": "http:\/\/s1.joomag.com\/res_mag\/0\/178\/178119\/316381\/thumbs\/7448638.jpg",
      "mobile_support": false,
      "allow_download": true,
      "allow_print": true,
      "tags": ["cars", "bmw", "4x4"]
    }
  ]
}

Magazindetails anfordern

Gibt Eigenschaften des angeforderten Magazins zurück.

GET /api/2.0/magazines/<id>

Beispiel:

# Include the API wrapper class (see "Libraries" for instructions)
require 'JoomagREST.php';

# Instantiate the client.
$jmClient = new JoomagREST(
    'api_de81b9eb3ff797796edc0cd00020b6c8',
    'sec_e8ff4e7e74c64fcfd63dcf728040ba3e5b29aa398e5cc1cb414011661c75fd19'
);

# ID of the magazine
$magazineID = 'M0250759001409245540';

# Make the call to the client.
$result = $jmClient->getMagazineDetails( $magazineID );

Antwort:

{
  "error": 0,
  "message": "OK",
  "data": {
    "ID": "M0250759001409245540",
    "title": "Cars Magazine Pro",
    "description": "Cars Magazine Pro",
    "language": "es",
    "type": 1,
    "category": 8,
    "adult_content": true,
    "subscription_status": "disabled"
  }
}

Magazin erstellen

Erstellt Magazin mit gegebem Titel und vorhandener Beschreibung

POST /api/2.0/magazines
Parameter Typ Erklärung
title string Magazintitel
description string Magazinbeschreibung

Beispiel:

# Include the API wrapper class (see "Libraries" for instructions)
require 'JoomagREST.php';

# Instantiate the client.
$jmClient = new JoomagREST(
    'api_de81b9eb3ff797796edc0cd00020b6c8',
    'sec_e8ff4e7e74c64fcfd63dcf728040ba3e5b29aa398e5cc1cb414011661c75fd19'
);

$title = 'Cars Magazine';
$description = '';

# Make the call to the client.
$result = $jmClient->createMagazine( $title, $description );

Antwort:

{
  "error": 0,
  "message": "OK",
  "data": {
    "ID": "M0331611001409321232",
    "title": "Cars Magazine",
    "description": "",
    "language": "en",
    "type": 1,
    "category": null,
    "adult_content": false,
    "subscription_status": "disabled"
  }
}

Abonnement zulassen

Abonnement des angeforderten Magazins zulassen

POST /api/2.0/magazines/<id>/subscription

Beispiel:

Kostenloses Abonnement des Magazins zulassen

# Include the API wrapper class (see "Libraries" for instructions)
require 'JoomagREST.php';

# Instantiate the client.
$jmClient = new JoomagREST(
    'api_de81b9eb3ff797796edc0cd00020b6c8',
    'sec_e8ff4e7e74c64fcfd63dcf728040ba3e5b29aa398e5cc1cb414011661c75fd19'
);

# ID of the magazine
$magazineID = "M0250759001409245540";

# Make the call to the client.
$result = $jmClient->post( "magazines/$magazineID/subscription" );

Antwort:

{
  "error": 0,
  "message": "OK",
  "data": []
}

Magazin löschen

Löscht das angeforderte Magazin mit all seinen Ausgaben.

DELETE /api/2.0/magazines/<id>
Parameter Typ Erklärung
confirm string Muss den folgenden Wert haben: Ich bin mir dessen bewusst, dass ich ein ganzes Magazin, mitsamt all seinen Ausgaben, löschen möchte
confirm2 string Muss den folgenden Wert haben: Mir ist auch klar, dass dies nicht Rückgängig gemacht werden kann
confirm3 string Muss den folgenden Wert haben: und ich werde außerdem nicht den Kundensupport kontaktieren um es wiederherzustellen.

Beispiel:

# Include the API wrapper class (see "Libraries" for instructions)
require 'JoomagREST.php';

# Instantiate the client.
$jmClient = new JoomagREST(
    'api_de81b9eb3ff797796edc0cd00020b6c8',
    'sec_e8ff4e7e74c64fcfd63dcf728040ba3e5b29aa398e5cc1cb414011661c75fd19'
);

# ID of the magazine
$magazineID = 'M0863068001409245778';

# Make the call to the client.
$result = $jmClient->deleteMagazine( $magazineID,
    'I do realize I want to delete an entire magazine with all issues',
    'I also realize that I will not have it back',
    'and I will not contact customer support asking to bring it back'
);

Antwort:

{
  "error": 0,
  "message": "OK",
  "data": []
}

Abonnement nicht zulassen

Abonnement des angeforderten Magazins nicht zulassen.

DELETE /api/2.0/magazines/<id>/subscription

Beispiel:

Abonnement des Magazins nicht zulassen.

# Include the API wrapper class (see "Libraries" for instructions)
require 'JoomagREST.php';

# Instantiate the client.
$jmClient = new JoomagREST(
    'api_de81b9eb3ff797796edc0cd00020b6c8',
    'sec_e8ff4e7e74c64fcfd63dcf728040ba3e5b29aa398e5cc1cb414011661c75fd19'
);

# ID of the magazine
$magazineID = "M0250759001409245540";

# Make the call to the client.
$result = $jmClient->delete( "magazines/$magazineID/subscription" );

Antwort:

{
  "error": 0,
  "message": "OK",
  "data": []
}

Magazindetails aktualisieren

Eigenschaften des angeforderten Magazins aktualisieren

PUT /api/2.0/magazines/<id>
Parameter Typ Erklärung
title string Titel des Magazins
description string Beschreibung des Magazins
adult_content bool Boolean Flag um anzugeben ob ein Magazin Erwachseneninhalte enthält, der Wert muss entweder no oder yes sein.
lang string Language ID des Magazins, eine Konstante der Languages list
type int Typ des Magazins, eine Konstante der Magazine Types list
cat int Kategorie des Magazins, eine Konstante der Magazine Categories List

Beispiel:

# Include the API wrapper class (see "Libraries" for instructions)
require 'JoomagREST.php';

# Instantiate the client.
$jmClient = new JoomagREST(
    'api_de81b9eb3ff797796edc0cd00020b6c8',
    'sec_e8ff4e7e74c64fcfd63dcf728040ba3e5b29aa398e5cc1cb414011661c75fd19'
);

# ID of the magazine
$magazineID = 'M0250759001409245540';

# Make the call to the client.
$result = $jmClient->updateMagazine( $magazineID, array(
    "title" => "Cars Magazine Pro",
    "description" => "Cars Magazine Pro",
    "adult_content" => 'yes',
    "lang" => 'es',
    "category" => JoomagREST::CAT_AUTOMOTIVE,
));

Antwort:

{
  "error": 0,
  "message": "OK",
  "data": {
    "ID": "M0250759001409245540",
    "title": "Cars Magazine Pro",
    "description": "Cars Magazine Pro",
    "language": "es",
    "type": 1,
    "category": 8,
    "adult_content": true,
    "subscription_status": "disabled"
  }
}