• Gear
  • Shots
  • Photo Craft
  • Video
  • Wide Angle
  • Support
  • New Stuff
  • More
Support SmugMug API Support & Integrations "invalid API key" on rest api calls

Need some help with your New SmugMug Site?

Dgrin Challenges

Our Challenges moderator has lined up an new set of challenges for you. The Weekly Word Challenge. Get all the details and participate in the conversation Weekly Word Challenge.

Past DSS Challenge Winners, DSS Challenge Rules, and other important DSS Challenge information is here.

Looking for a little challenge? The Dgrin Mini-Challenges are a great way to challenge yourself. Take a moment to look through past winners and find the current Mini Challenge here.

From Around the Net

Enjoy a few of our favorite articles from around the 'net. If you have something you think we should see, post it here and we'll have a look.




Thread Tools Display Modes
Old Apr-20-2012, 05:14 PM
auser is offline auser OP
Beginner grinner
"invalid API key" on rest api calls
This is my first time trying to use the API.

I login with https://api.smugmug.com/services/api/rest/1.2.2/?method=smugmug.login.withPassword&APIKey=...&Emai lAddress=...&Password=...

and get a response with stat="ok" and a session id.

Then I try: https://api.smugmug.com/services/api/rest/1.2.2/?SessionID=...&method=smugmug.categories.get

and I get <rsp stat="fail"><method>smugmug.categories.get</method><err code="18" msg="invalid API key"/></rsp>

I tried a few different methods, always with the same result. What's wrong?
Old Apr-21-2012, 02:02 PM
auser is offline auser OP
Beginner grinner
I got it to work. I used wget with "--save-cookies /tmp/cookies.txt --keep-session-cookies" for the login.withPassword, and "--load-cookies /tmp/cookies.txt" on the subsequent categories.get. Is the requirement of having cookies enabled documented anywhere?
Old May-10-2012, 12:29 PM
olegos is offline olegos
Big grins
Just wanted to say thanks for posting this. I was trying to use the API from perl, and was running into this error too. Your posts helped me along.

This is all I needed to do in perl to enable cookies:

use HTTP::Cookies;

my $cookie_jar = HTTP::Cookies->new(
    file => "sm_cookies.dat",
    autosave => 1,

my $ua = LWP::UserAgent->new;
Tell The World!  
Similar Threads Thread Starter Forum Replies Last Post
Why is REST API not RESTful? MikeSchinkel SmugMug API Support & Integrations 6 Apr-02-2008 08:23 PM
Some problems with REST 1.1.1 API mhilbush SmugMug API Support & Integrations 9 May-03-2007 04:51 PM
stuck on smugmug.images.upload API call crenner SmugMug API Support & Integrations 5 Sep-04-2006 09:12 PM
Image URLs from REST API Don't Always Work in Firefox o_swas SmugMug API Support & Integrations 4 Jul-27-2006 10:50 AM
Bugs in REST API mpmcleod SmugMug API Support & Integrations 3 Jun-06-2006 12:50 AM

Thread Tools
Display Modes

Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump