Flickr API: API key keeps getting invalid?
Asked Answered
E

4

6

I’ve a Flickr which I’m using to upload pictures from my phone and all images are public. On my blog I want to retrieve all the images to show and for that I’ve first tried to create an application to get my API key. I’m using the Flickr API flickr.people.getPublicPhotos. This API service is said to not require authentication and putting it all together I end up with this call:

http://api.flickr.com/services/rest/?method=flickr.people.getPublicPhotos&api_key=fc94274cd0335f3c171fe22c8490b7d9&user_id=5545356%40N04&extras=description%2Cdate_upload%2Cdate_taken%2Cowner_name%2Coriginal_format%2Ctags%2C+o_dims%2C+views%2C+media%2C+path_alias%2C+url_sq%2C+url_t%2C+url_s%2C+url_q%2C+url_m%2C+url_n%2C+url_z%2C+url_c%2C+url_l%2C+url_o&per_page=40&format=php_serial&api_sig=0c48e2b6b6d9a03521e5ca86a15cf471

The problem is that every around 10 hours I fails and returns the error message a:3:{s:4:"stat";s:4:"fail";s:4:"code";i:100;s:7:"message";s:31:"Invalid API Key (Key not found)";}

I tried to create the API call when logged in to Flickr and also with not logging in and in both cases I get the error message. It’s like the API key expires or stops working. Have a missed something on Flickr about the API key or what could cause this? It is really frustrating to renew the URL twice at day.

Thank you

Sincere
- Mestika

Edge answered 18/5, 2012 at 17:35 Comment(0)
D
4

If I read the docs correctly, the &api_sig query string parameter is constructed using an authentication token, one that eventually expires. Remove that parameter (= do not sign your API request) and I think you'll be OK.

Dupree answered 18/5, 2012 at 18:48 Comment(4)
Hi David, thanks for your answer. Do you mean to remove the parameter "api_key=fc94274cd0335f3c171fe22c8490b7d9" from the query string? I tried that and it gives me the error: Invalid API Key (Key has invalid format). Or did I misunderstod you?Edge
No, I mean remove this one: &api_sig=0c48e2b6b6d9a03521e5ca86a15cf471Dupree
Ah I think I found the answer. I removed the API sign as you said in the end. The other issue was that I had used the API explore and for that it seems that it changes. I just used my accounts API key with no API sign and it seems to work. I just cross my fingers that it also works tomorrow :-)Edge
i am doing as you said but i get this error Invalid API Key (Key not found), i have opened a question here #34704721Ronaronal
T
1

Mestika's comment seems correct. I was getting the same problem when using the API explorer. If you use your accounts API, or go in and create a new app, then use the API given for that, then the key doesn't change every few hours.

The url to request a key is: http://www.flickr.com/services/apps/create/apply

Typography answered 11/2, 2013 at 20:53 Comment(0)
E
1

I got the same problem.

This is how i solved it:

  • removed the auth_token and the api_sig parameters
  • replaced the api_key value with an app key

Hope this helps.

Eckert answered 9/4, 2017 at 22:33 Comment(0)
S
0

i met this issue before. with new api key, only accept https request. Let's change your url to: https://api.flickr.com/services/rest/?method=flickr.people.getPublicPhotos&api_key.....

I am sure it will be work right know. thanks

Stere answered 17/5, 2014 at 3:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.