16 lines
528 B
Python

from posting import Posting
import httpx
def on_response(response: httpx.Response, posting: Posting) -> None:
# Raise an exception if the request failed
response.raise_for_status()
# Set a variable to be used in later requests.
# You can write '$auth_token' in the UI and it will be substituted with
# the value of the $auth_token variable.
access_token = response.json().get("access_token")
print ("Successfully obtained access_token")
posting.set_variable("access_token", access_token)