Zach Sylvester
import requests def auth(username, password, url): authurl = url + "/api/v1/auth/authenticate-user" myobj = {'username': username, 'password':password} data = requests.post(authurl, data = myobj) # this posts the username and password to the api #print(data.json()) refreshToken = data.json()['refreshToken'] # this is the refresh token accessToken = data.json()['accessToken'] # this is the access token accessTokenExpiration = data.json()['accessTokenExpiration'] # this is the access token expiration date access_info = {'accessToken': accessToken, 'accessTokenExpiration': accessTokenExpiration, 'refreshToken': refreshToken} # this is the access token, refresh token and expiration info return access_info # returns the information creds = auth("username","password","https://yourinstance.com")
Trouble logging in? Simply enter your email address OR username in order to reset your password.
For faster and more reliable delivery, add noreply@smartertools.com to your trusted senders list in your email software.