Guest User

Untitled

a guest
Oct 18th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.78 KB | None | 0 0
  1. import requests
  2.  
  3. params = {
  4.     "grant_type": "password",
  5.     "client_id": "3MVG9G9pzCUSkzZt_wqRo655usHzMNgnb6IgOYf_s_gWd0OwGaLhKWjfZLHGACdqvq5tRif1tbgs5tZ9PHpzK", # Consumer Key
  6.     "client_secret": "073F32B34AE9A146336BCB467097A4FCC3F384EB9748CD69E81D9F2650866D1A", # Consumer Secret
  7.     "username": "[email protected]", # The email you use to login
  8.     "password": "thutechs@2015" # Concat your password and your security token
  9. }
  10.  
  11. try:
  12.     r = requests.post("https://login.salesforce.com/services/oauth2/token", params=params)
  13.     print(r)
  14.     print(r.json())
  15.     access_token = r.json().get("access_token")
  16.     instance_url = r.json().get("instance_url")
  17.     print("Access Token:", access_token)
  18.     print("Instance URL", instance_url)
  19. except Exception as e:
  20.     print(e)
Advertisement
Add Comment
Please, Sign In to add comment