Subodh Joshi
Subodh Joshi

Reputation: 13522

Invalid API Key (Key has invalid format) : Flickr upload api

I tried lots of thing but fail to upload the photo through flickr api ..Here what i am doing

API- https://api.flickr.com/services/upload

Method- POST

Authorization- Oauth1.0

Passing Consumer Key/Consumer Secret/Access Token/Token Secret

enter image description here

enter image description here

enter image description here

enter image description here

Upvotes: 1

Views: 467

Answers (1)

PDHide
PDHide

Reputation: 19979

Below video shows exactly how to create oath0.1 token

https://youtu.be/3gXPjj5iEAA

Follow the full video and once your setup is able to retrieve user details as in the video, create a copy of that and change the authorization 0auth0.1 to header than in request

and in body use form data , as name (just a name string) and photo (actual file) and do a POST.

Steps summary:

  1. https://api.flickr.com/services/oauth/request_token , request for token to this url
  2. authorize the token you get by navigating to https://api.flickr.com/services/oauth/authorize?oauth_token={{token}}
  3. Click the i will authorize button:

enter image description here

  1. Copy the verifier code from the url navigated to
  2. Get the access token through https://api.flickr.com/services/oauth/access_token?oauth_verifier={{verifier}}
  3. Access upload endpointing using this new token

Output:

enter image description here

Postman Collection

<div class="postman-run-button"
data-postman-action="collection/import"
data-postman-var-1="ef7e250508f522b9bad1"></div>
<script type="text/javascript">
  (function (p,o,s,t,m,a,n) {
    !p[s] && (p[s] = function () { (p[t] || (p[t] = [])).push(arguments); });
    !o.getElementById(s+t) && o.getElementsByTagName("head")[0].appendChild((
      (n = o.createElement("script")),
      (n.id = s+t), (n.async = 1), (n.src = m), n
    ));
  }(window, document, "_pm", "PostmanRunObject", "https://run.pstmn.io/button.js"));
</script>

How to use the collection:

use the gif file that i recorded to know the steps

https://www.flickr.com/photos/191341909@N02/50696475437/in/dateposted-public/

Upvotes: 1

Related Questions