Comments (3)
@oamm you can't get access token by passing verifier?
from python-500px.
I can run this code perfectly
from fivehundredpx.client import FiveHundredPXAPI
from fivehundredpx.auth import *
CONSUMER_KEY = 'XXXXXX'
CONSUMER_SECRET = 'XXXX'
handler = OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
token = handler.get_request_token()
handler.set_request_token(key=token.key, secret=token.secret)
handler.get_authorization_url()
#I got the url and pass the oauth_verifier(YYYYYY)
token = handler.get_access_token('YYYYYY')
handler.set_access_token(token.key, token.secret)
api = FiveHundredPXAPI(handler)
api.users()['user']['domain']
>>u'OmarMora.500px.com'
But i don't know how create a new instance of the OAuthHandler and pass the oauth_verifier parameter to it for continue the authentication, I tried to do it with the code that is above but i still get FiveHundredClientError: HTTP Error 401: Unauthorized , if you can tell me how is the correct order that i have to send the outh_verifier and tokens I would be very greatful
from python-500px.
@oamm
you can get data from 500px api normally when u make first request after getting access token.
and when u make second request with new instance of API client, you get 401 error.
is this correct?
if so, you can just set access token again. but u have to keep the access token somewhere.
CONSUMER_KEY = 'XXXXXX'
CONSUMER_SECRET = 'XXXX'
handler = OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
handler.set_access_token( "key", "secret")
api = FiveHundredPXAPI(handler)
from python-500px.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-500px.