Basic API call produces SDK error

Hi,

I’m trying to test my first API call with Looker SDK, and I cannot seem to get this to work. I am following the full tutorial found here, but I can’t seem to ensure that my user account is pulled correctly. I keep getting the error for the line:

my_user = sdk.me()

The error is below, but I can’t figure out why it doesn’t work when everything else did above it”

SDKError: b'{"message":"Not found","documentation_url":"http://docs.looker.com/"}'

Here is the full code:

# Install Looker SDK
!pip install looker_sdk
import looker_sdk
import os

# Login
os.environ["LOOKERSDK_BASE_URL"] = "[URL]" #This URL is specific to my organization, including port number.
os.environ["LOOKERSDK_API_VERSION"] = "3.1"
os.environ["LOOKERSDK_VERIFY_SSL"] = "true"
os.environ["LOOKERSDK_TIMEOUT"] = "120"

# Retrieved from Admin > Users > API Keys
os.environ["LOOKERSDK_CLIENT_ID"] = "[Client ID]"
os.environ["LOOKERSDK_CLIENT_SECRET"] = "[Client Secret]"

# Initialize SDK
sdk = looker_sdk.init31()

# Run test API call. Should pull your first name twice.
my_user = sdk.me()

print(my_user.first_name) #Model dot notation
print(my_user["first_name"]) #Dictionary

If it helps, I’m running this on a Juypter notebook. All assistance is appreciated. Thank you!

Solved Solved
0 1 1,082
1 ACCEPTED SOLUTION

Oh I solved it. My Client ID was off by one digit, lol.

View solution in original post

1 REPLY 1

Oh I solved it. My Client ID was off by one digit, lol.