Joomag API 2.0 Documentation

Magazines

Get Magazine List

Returns list of magazines under your account.

GET /api/2.0/magazines

Example:

Get all magazines of your account.

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

Response:

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

List Magazine Issues

Returns list of issues of the requested magazine.

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

Example:

Get all issues of the 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" );

Response:

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

Get Magazine Details

Returns properties of the requested magazine.

GET /api/2.0/magazines/<id>

Example:

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

Response:

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

Create Magazine

Creates magazine with given title and description.

POST /api/2.0/magazines
Parameter Type Explanation
title string Title of the magazine
description string Description of the magazine

Example:

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

Response:

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

Enable Subscription

Enable subscription of the requested magazine.

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

Example:

Enable free subscription of the 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" );

Response:

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

Delete Magazine

Deletes the requested magazine with all issues.

DELETE /api/2.0/magazines/<id>
Parameter Type Explanation
confirm string Should have the following value: I do realize I want to delete an entire magazine with all issues
confirm2 string Should have the following value: I also realize that I will not have it back
confirm3 string Should have the following value: and I will not contact customer support asking to bring it back

Example:

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

Response:

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

Disable Subscription

Disable subscription of the requested magazine.

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

Example:

Disable subscription of the 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" );

Response:

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

Update magazine details

Updates properties of the requested magazine.

PUT /api/2.0/magazines/<id>
Parameter Type Explanation
title string Title of the magazine
description string Description of the magazine
adult_content bool Boolean flag to indicate whether the magazine contains adult content, should have value of either no or yes
lang string Language ID of the magazine, a constant from Languages list
type int Type of the magazine, a constant from Magazine Types list
cat int Category of the magazine, a constant from Magazine Categories List

Example:

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

Response:

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