Invalid API key
dwagner
Registered Users Posts: 3 Beginner grinner
I am having issues with the smugmug.albums.getInfo and the smugmug.logout methods in both 1.1.1 and 1.2.0 of the REST API. They both return code 18: invalid API key.
However, smugmug.albums.get works just fine. They are all using the same global variable containing the same API key.
Any ideas?
However, smugmug.albums.get works just fine. They are all using the same global variable containing the same API key.
Any ideas?
0
Comments
I have just verified both methods work fine for me. Can you please recheck these issues.
We pushed a new version of the API tonight, the smugmug.logout issue was fixed.
Did these issues just start occuring ?
Thanks,
David
SmugMug API Developer
My Photos
Here are snippets of my code (perl code):
This returns the expected XML response: This returns an Invalid API Key XML response: Both are done after a succesful call to smugmug.login.withPassword. $apikey is a global variable. I've tested this with the 1.2.0 API as well.
However, smugmug.logout with REST 1.2.0 should be working, here's some debug output from my perl test framework I am developing...
# INFO: smugmug.logout (REST 1.2.0)
# call => smugmug.login.withPassword (EmailAddress => 'api-power', Password => 'removed<removed password="">', APIKey => '</removed>removed<removed password="">'<removed api="" key="">)
{
AccountType => "Power",
PasswordHash => "removed<removed passwordhash="">",
SessionID => "<removed session=""></removed></removed></removed></removed>removed<removed password=""><removed api="" key=""><removed passwordhash=""><removed session="">",
UserID => 140089,
}
#
# call => smugmug.logout (SessionID => '<removed session=""></removed></removed></removed></removed></removed>removed<removed password=""><removed api="" key=""><removed passwordhash=""><removed session=""><removed session="">', APIKey => '<removed api="" key=""></removed></removed></removed></removed></removed></removed>removed<removed password=""><removed api="" key=""><removed passwordhash=""><removed session=""><removed session=""><removed api="" key="">')
# {
# Logout => { Successful => "" },
# method => "smugmug.logout",
# "stat" => "ok",
# }
#
ok 9 - test: smugmug.logout with password session (REST 1.2.0)
#
# call => smugmug.logout (SessionID => '</removed></removed></removed></removed></removed></removed>removed<removed password=""><removed api="" key=""><removed passwordhash=""><removed session=""><removed session=""><removed api="" key=""><removed session="">', APIKey => '</removed></removed></removed></removed></removed></removed></removed>removed<removed password=""><removed api="" key=""><removed passwordhash=""><removed session=""><removed session=""><removed api="" key=""><removed session=""><removed api="" key="">')
# { code => 3, msg => "invalid session" }
#
ok 10 - test: smugmug.logout with invalid password session (REST 1.2.0)
ok 11 - check: correct error code [3] (REST 1.2.0)
ok 12 - check: correct error message [invalid session] (REST 1.2.0)
#
# call => smugmug.login.withHash (UserID => '140089', PasswordHash => '<removed passwordhash=""></removed></removed></removed></removed></removed></removed></removed></removed></removed>removed<removed password=""><removed api="" key=""><removed passwordhash=""><removed session=""><removed session=""><removed api="" key=""><removed session=""><removed api="" key=""><removed passwordhash="">', APIKey => '<removed api="" key=""></removed></removed></removed></removed></removed></removed></removed></removed></removed></removed>removed<removed password=""><removed api="" key=""><removed passwordhash=""><removed session=""><removed session=""><removed api="" key=""><removed session=""><removed api="" key=""><removed passwordhash=""><removed api="" key="">')
# {
# AccountType => "Power",
# SessionID => "</removed></removed></removed></removed></removed></removed></removed></removed></removed></removed>removed<removed password=""><removed api="" key=""><removed passwordhash=""><removed session=""><removed session=""><removed api="" key=""><removed session=""><removed api="" key=""><removed passwordhash=""><removed api="" key=""><removed session="">",
# }
#
# call => smugmug.logout (SessionID => '<removed session=""></removed></removed></removed></removed></removed></removed></removed></removed></removed></removed></removed></removed>removed<removed password=""><removed api="" key=""><removed passwordhash=""><removed session=""><removed session=""><removed api="" key=""><removed session=""><removed api="" key=""><removed passwordhash=""><removed api="" key=""><removed session=""><removed session="">', APIKey => '<removed api="" key=""></removed></removed></removed></removed></removed></removed></removed></removed></removed></removed></removed></removed></removed>removed<removed password=""><removed api="" key=""><removed passwordhash=""><removed session=""><removed session=""><removed api="" key=""><removed session=""><removed api="" key=""><removed passwordhash=""><removed api="" key=""><removed session=""><removed session=""><removed api="" key="">')
# {
# Logout => { Successful => "" },
# method => "smugmug.logout",
# "stat" => "ok",
# }
#
ok 13 - test: smugmug.logout with hashed session (REST 1.2.0)
#
# call => smugmug.logout (SessionID => '<removed session=""></removed></removed></removed></removed></removed></removed></removed></removed></removed></removed></removed></removed></removed></removed>removed<removed password=""><removed api="" key=""><removed passwordhash=""><removed session=""><removed session=""><removed api="" key=""><removed session=""><removed api="" key=""><removed passwordhash=""><removed api="" key=""><removed session=""><removed session=""><removed api="" key=""><removed session="">', APIKey => '</removed></removed></removed></removed></removed></removed></removed></removed></removed></removed></removed></removed></removed></removed>removed<removed password=""><removed api="" key=""><removed passwordhash=""><removed session=""><removed session=""><removed api="" key=""><removed session=""><removed api="" key=""><removed passwordhash=""><removed api="" key=""><removed session=""><removed session=""><removed api="" key=""><removed session=""><removed api="" key="">')
# { code => 3, msg => "invalid session" }
#
ok 14 - test: smugmug.logout with invalid hashed session (REST 1.2.0)
ok 15 - check: correct error code [3] (REST 1.2.0)
ok 16 - check: correct error message [invalid session] (REST 1.2.0)</removed></removed></removed></removed></removed></removed></removed></removed></removed></removed></removed></removed></removed></removed></removed>
SmugMug API Developer
My Photos
I'm adding some sanity checks to my URLs.
Thanks for the quick response!! Sorry to waste your time.
that's ok...you had me worried for a minute
SmugMug API Developer
My Photos