English Français Español
ex. : internet calameo download

API.fetchAccountBooks

This action allows you to recover the information about an account.

Request

api_key Use your API key
login Use the e-mail address of an account profile that has access to the APIs.
md5_pwd Use the password from the profile, encrypted in MD5 format.
account_id (optional)

ID of the account you wish to recover the information from.
If left blank, your account will be used.

order (optional)
String of characters used to define the organization criteria of the publications. The possible values are:
  • Name: Title of the publication
  • Pages: Number of pages of the publication
  • Comments: Number of comments on the publication
  • Views: Number of times the publication was read
  • Date: Date of publication
  • Creation: Date of creation
Modification: Date the publication was modified~
way (optional)
String of characters used to define the sort order. The possible values are:
  • UP: Sort by ascending order
  • DOWN: Sort by descending order
start (optional)
Start position of the range of publications sent.
step (optional) Number of publications to be sent from the start position.

Response

This request sends a table containing the requested publications with the following information:

Code Unique identifying key for the publication.
Name Title of the publication.
Description Description of the publication.
IsPrivate Sends 1 if the publication is private and 0 if not.
AllowMini Sends 1 if the publication allows access to the miniCalaméo and 0 if not.
Pages Number of pages of the publication.
Width Width of a page of the publication.
Height Height of a page of the publication.
Date Date of citation of the publication.
Creation Date of creation of the publication
Modification Date of the last modification of the publication.
PictureUrl Absolute URL for the publication’s cover
ThumbUrl Absolute URL for the publication’s thumbnail.
PublicUrl Absolute URL for the publication’s overview.
ViewUrl Absolute URL for the publication’s reading page.
CommentsUrl Absolute URL for the publication’s comments.

 

An error message is sent back in case of problems.

Example

This example shows how to get the 10 most viewed publications of an account:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Mes publications les plus lues</title>
</head>

<body>
<?php

    include_once('nusoap.php');
    
    $client = new soapclient('http://api.calameo.com/?wsdl', true);

    $err = $client->getError();
	
    if ($err) {
       // Affiche les erreurs
       echo 'SOAP Error: ' . $err;
       // Si une erreur se produit, il est donc inutile de continuer
       die('Une erreur est survenue !');
    }

    $message = 'API.fetchAccountBooks';

    $params = array (
		    'api_key'		=> '123346544abdefbca1546854',
		    'login'		=> 'email@moncompte.com',
		    'md5_pwd'		=> 'd4f7ccab36fbfedc5f53e09d20d6973a',
		    'account_id'	=> '98765',
		    'order'		=> 'Views',
		    'way'		=> 'DOWN',
		    'start'		=> 0,
		    'step'		=> 10
		    );

    $result = $client->call($message, $params);

    if ($client->fault) {
        // Une erreur est survenue
        die('Une erreur est survenue !');
    } else {
        // Vérifie si une erreur SOAP n'a pas été renvoyée
        $err = $client->getError();
        if ($err) {
            // Affiche l'erreur
	    echo 'SOAP Error: ' . $err ;
        } else {
	    // Tout s'est bien passé, vous pouvez traiter le résultat => $result
            echo '<ol>';
            foreach ( $result as $book ) {
                echo '<li>';
                echo '<a href="' . $book['PublicUrl'] . '">';
                echo $book['Name'];
                echo '</a>';
                echo '</li>';
            }
            echo '</ol>';
        }
    }

?>
</body>
</html>