Flickr API: does the API key continue to become invalid?

Ive Flickr, which I use to download images from my phone, and all images are publicly available. On my blog, I want to get all the images to show, and for that Ive first tried to create an application to get my API key. Im using the Flickr API flickr.people.getPublicPhotos . It is said that this API service does not require authentication and put it all together. I get 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 about 10 hours I fail 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 an API call when logging into Flickr, and also not logging in, and in both cases I get an error. Its as an API key expires or stops working. Missed something on Flickr about the API key, or what can it do? It's really annoying to update the URL twice a day.

thanks

Sincere
- Mestica

+4
source share
4 answers

If I read the documents correctly, the query string parameter & api_sig is built using an authentication token that expires. Remove this parameter (= do not sign your API request) and I think that everything will be fine.

+2
source

Mestika's comment seems correct. I was getting the same issue when using an API browser. If you use the account API or go in and create a new application, use the API for this, and then the key does not change every few hours.

Request URL: http://www.flickr.com/services/apps/create/apply

+1
source

I have the same problem.

Here is how I solved it:

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

Hope this helps.

+1
source

I met this problem before. with the new api key, just accept the https request. Let me modify your URL: https://api.flickr.com/services/rest/?method=flickr.people.getPublicPhotos&api_key .....

I am sure this will work correctly. thanks

0
source

Source: https://habr.com/ru/post/1413221/


All Articles