Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
I got "400 Bad Request" error when I try to use api_upload api
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post will appear after it is approved by moderators
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
John Ma  
View profile  
 More options Feb 8 2012, 7:22 pm
From: John Ma <johnjia...@gmail.com>
Date: Wed, 8 Feb 2012 16:22:34 -0800 (PST)
Local: Wed, Feb 8 2012 7:22 pm
Subject: I got "400 Bad Request" error when I try to use api_upload api
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.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions Older topic »