It looks like the issue is with how you are passing authentication details. For basic authentication in the CALL REST API function, you need to include the credentials in the headers.
Here's how you can modify your code:
import base64
import json
username = 'myusername'
password = 'mysecretpassword'
auth_string = f'{username}:{password}'
auth_base64 = base64.b64encode(auth_string.encode()).decode()
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': f'Basic {auth_base64}'
}
inputs.rest_api_method = 'GET'
inputs.rest_api_headers = json.dumps(headers)
inputs.rest_api_url = 'https://mycompany.service-now.com/api/now/table/cmdb_ci?sysparm_limit=1'
inputs.rest_api_verify = False
inputs.rest_api_body = ''
Make sure to replace myusername and mysecretpassword with your actual credentials. This should resolve the 401 Unauthorized error.
------------------------------
Lee Stanton
------------------------------