Akuba icon

Untitled

Akuba | PRO | 02/08/17 01:35:04 PM UTC | 0 ⭐ | 282 👁️ | Never ⏰ | []
Python |

660 B

|

None

|

0 👍

/

0 👎

from imgurpython import ImgurClient
 
client_id = 'id here'
client_secret = 'secret here'
client_pin = None
#client_pin = 'abcdefghjk'
 
client = ImgurClient(client_id, client_secret)
 
if client_pin:
    credentials = client.authorize(client_pin, 'pin')
    print (credentials['access_token'])
    print (credentials['refresh_token'])
    client.set_user_auth(credentials['access_token'], credentials['refresh_token'])
else:
    # Authorization flow, pin example (see docs for other auth types)
    authorization_url = client.get_auth_url('pin')
    print(authorization_url)
    # ... redirect user to `authorization_url`, obtain pin (or code or token) ...

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎