HTTP 401 Status Code when successfully using a API Key?

Posted on
Sat Jan 08, 2022 11:04 pm
anyone offline
User avatar
Posts: 125
Joined: Apr 03, 2011
Location: Norfolk, VA

HTTP 401 Status Code when successfully using a API Key?

Why would I get a HTTP 401 Unauthorized when using a url with"https://" but a 200 OK when using "http://" ?

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()

Posted on
Mon Jan 10, 2022 1:41 pm
jay (support) offline
Site Admin
User avatar
Posts: 18212
Joined: Mar 19, 2008
Location: Austin, Texas

Re: HTTP 401 Status Code when successfully using a API Key?

Yeah, looks like there's a bug in the return code. We'll look into it.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Wed Jan 12, 2022 10:30 am
anyone offline
User avatar
Posts: 125
Joined: Apr 03, 2011
Location: Norfolk, VA

Re: HTTP 401 Status Code when successfully using a API Key?

Thanks Jay.

I almost didn't ask..thinking I need to search the forums more for the answer.

Posted on
Wed Jan 12, 2022 10:48 am
jay (support) offline
Site Admin
User avatar
Posts: 18212
Joined: Mar 19, 2008
Location: Austin, Texas

Re: HTTP 401 Status Code when successfully using a API Key?

Setting a variable value seems to be the only part of the REST API that's returning an incorrect HTTP status code but let me know if you run across any other calls that do it.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests