Hello,
I am trying to execute a PUT API call to update a DOMO variable in a workflow. I have the variable's URL and I have the secret token needed to authorize the call (per DOMO's documentation), however I am still getting the following error:
{"status":401,"statusReason":"Unauthorized","path":"/api/query/v1/functions/template/146","message":"Full authentication is required to access this resource"
Below is the URL format and the bit of code I am using for the PUT function
URL: https://mycompany.domo.com/api/query/v1/functions/template/XXX
CODE:
def update_date():
url = 'https://mycompany.domo.com/api/query/v1/functions/template/XXX'
auth_token = "XXX"
headers = {
"Authorization": f"Bearer {auth_token}",
"Content-Type": "application/json"
}
data = {
"id": ###,
"name": "Booked as of",
"owner": ###,
"locked": "false",
"global": "true",
"certificationStatus": "EXPIRED",
"expression": "DATE('2025-05-15')", # Field I am trying to update
"checkSum": "XXX",
"links": [],
"legacyId": "calculation_XXX",
"lastModified": ###,
"created": ###,
"aggregated": "false",
"analytic": "false",
"nonAggregatedColumns": [],
"dataType": "DATE",
"status": "VALID",
"cacheWindow": "non_dynamic",
"columnPositions": [],
"functions": []
"DATE" [],
"functionTemplateDependencies": [],
"archived": "false",
"hidden": "false",
"variable": "true"
}
response = requests.put(url, json=data, headers=headers)
if response.status_code == 200:
return print(response.text)
else:
print(response.text)
Does anyone have any clue on what I am missing here?