Joomag API 2.0 Documentation

Issues

Create Issue from PDF

Creates magazine issue from PDF file.

POST /api/2.0/magazines/<id>
Parameter Type Explanation
pdf file PDF file to create magazine issue from
volume string Volume of the issue to be created
description string Description of the issue to be created
keywords string comma separated list of keywords to be associated with the issue
category int Category of the issue, a constant from Magazine Categories List
allow_print bool Boolean flag to indicate whether the issue should be printable, should have value of either no or yes
allow_download bool Boolean flag to indicate whether the issue should be downloadable, should have value of either no or yes
privacy string The Privacy level or the issue, it could be private or unlisted

Example:

# Include the API wrapper class
require "JoomagREST.php";

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

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

# Path to the PDF file
$pdf = __DIR__ . "/magazine.pdf";

# Make the call to the client.
$result = $jmClient->createIssueFromPDF( $magazineID, $pdf, array(
    "volume" => "Jul 2014",
    "description" => "Magazine description goes here...",
    "keywords" => "Comma,separated,keywords",
    "category" => 1,
    "allow_print" => 'yes',
    "allow_download" => 'no'
));

Response:

issueTempID is a temporary ID during converting PDF to Joomag Issue

{
  "error": 0,
  "message": "OK",
  "data": {
    "issueTempID": "1d6bb45be5cf7e3778985467bea009c4"
  }
}

Get Issue Converting Status

Returns current stage of convering from PDF to Joomag Issue.

GET /api/2.0/magazines/<id>/issues/<issueTempID>/status
GET /api/2.0/issues/<issueTempID>/status
Parameter Type Explanation
issueTempID string This is a temporary ID during converting PDF to Joomag Issue. Use issueTempID from createIssuePDF response.

Example:

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

Response:

{
  "error": 0,
  "message": "OK",
  "data": [
    {
      "status": "ready",
      "ID": "0806746001433247707",
      "url": "http://www.joomag.com/magazine/mag/0806746001433247707",
      "cover": "https://s1.joomag.net/res_mag/3/3222/3222314/287017/thumbs/6637753.jpg?1433247710",
      "pages_count": 2
    }
  ]
}

Get issue details

Returns properties of the requested issue.

GET /api/2.0/magazines/<id>/issues/<id>
GET /api/2.0/issues/<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 issue
$issueID = "0980693001409324380";

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

Response:

{
  "error": 0,
  "message": "OK",
  "data": {
    "ID": "0980693001409324380",
    "title": "Cars Magazine Pro Jul 2014",
    "volume": "Jul 2014",
    "description": "Magazine description goes here...",
    "language": "es",
    "type": 1,
    "category": 8,
    "secondary_category": null,
    "is_published": true,
    "privacy": "private",
    "creation_date": "2014-08-29 09:59:40",
    "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\/316952\/thumbs\/7463808.jpg",
    "mobile_support": true,
    "allow_download": false,
    "allow_print": false,
    "tags": ["keywords", "comma", "separated"]
  }
}

Get Embed Code

Get HTML embed code of the requested magazine issue.

GET /api/2.0/magazines/<id>/issues/<id>/embed-code
POST /api/2.0/issues/<id>/embed-code
Parameter Type Explanation
width int Width of issue embed. Can be either in percents (example: 100%) or in pixels (example: 500px).
height int Height of issue embed. Can be either in percents (example: 100%) or in pixels (example: 500px).
start_page int Page number from which the embed should be opened.
auto_flip int Duration of page auto-fipping in seconds. Omit to disable auto-fliping.
background_color string Background color of embed. Hexidecimal RGB of the color (example: e2e2d1)

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 issue
$issueID = "0980693001409324380";

# Make the call to the client.
$result = $jmClient->get("issues/$issueID/embed-code", array(
    'width' => 800,
    'height' => 600,
    'start_page' => 2,
    'auto_flip' => 5,
    'background_color' => '567147'
));

Response:

{
  "error": 0,
  "message": "OK",
  "data": {
    "embed_code": "<iframe name=\"Joomag_embed_47ccbf7a-6e78-4755-9920-53d568472b51\" style=\"width:800px;height:600px\" width=\"800px\" height=\"600px\" hspace=\"0\" vspace=\"0\" frameborder=\"0\" src=\"http:\/\/www.joomag.com\/magazine\/paid-test-clone-\/0827766001386622771?p=2&amp;e=1&amp;autoFlipDelay=5&amp;embedInfo=;solid,567147\"><\/iframe>"
  }
}

Delete Issue

Deletes the requested magazine issue.

DELETE /api/2.0/magazines/<id>/issues/<id>
DELETE /api/2.0/issues/<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 issue
$issueID = "0727865001409319307";

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

Response:

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

Update issue details

Updates properties of the requested magazine issue.

PUT /api/2.0/magazines/<id>/issues/<id>
PUT /api/2.0/issues/<id>
Parameter Type Explanation
volume string Volume of the issue
description string Description of the issue
secondary_category int Secondary category of the issue, a constant from Magazine Categories List
adult_content bool Boolean flag to indicate whether the issue contains adult content, should have value of either no or yes
allow_print bool
allow_download bool

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 issue
$issueID = "0980693001409324380";

# Make the call to the client.
$result = $jmClient->updateIssue( $issueID, array(
    'volume' => 'Aug 2014',
    'description' => 'The newest issue',
    'adult_content' => 'yes',
    'allow_print' => 'yes',
    'allow_download' => 'yes'
));

Response:

{
  "error": 0,
  "message": "OK",
  "data": {
    "ID": "0980693001409324380",
    "title": "Cars Magazine Pro Jul 2014",
    "volume": "Aug 2014",
    "description": "The newest issue",
    "language": "es",
    "type": 1,
    "category": 8,
    "secondary_category": null,
    "price": 0,
    "privacy": "unlisted",
    "creation_date": "2014-08-29 09:59:40",
    "page_height": 841,
    "page_width": 595,
    "preview_pages": null,
    "adult_content": true,
    "pages_count": 6,
    "cover": "http:\/\/s1.joomag.com\/res_mag\/0\/178\/178119\/316952\/thumbs\/7463808.jpg",
    "mobile_support": true,
    "allow_download": true,
    "allow_print": true,
    "tags": ["keywords", "comma", "separated"]
  }
}

Publish issue

Publishes the requested magazine issue.

PUT /api/2.0/issues/<id>/publish-state
Parameter Type Explanation
privacy string The Privacy level or the issue, it could be private or unlisted

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 issue
$issueID = "0649338001409248394";

# Make the call to the client.
$result = $jmClient->publishIssue( $issueID, 'unlisted' );

Response:

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

Unpublish Issue

Un-publishes the requested magazine issue.

DELETE /api/2.0/issues/<id>/publish-state

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 issue
$issueID = "0727865001409319307";

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

Response:

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

Check Publish state

Checks whether issue is published or not.

GET /api/2.0/issues/<id>/publish-state

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 issue
$issueID = "0727865001409319307";

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

Response:

{
  "error": 0,
  "message": "OK",
  "data": {
    "is_published": true
  }
}