Trouble with Python Plugin

I’m not the best with Python, but I cannot get this to work with my connection

def run(params={}):
    import requests
    import json

    # Authentication
    client_id = params.get('credentials').get('username')

I keep getting this not matter what I try and I got this from the documentation

Traceback (most recent call last):
  File "/python/src/.py", line 48, in <module>
    sys.stdout.write("" + str(run({})))
  File "/python/src/.py", line 21, in run
    client_id = params.get('credentials').get('username')
AttributeError: 'NoneType' object has no attribute 'get'

If these credentials and username are in your connection you simply have to refer to them as secret_key and username in your script(these are variable names). If you are pulling them from the input section you need to define the variable as a key/value pair and then pull via params.get("variable")

Stupid mistake on my part, that was the first thing I tried but it didn’t work because I had the wrong connection, but I forgot to go back and retry :man_facepalming: