How to get access token via javascript?

14 views
Skip to first unread message

hendry

unread,
Jul 4, 2016, 1:49:52 AM7/4/16
to Imgur
Hi,

I need access token to upload image to my album.

when I use browser to open
https://api.imgur.com/oauth2/authorize?client_id=My_ClientID&response_type=token&state=test

from the browser I can see it redirect to https://imgur.com/?state=test#access_token=5220aad4e49bdafa689a648aa8bd3a30e34de249&expires_in=2419200&token_type=bearer&refresh_token=9f97f850924fa5b4f2f94985e40b0d6c86bab88a&account_username=username&account_id=id

So I know that my access token is "5220aad4e49bdafa689a648aa8bd3a30e34de249"..

But I have no idea how to use use JavaScript to get the access token.
If I use ajax to request, the responseUrl I get https://imgur.com/?state=test

Anyone can guide me?

Thanks

Reply all
Reply to author
Forward
0 new messages