Created
September 25, 2021 05:54
-
-
Save ojmccall/6a8ed7458c232ea6a3810b23d95052f1 to your computer and use it in GitHub Desktop.
GCP- SFMC Find & Replace Section 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contentChanged = 0 | |
SQLChanged = 0 | |
SSJSChanged = 0 | |
#get Token Here | |
try: | |
url = "https://"+baseURL+".auth.marketingcloudapis.com/v2/Token" | |
data = {"grant_type":"client_credentials", | |
"client_id":client_id, | |
"client_secret":client_secret | |
} | |
r = requests.post(url, data=data) | |
body = json.loads(r.content) | |
token = body['access_token'] | |
TokenStatus = r.status_code | |
if TokenStatus != 200: | |
Failure = 1 | |
StatusMessage = "token request invalid" | |
else: | |
Failure = 0 | |
except Exception as e: print("Error from Token request: "+e) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment