GetPublicApiClientUsingApiKey
get_public_api_client_using_api_key(app_name_header, client_type_header, api_key_header)
Expand source code
get_public_api_client_using_api_key(app_name_header, client_type_header, api_key_header):
"""
Description
-----------
Method 2, To get the client object of QDC Api using api key.
Args
----
app_name_header: Name of the Client.
client_type_header: Client code type connecting to QDC Api.
api_key_header: Get the api key from the QDC UI -> Users -> settings -> API Keys
Returns
-------
object: Authenticated client object.
None: In case of an failure.
Usages
------
app_name = "ai hub"
client_type = "Python"
# Please get the api key from the QDC UI -> Users -> settings -> API Keys
api_key = ""
# qdc_api is the name of the module
public_api_client = qdc_api.get_public_api_client_using_api_key(app_name, client_type, api_key)
"""
qdc_headers = {
"Authorization": api_key_header,
"X-QCOM-TokenType": "apikey",
"X-QCOM-AppName": app_name_header,
"X-QCOM-ClientType": client_type_header,
}
return Client(base_url=API_BASE_URL, headers=qdc_headers)
Description
Method 2, To get the client object of QDC Api using api key.
Arguments
app_name_header: Name of the Client.
client_type_header: Client code type connecting to QDC Api.
api_key_header: Get the api key from the QDC UI -> Users -> settings -> API Keys
Returns
object: Authenticated client object.
None: In case of an failure.
Usages
app_name = "ai hub"
client_type = "Python"
# Please get the api key from the QDC UI -> Users -> settings -> API Keys
api_key = ""
# qdc_api is the name of the module
public_api_client = qdc_api.get_public_api_client_using_api_key(app_name, client_type, api_key)