Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '''
- You need to install pythin requests library for this to work
- e.g. pip install requests
- You also need to use python3
- '''
- import requests
- consumer_key = input("Consumer Key --> ")
- username = input("Username --> ")
- password = input("Password --> ")
- url = input("Endpoint URL --> ")
- authorization = 'DirectLogin username="{}", password="{}", consumer_key="{}"'.format(username, password, consumer_key)
- headers={
- 'Accept': 'application/json',
- 'Authorization': authorization
- }
- req = requests.post(url, headers=headers)
- print("Your access token is:")
- print(req.text)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement