GETTING STARTED
Indepth theory
Advanced setup
8min
do i need to read this page? if you have already gone through the quickstart docid\ b6im5u kiwn9ukybzjx6d page then you usually don't have to read this page this is page covers more background information kognic provides http apis to our client facing services, and an api client library ( kognic io https //pypi org/project/kognic io/ ), to wrap basic api calls and simplify calling the apis from python code authentication authentication is handled by kognic auth https //pypi org/project/kognic auth/ , a python 3 library providing foundations for kognic authentication on top of the requests library the authentication builds on the standard oauth 2 0 client credentials flow there are a few ways to provide authentication credentials to our api clients kognic python clients such as in kognic query or kognic io accept an auth parameter that can be set explicitly alternatively, one can set environment variables that point to the kognic credentials file see examples below generating credentials the credentials file that contains the kognic client id and the kognic client secret, can be generated in the kognic web application https //app kognic com by clicking on "api credentials " in the user menu, followed by clicking on the "generate credentials" button the credentials file should be saved in an appropriate directory, such as / config/kognic/credentials json examples there are a few different ways to set your credentials in auth set the environment variable kognic credentials to point to your kognic credentials file, by issuing the command export kognic credentials= / config/kognic/credentials json set the environment variables kognic client id and kognic client secret set the auth parameter to the credentials file path, such as auth=" / config/kognic/credentials json" set the auth parameter to credentials tuple, such as auth=(\<client id>, \<client secret>) by default, kognic api clients use the credentials set in environment variable(s) to create an authenticated kognic io client, assuming the environment variable(s) are set correctly, simply do from kognic io client import kognicioclient api client = kognicioclient() otherwise, one can override the credentials explicitly from kognic io client import kognicioclient api client = kognicioclient(auth=" / config/kognic/credentials json") under the hood, they all use the authsession class which is implements a requests session with automatic token refresh specifying a workspace from kognic io v2 4 0 you can specify a workspace to use when uploading data, for users with access to multiple workspaces this is mandatory to find the workspace you want to upload data to, select it from the drop down click on workspace managment and find the copy option in the top right hand corner when you create your kognic io client you can now specify this id and it will be used when uploading data from kognic io client import kognicioclient api client = kognicioclient(write workspace id=\<some workspace uuid>) proxy configuration if your organizations' network policy requires http(s) traffic to be proxied out via a specific host, then you should configure this via your os or execution environment kognic io uses python's urllib which will pick up the proxy configuration from your os and environment variables https //docs python org/3/library/urllib request html#urllib request getproxies the correct proxy host/address to use depends on the network configuration within your organization, so reach out to your internal it support for details for example export https proxy='http //10 9 8 7 1234'