On successful authentication trying to capture request_token from redirect url (https://sampleengine.herokuapp.com/get-request-token) but always getting 404 error. Tried to handle 404 but nothing saved as request token. (tried to save request_token in req_token in below code and print "request_token")
We just redirect to the endpoint specified in the developers console. The request token will be part of the url and not really in the data. It will be a query param on that endpoint, if you are doing some redirect then make sure you pass on the query params.
Thanks for the response @sujith. I tried to capture from query parameters as well but nothing captured.
def get_request_token(): a = request.args.get('request_token') print('request_token', a) return "Success"
Not sure if i'm missing anything, my intention is to save reruest_token. Since most of the users doing the same you might have come across this situation. If you correct/share piece of code/suggest missine piece will be appriciated
Your logs shows request_token query param is added fine.
a = request.args.get('request_token')
Above statement is fine too to extract request_token from query string. So, my guess is, it has something to do with your heroku setup. Can you test the same flask app locally, if it's printing request_token fine?
my intention is to save request_token.
You should immediately use request_token to generate access_token and save the access_token to make all future requests. You can go through this flask app example to understand more about this.
It will be a query param on that endpoint, if you are doing some redirect then make sure you pass on the query params.
def get_request_token():
a = request.args.get('request_token')
print('request_token', a)
return "Success"
Not sure if i'm missing anything, my intention is to save reruest_token. Since most of the users doing the same you might have come across this situation. If you correct/share piece of code/suggest missine piece will be appriciated