Joomag API 2.0 Documentation

Getting started

Integrate your Website or APP with Joomag using our simple REST API. Using our API you can make simple calls to create magazines, embed them in your website, deliver subscriptions and much more.
We’ve tried to make the sign-up and on-boarding process as intuitive as possible. However, there are a few things to mention.

Where is API/Secret key?

You can find your API and Secret keys in the API section of Account Settings page

Authentication

Joomag API calls should contain HTTP request header key with value of your account API key for authentication.

Example:

$headers = array(
	'key:' . 'api_ValueOfMyJoomagAPIKey',
	// other headers...
);

$ch = curl_init();
// other curl options...
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

Signing API calls

Some API calls require to be signed by your account secret key. These calls should contain a HTTP request header sig with value of call signature. To create a signature for a message the following steps should be taken

  • Sort all parameters of the call by field name in alphabetical order.
  • Create a parameter string by concatenating parameter values.
  • Concatenate HTTP method, request URI and parameter string.
  • Calculate a signature value using HMAC with SHA256 algorithm on the resulted string and using your account secret key for key value.

Example:

$method = "POST";
$url = "http://www.joomag.com/api/2.0/magazines";
$params = array('title'=>'My New Magazine', 'description'=>'New Magazine Description');

ksort($params);

$paramsStr = implode($params);
$sig = hash_hmac('sha256', $method . $url . $paramsStr, 'sec_mysecretkey');

$headers = array(
	'key:' . 'api_ValueOfMyJoomagAPIKey',
	'sig:' . $sig,
	// other headers...
);

$ch = curl_init();
// other curl options...
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);