Documentation de l'API Joomag 2.0

Magazines

Obtenir la liste des magazines

Retourne la liste des magazines sous votre compte.

GET /api/2.0/magazines

Exemple:

Obtenez tous les magazines de votre compte.

# 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();

Réponse:

{
  "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"
    }
  ]
}

Répertorier les numéros du magazine

Renvoie une liste des numéros du magazine demandé.

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

Exemple:

Obtenez tous les numéros du magazine

# 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" );

Réponse:

{
  "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"]
    }
  ]
}

Obtenir des détails du magazine

Retourne les propriétés du magazine demandé.

GET /api/2.0/magazines/<id>

Exemple:

# 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 );

Réponse:

{
  "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"
  }
}

Créer un magazine

Crée un magazine avec le titre et la description attribués.

POST /api/2.0/magazines
Paramètre Type Explication
title séquence Titre du magazine
description séquence Description du magazine

Exemple:

# 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 );

Réponse:

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

Activer l'abonnement

Activer l'abonnement du magazine demandé.

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

Exemple:

Activer l'abonnement gratuit au magazine.

# 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" );

Réponse:

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

Supprimer le magazine

Supprime le magazine demandé avec tous les numéros.

DELETE /api/2.0/magazines/<id>
Paramètre Type Explication
confirm séquence Doit être de la valeur suivante : Je suis bien conscient(e) que je veux effacer l'intégralité du magazine avec toutes ses publications
confirm2 séquence La valeur doit être : Je me rends également compte que je ne pourrais pas le récupérer.
confirm3 séquence Doit avoir la valeur suivante : et je ne contacterai pas le service client pour demander à le retourner

Exemple:

# 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'
);

Réponse:

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

Désactiver l'abonnement

Désactiver l'abonnement pour le magazine demandé.

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

Exemple:

Désactiver l'abonnement au magazine

# 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" );

Réponse:

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

Mettre à jour les détails du magazine

Met à jour les propriétés du magazine demandé.

PUT /api/2.0/magazines/<id>
Paramètre Type Explication
title séquence Titre du magazine
description séquence Description du magazine
adult_content booléen Le paramètre booléen qui permet d'indiquer si le magazine contient ou non du contenu pour adultes doit avoir pour valeur no ou yes
lang séquence Code de la langue du magazine, une constante à partir de la liste des langues
type int Type du magazine, une constante de la Liste des types de magazines
cat int Catégorie du magazine, une constante de la Liste des catégories de magazines

Exemple:

# 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,
));

Réponse:

{
  "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"
  }
}