xpressinsight.scenario.InsightRestClient.__init__
Creates a new InsightRestApi instance, which can be used to interact with an Insight v5 server through its REST API. Requests made will be authorized using the user for which the client_id and secret were generated.
The InsightRestApi should be constructed in this way when being used from outside an Insight app; when connecting to the same server currently executing this Python code, use AppInterface.get_rest_client instead.
xpressinsight.scenario.InsightRestClient.__init__(self, insight_url: str, client_id: Optional[str] = None, secret: Optional[str] = None, dmp_iam_url: Optional[str] = None, bearer_token_provider: Optional[Callable[[], scenario.BearerToken]] = None, max_retries: int = 5, verify_credentials: bool = True, slow_task_threshold: datetime.timedelta = datetime.timedelta(seconds=120))
insight_url
|
The URL of the Insight server to access. If copying a URL from the browser, the trailing "/insight" should not be included. For example,
"http://localhost:8080/"
|
client_id
|
The client ID value to use to authenticate the session with the Insight server. If not specified, the client ID is read from the system keyring entry
"ficoxpress:<insight_url>".
|
secret
|
The secret value to use to authenticate the session with the Insight server. If not specified, the secret is read from the system keyring entry
"ficoxpress:<insight_url>". If client_id was specified, keyring will specifically look for an entry with that name and client_id.
|
dmp_iam_url
|
The URL of the DMP IAM endpoint to use to authenticate a session with an Insight component in DMP. This is
"https://iam-svc.<domain_name>/registration/rest/client/security/token" where
<domain_name> is the domain for the DMP instance you're using; for example
"https://iam-svc.mydms.usw2.ficoanalyticcloud.com/registration/rest/client/security/token".
|
bearer_token_provider
|
Function that will return a
BearerToken to use to authorize requests to the Insight server. In advanced use cases, a function pointer can be provided as an alternative to specifying the
client_id and
secret and allowing
InsightRestClient to authorize itself.
|
max_retries
|
The maximum number of times to attempt to retry a failed request before giving up. Defaults to 5.
|
verify_credentials
|
Whether to immediately fetch a bearer token and verify that the
client_id and
secret values are correct. Defaults to
True. If set to
False, this function will not raise an error if the credentials are invalid; instead, an error is raised from the function that calls out to the Insight REST API.
|
slow_task_threshold
|
Requests and internal tasks taking this time or longer will result in warnings output to the run log. This is a troubleshooting setting that can be used to track if internal xpressinsight operations are being unexpectedly time-consuming.
|
This function may raise the following errors:
>>> client = InsightRestClient(insight_url='http://localhost:8080')
>>> MY_CLIENT_ID: str = '<copy client id from Insight UI to here>' ... client = InsightRestClient(insight_url='http://localhost:8080', ... client_id=MY_CLIENT_ID)
>>> MY_CLIENT_ID: str = '<copy client id from Insight UI to here>' ... MY_SECRET: str = '<copy secret from Insight UI to here>' ... client = InsightRestClient( ... insight_url='http://localhost:8080', ... client_id=MY_CLIENT_ID, secret=MY_SECRET)
>>> MY_CLIENT_ID: str = '<copy client id from DMP UI to here>' ... MY_SECRET: str = '<copy secret from DMP UI to here>' ... IAM_SERVER = 'https://iam-svc.dms.usw2.ficoanalyticcloud.com' ... IAM_URL = f'{IAM_SERVER}/registration/rest/client/security/token' ... client = InsightRestClient( ... insight_url='https://app.dms.usw2.ficoanalyticcloud.com/16m0jgaeei', ... dmp_iam_url=IAM_URL, ... client_id=MY_CLIENT_ID, secret=MY_SECRET)
© 2001-2025 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.