Hi,
I have used the following code try to api_upload api:
use strict;
use LWP::UserAgent;
use Digest::MD5;
use XML::Simple;
use Data::Dumper;
my $issuu_upload_url = 'http://upload.issuu.com/1_0';
my @pdfs = ("calendarinstructions4editors.pdf",
"CreatingaPhotoShopDroplet.pdf");
foreach my $pdf_to_do (@pdfs) {
my %issuu_params = (
apiKey => 'my api key',
action => 'issuu.document.url_upload',
slurpUrl => 'http://webpapersadmin.bpnewmedia.com/
downloads/' . $pdf_to_do,
title => 'title',
tags => 'tags',
commentsAllowed => 'false',
description => 'description',
downloadable => 'false',
infoLink => 'infolink',
language => 'en',
access => 'private',
category => '000000',
type => '007000',
ratingsAllowed => 'false',
format => 'xml',
folderIds => '5ff2def9-d39f-4202-9dd8-8ae1363b1c80',
);
my $sig_string = 'my secret str';
foreach my $isu (sort keys %issuu_params) {
$sig_string .= $isu . $issuu_params{$isu};
}
my $ua = LWP::UserAgent->new;
my $xs = XML::Simple->new();
my $md5 = Digest::MD5->new;
$md5->add($sig_string);
$issuu_params{'signature'} = $md5->hexdigest;
my $upload_xml_res = $ua->post($issuu_upload_url, \
%issuu_params);
my $upload_xml = $xs->XMLin($upload_xml_res->content);
print "Issuu Response " . $upload_xml_res->content;
}
And I got the following reponce:
<html>
<head><title>400 Bad Request</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<hr><center>nginx/0.6.36</center>
</body>
</html>
Any idea what the problem is?
Thank you very much.