Documentación API Joomag 2.0

Revistas

Obtenga Lista de Revista

Recupere lista de las revistas en su cuenta.

GET /api/2.0/magazines

Ejemplo:

Obtenga todas las revistas de su cuenta.

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

Respuesta:

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

Lista de Ediciones de la Revista

Devuelva la lista de ediciones de la revista solicitada.

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

Ejemplo:

Obtenga todas las ediciones de la revista

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

Respuesta:

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

Obtenga los Detalles de la Revista

Devuelva las propiedades de la revista solicitada.

GET /api/2.0/magazines/<id>

Ejemplo:

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

Respuesta:

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

Crear Revista

Crear revista con el título y la descripción dados.

POST /api/2.0/magazines
Parámetro Tipo Explicación
title cadena Título de la revista
description cadena Descripción de la revista

Ejemplo:

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

Respuesta:

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

Activar Suscripción

Activar suscripción de la revista solicitada.

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

Ejemplo:

Activar suscripción gratuita de la revista.

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

Respuesta:

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

Borrar Revista

Elimine la revista solicitada con todas las ediciones.

DELETE /api/2.0/magazines/<id>
Parámetro Tipo Explicación
confirm cadena Debe tener el siguiente valor: Soy consciente de que quiero eliminar toda la revista con todas las ediciones
confirm2 cadena Debe tener el siguiente valor: También soy consciente de que no podré recuperarla.
confirm3 cadena Debe tener el siguiente valor: y no contactaré con el servicio de ayuda al consumidor para pedir que me la devuelvan.

Ejemplo:

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

Respuesta:

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

Anular Suscripción

Anular suscripción de la revista solicitada.

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

Ejemplo:

Anular suscripción de la revista.

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

Respuesta:

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

Actualice detalles de la revista

Actualice las propiedades de la revista solicitada.

PUT /api/2.0/magazines/<id>
Parámetro Tipo Explicación
title cadena Título de la revista
description cadena Descripción de la revista
adult_content bool Bandera booleana para indicar si la revista contiene contenido para adultos, debe tener un valor de no o yes
lang cadena Identificación de Idioma de la revista, una constante de Lista de Idiomas
type int Tipo de la revista, una constante de Lista de Tipos de Revista
cat int Categoría de la revista, una constante de Lista de Categorías de la Revista

Ejemplo:

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

Respuesta:

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