The below code sample, updates the variable but kicks out a HTTP status code of 401.
- Code: Select all
def simple():
my_headers = {"Authorization":
"Bearer MY API KEY"}
indigo_server = 'myreflector'
variable_name = 'playing_around'
new_value = 'superman is clark kent'
url = 'https://{0}.indigodomo.net/variables/{1}?_method=put&value={2}'.format(indigo_server, variable_name, new_value)
reply = requests.get(url, headers=my_headers)
print (reply.status_code)
if __name__ == "__main__":
simple()