Skip to content

Instantly share code, notes, and snippets.

@chriscalip
Created December 6, 2018 03:55
Show Gist options
  • Save chriscalip/684b95ddfb3191711c9fc68e714dd864 to your computer and use it in GitHub Desktop.
Save chriscalip/684b95ddfb3191711c9fc68e714dd864 to your computer and use it in GitHub Desktop.
initial try swagger-api/swagger-client python
import swagger_client as looker
# replace with your custom Looker API Host domain and port, if applicable.
base_url = 'https://your.looker.instance:19999/api/3.0/'
client_id = 'your-API3-client-id'
client_secret = 'your-API3-client-secret'
unauthenticated_client = looker.ApiClient(configuration=None)
unauthenticated_authApi = looker.ApiAuthApi(unauthenticated_client)
token = unauthenticated_authApi.login(client_id=client_id, client_secret=client_secret)
client = looker.ApiClient(base_url, 'Authorization', 'token ' + token.access_token)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment