Initializing help system before first use

# xpressinsight.scenario.InsightRestClient.put_app_attachment

Purpose
Upload an app attachment, either creating a new attachment or overwriting an existing one of the same name.
Synopsis
`xpressinsight.scenario.InsightRestClient.put_app_attachment(self, app_id: str, attachment_name: str, source: str | TextIO | BinaryIO, tag_name: Optional[str] = None, overwrite: bool = False, encoding: Optional[str] = 'utf-8') -> scenario.Attachment`
Arguments

app_id | The ID of the app on which to save the attachment.
attachment_name | The name to give the attachment (for example, "factories.csv").
source | Where to read the attachment content. This may be the name of a local file, or any file-like object.
tag_name | The name of a tag to give the attachment, if any.
overwrite | If set to True, the new attachment overwrites any existing app attachment that has the same name. If False, the new attachment is given a different name if there is an existing attachment with the same name.
encoding | The character encoding to use when source is of type TextIO. Defaults to utf-8.

Return value

Information about the new or updated app attachment record.

This function may raise the following errors:

scenario.ItemNotFoundError

  If the scenario does not exist, or the REST API client credentials do not have permission to access it.

scenario.InsightServerError

  If there is an issue communicating with the Insight server.

Example

    >>> with ins.InsightRestClient(insight_url='http://localhost:8080/') as client:
    ...     client.put_app_attachment(
    ...         app_id='570b9100-46e3-4643-baee-2e24aa538f25',
    ...         attachment_name='factories.csv',
    ...         source='factories.csv')

Further information
The method put_app_attachment is part of the class xpressinsight.scenario.InsightRestClient.
Related topics
scenario.Attachment
Parent Topic Insight Scenario REST API client

© 2001-2026 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.