PHP Class Library Returning "Unauthorized"

8 views
Skip to first unread message

Dan DeLuca

unread,
Oct 10, 2009, 1:07:50 PM10/10/09
to Scribd Platform Talk
So I am trying to implement Scribd in my php site. Starting with
something simple like loading a document from a URL into Scribd
returns Unauthorized even though I am sending my API key and secret
key. Here is a snippet of the relevant code;


$scribd_api_key = "sec-somestuff";
$scribd_secret = "reallysecret";

$scribd = new Scribd($scribd_api_key, $scribd_secret);
$url = 'http://www.classchatterlive.com/scibd/
821dcaf7d82de3beb89b24992591b5d7.doc';
$doc_type = null;
$access = "public";
$rev_id = null; // By using a id stored in a database, you can update
an existing document without creating a new one

$data = $scribd->uploadFromUrl($url, $doc_type, $access, $rev_id); //
returns Array ( [doc_id] => 1021237 [access_key] => key-
dogbmich9x5iu09kiki )

Here is what I get back:

Fatal error: Uncaught exception 'Exception' with message
'Unauthorized' in /var/www/vhosts/classchatterlive.com/httpdocs/
scribd.php:219 Stack trace: #0 /var/www/vhosts/classchatterlive.com/
httpdocs/scribd.php(54): Scribd->postRequest('docs.uploadFrom...',
Array) #1 /var/www/vhosts/classchatterlive.com/httpdocs/scib.php(74):
Scribd->uploadFromUrl('http://www.clas...', NULL, 'public', NULL) #2
{main} thrown in /var/www/vhosts/classchatterlive.com/httpdocs/
scribd.php on line 219

Do I somehow have to activate my API account?? Can suggestions I am
sorta at a wall here.

Thanks!!

Dan

Dan DeLuca

unread,
Oct 10, 2009, 1:14:22 PM10/10/09
to Scribd Platform Talk
I am sorry to clog the board. I inverted the keys!!
Reply all
Reply to author
Forward
0 new messages