TDApiClient.API_Request is a static helper function to invoke the in-database function API_Request.
This function returns a teradataml DataFrame.
Required Arguments:
- dataframe: Specifies an input teradataml DataFrame which acts as the input query for the API_Request in-database function.
- See list of additional required arguments and corresponding parameters in the in-database function API_Request in the following table.
Optional Arguments:
- options: Specifies key-value arguments to be passed to the in-database function API_Request. See list of these key-value arguments in the following table.
This table shows the mapping between TDApiClient.API_Request arguments to the corresponding parameters in the in-database function API_Request. For details of these parameters, see API_Request In-database Function Syntax Elements.
TDApiClient.API_Request Argument | Required or Optional | API_Request in-database function Parameter |
---|---|---|
api_type | Required | API_TYPE |
authorization | Required | AUTHORIZATION |
content_type | Optional | CONTENT_TYPE |
key_start_index | Optional | KEY_START_INDEX |
endpoint | Optional | ENDPOINT |
Example
from TDApiClient import TDApiClient
auth_info_fmt_str = ('{{ "key": "{}", "region" : "{}", "project": "{}"}}')
auth_info = auth_info_fmt_str.format( gcp_credentials_token, gcp_region, gcp_project_id )
df = TDApiClient.API_Request(reviews_df, "vertex-ai", authorization=auth_info, endpoint='6918043599082881024', key_start_index=1)