Attachment resources
Operation | Description |
---|---|
GET /api/apps/{appId}/attachments | Get all app attachments |
POST /api/apps/{appId}/attachments | Add an attachment to an app |
POST /api/apps/{appId}/attachments/files | Get multiple app attachments |
POST /api/apps/{appId}/attachments/trash | Delete multiple app attachments |
GET /api/apps/{appId}/attachments/{attachmentId} | Get an app attachment |
DELETE /api/apps/{appId}/attachments/{attachmentId} | Delete an app attachment |
PATCH /api/apps/{appId}/attachments/{attachmentId} | Update the metadata of an app attachment |
GET /api/apps/{appId}/attachments/{attachmentId}/file | Download an app attachment file |
GET /api/scenarios/{scenarioId}/attachments | Get all scenario attachments |
GET /api/scenarios/{scenarioId}/attachments/{attachmentId} | Get a scenario attachment |
GET /api/scenarios/{scenarioId}/attachments/{attachmentId}/file | Download a scenario attachment file |
GET /api/apps/{appId}/attachments
Get the metadata for all the attachments belonging to an app.
Request Parameters
Name | Description | Type | Data Type | |
---|---|---|---|---|
appId | The app ID |
path | string (uuid) | required |
page | Number of the page, starting at zero |
query | integer (int32) | |
size | Number of elements per page |
query | integer (int32) |
Responses
- 200 OK
-
The page of app attachments
- Content-Type application/vnd.com.fico.xpress.insight.v2+json
- 404 Not Found
-
The app did not exist or was unavailable to the current user
- Content-Type application/vnd.com.fico.xpress.insight.v2+json
Example: {
"error": {
"code": "FICO-Platform-Http-404",
"desc": "Not Found",
"innerError": {
"code": "OPTI-Insight-Persistence-DocumentNotFound",
"desc": "Document not found",
"message": "Unable to find document"
},
"message": "Not Found",
"spanId": "0000000000000123",
"timestamp": "1970-01-03T02:01:33.219Z",
"traceId": "0000000000000abc"
}
}
POST /api/apps/{appId}/attachments
Create a new app attachment or overwrite an existing one.
Request Body
- Content-Type multipart/form-data
-
Properties
- attachment: string (binary)
-
- overwrite: boolean
-
- tagName: string
-
Request Parameters
Name | Description | Type | Data Type | |
---|---|---|---|---|
appId | The app ID |
path | string (uuid) | required |
Responses
- 200 OK
-
The uploaded attachment, with the existing ID if it was overwritten
- Content-Type application/vnd.com.fico.xpress.insight.v2+json
- 403 Forbidden
-
The user did not have authority to add the attachment
- 404 Not Found
-
The app did not exist or was unavailable to the current user
- Content-Type application/vnd.com.fico.xpress.insight.v2+json
Example: {
"error": {
"code": "FICO-Platform-Http-404",
"desc": "Not Found",
"innerError": {
"code": "OPTI-Insight-Persistence-DocumentNotFound",
"desc": "Document not found",
"message": "Unable to find document"
},
"message": "Not Found",
"spanId": "0000000000000123",
"timestamp": "1970-01-03T02:01:33.219Z",
"traceId": "0000000000000abc"
}
} - 409 Conflict
-
The attachment was already in the process of being updated
- Content-Type application/vnd.com.fico.xpress.insight.v2+json
Example: {
"error": {
"code": "FICO-Platform-Http-409",
"desc": "Conflict",
"innerError": {
"code": "OPTI-Insight-Locks-ConcurrentDataModification",
"desc": "Concurrent data modification rejected",
"message": "Update rejected: concurrent data modification detected"
},
"message": "Conflict",
"spanId": "0000000000000123",
"timestamp": "1970-01-03T02:01:33.219Z",
"traceId": "0000000000000abc"
}
} - 413 Request Entity Too Large
-
The uploaded file was too large
- Content-Type application/vnd.com.fico.xpress.insight.v2+json
Example: {
"error": {
"code": "FICO-Platform-Http-413",
"desc": "Payload Too Large",
"innerError": {
"code": "FICO-Platform-Validation-FileTooLarge",
"desc": "Attachment upload too large",
"message": "Files larger than 300 MB cannot be uploaded as attachments."
},
"message": "Payload Too Large",
"spanId": "0000000000000123",
"timestamp": "1970-01-03T02:01:33.219Z",
"traceId": "0000000000000abc"
}
} - 422 Unprocessable Entity
-
The filename was not permitted, or the the maximum number of files or file size was exceeded
- Content-Type application/vnd.com.fico.xpress.insight.v2+json
Example: {
"error": {
"code": "FICO-Platform-Http-422",
"desc": "Unprocessable Entity",
"innerError": {
"code": "FICO-Platform-Validation-OutOfBounds",
"desc": "Attachment extension not allowed",
"message": "Files with .exe extension cannot be attached."
},
"message": "Unprocessable Entity",
"spanId": "0000000000000123",
"timestamp": "1970-01-03T02:01:33.219Z",
"traceId": "0000000000000abc"
}
}Example: {
"error": {
"code": "FICO-Platform-Http-422",
"desc": "Unprocessable Entity",
"innerError": {
"code": "OPTI-Insight-File-ExternalStorageInvalidPath",
"desc": "External storage file path invalid",
"message": "The requested path is not valid."
},
"message": "Unprocessable Entity",
"spanId": "0000000000000123",
"timestamp": "1970-01-03T02:01:33.219Z",
"traceId": "0000000000000abc"
}
}Example: {
"error": {
"code": "FICO-Platform-Http-422",
"desc": "Unprocessable Entity",
"innerError": {
"code": "FICO-Platform-Validation-TooLarge",
"desc": "Too many attachments",
"message": "Limit is 250 attachments per app\\/scenario"
},
"message": "Unprocessable Entity",
"spanId": "0000000000000123",
"timestamp": "1970-01-03T02:01:33.219Z",
"traceId": "0000000000000abc"
}
}Example: {
"error": {
"code": "FICO-Platform-Http-422",
"desc": "Unprocessable Entity",
"innerError": {
"code": "FICO-Platform-Validation-TooLarge",
"desc": "Total attachment size exceeded",
"message": "Limit is 1 GB total attachment size per app\\/scenario"
},
"message": "Unprocessable Entity",
"spanId": "0000000000000123",
"timestamp": "1970-01-03T02:01:33.219Z",
"traceId": "0000000000000abc"
}
}
POST /api/apps/{appId}/attachments/files
Download multiple app attachment files as a zip archive.
Request Body
- Content-Type application/x-www-form-urlencoded
-
Properties
- ids: string[]
-
Array of string (uuid)
Request Parameters
Name | Description | Type | Data Type | |
---|---|---|---|---|
appId | The app ID |
path | string (uuid) | required |
Responses
- 200 OK
-
A binary stream of the zip file content
- Content-Type application/vnd.com.fico.xpress.insight.v2+zip
-
string (binary)
- 204 No Content
-
No attachments were requested
- 403 Forbidden
-
The user did not have authority to read the app attachment data
- 404 Not Found
-
The app or attachment did not exist or was unavailable to the current user
- Content-Type application/vnd.com.fico.xpress.insight.v2+zip
-
Empty response body
- Content-Type application/vnd.com.fico.xpress.insight.v2+json
Example: {
"error": {
"code": "FICO-Platform-Http-404",
"desc": "Not Found",
"innerError": {
"code": "OPTI-Insight-Persistence-DocumentNotFound",
"desc": "Document not found",
"message": "Unable to find document"
},
"message": "Not Found",
"spanId": "0000000000000123",
"timestamp": "1970-01-03T02:01:33.219Z",
"traceId": "0000000000000abc"
}
}
POST /api/apps/{appId}/attachments/trash
Delete multiple app attachments by providing a list of attachment IDs to delete.
Request Body
- Content-Type application/vnd.com.fico.xpress.insight.v2+json
Request Parameters
Name | Description | Type | Data Type | |
---|---|---|---|---|
appId | The app ID |
path | string (uuid) | required |
Responses
- 204 No Content
-
The attachments were successfully deleted
- 403 Forbidden
-
The user did not have authority to delete the app attachments
- 404 Not Found
-
The app did not exist or was unavailable to the current user
- Content-Type application/vnd.com.fico.xpress.insight.v2+json
Example: {
"error": {
"code": "FICO-Platform-Http-404",
"desc": "Not Found",
"innerError": {
"code": "OPTI-Insight-Persistence-DocumentNotFound",
"desc": "Document not found",
"message": "Unable to find document"
},
"message": "Not Found",
"spanId": "0000000000000123",
"timestamp": "1970-01-03T02:01:33.219Z",
"traceId": "0000000000000abc"
}
}
GET /api/apps/{appId}/attachments/{attachmentId}
Get the metadata for an app attachment.
Request Parameters
Name | Description | Type | Data Type | |
---|---|---|---|---|
appId | The app ID |
path | string (uuid) | required |
attachmentId | The attachment ID |
path | string (uuid) | required |
Responses
- 200 OK
-
The requested attachment
- Content-Type application/vnd.com.fico.xpress.insight.v2+json
- 404 Not Found
-
The app or attachment did not exist or was unavailable to the current user
- Content-Type application/vnd.com.fico.xpress.insight.v2+json
Example: {
"error": {
"code": "FICO-Platform-Http-404",
"desc": "Not Found",
"innerError": {
"code": "OPTI-Insight-Persistence-DocumentNotFound",
"desc": "Document not found",
"message": "Unable to find document"
},
"message": "Not Found",
"spanId": "0000000000000123",
"timestamp": "1970-01-03T02:01:33.219Z",
"traceId": "0000000000000abc"
}
}
DELETE /api/apps/{appId}/attachments/{attachmentId}
Delete an app attachment by ID.
Request Parameters
Name | Description | Type | Data Type | |
---|---|---|---|---|
appId | The app ID |
path | string (uuid) | required |
attachmentId | The attachment ID |
path | string (uuid) | required |
Responses
- 204 No Content
-
The attachment was successfully deleted
- Content-Type application/vnd.com.fico.xpress.insight.v2+json
-
Empty response body
- 403 Forbidden
-
The user did not have authority to delete the app attachment
- 404 Not Found
-
The app or attachment did not exist or was unavailable to the current user
- Content-Type application/vnd.com.fico.xpress.insight.v2+json
Example: {
"error": {
"code": "FICO-Platform-Http-404",
"desc": "Not Found",
"innerError": {
"code": "OPTI-Insight-Persistence-DocumentNotFound",
"desc": "Document not found",
"message": "Unable to find document"
},
"message": "Not Found",
"spanId": "0000000000000123",
"timestamp": "1970-01-03T02:01:33.219Z",
"traceId": "0000000000000abc"
}
}
PATCH /api/apps/{appId}/attachments/{attachmentId}
Update the metadata of an app attachment. Updatable fields include filename, description, tags and hidden visibility.
Request Body
- Content-Type application/vnd.com.fico.xpress.insight.v2+json
Request Parameters
Name | Description | Type | Data Type | |
---|---|---|---|---|
appId | The app ID |
path | string (uuid) | required |
attachmentId | The attachment ID |
path | string (uuid) | required |
Responses
- 200 OK
-
The updated attachment
- Content-Type application/vnd.com.fico.xpress.insight.v2+json
- 403 Forbidden
-
The user did not have authority to update the app attachment
- 404 Not Found
-
The app or attachment did not exist or was unavailable to the current user
- Content-Type application/vnd.com.fico.xpress.insight.v2+json
Example: {
"error": {
"code": "FICO-Platform-Http-404",
"desc": "Not Found",
"innerError": {
"code": "OPTI-Insight-Persistence-DocumentNotFound",
"desc": "Document not found",
"message": "Unable to find document"
},
"message": "Not Found",
"spanId": "0000000000000123",
"timestamp": "1970-01-03T02:01:33.219Z",
"traceId": "0000000000000abc"
}
} - 409 Conflict
-
The attachment metadata was not unique
- Content-Type application/vnd.com.fico.xpress.insight.v2+json
Example: {
"error": {
"code": "FICO-Platform-Http-409",
"desc": "Conflict",
"innerError": {
"code": "OPTI-Insight-Validation-DocumentAlreadyExists",
"desc": "Document already exists",
"message": "Document already exists"
},
"message": "Conflict",
"spanId": "0000000000000123",
"timestamp": "1970-01-03T02:01:33.219Z",
"traceId": "0000000000000abc"
}
} - 422 Unprocessable Entity
-
The IDs did not match or the filename was not permitted
- Content-Type application/vnd.com.fico.xpress.insight.v2+json
Example: {
"error": {
"code": "FICO-Platform-Http-422",
"desc": "Unprocessable Entity",
"innerError": {
"code": "OPTI-Insight-File-ExternalStorageInvalidPath",
"desc": "External storage file path invalid",
"message": "The requested path is not valid."
},
"message": "Unprocessable Entity",
"spanId": "0000000000000123",
"timestamp": "1970-01-03T02:01:33.219Z",
"traceId": "0000000000000abc"
}
}
GET /api/apps/{appId}/attachments/{attachmentId}/file
Download the content of an app attachment file.
Request Parameters
Name | Description | Type | Data Type | |
---|---|---|---|---|
appId | The app ID |
path | string (uuid) | required |
attachmentId | The attachment ID |
path | string (uuid) | required |
Responses
- 200 OK
-
A binary stream of the attachment file content
- Content-Type application/vnd.com.fico.xpress.insight.v2+octet-stream
-
string (binary)
- 403 Forbidden
-
The user did not have authority to read the app attachment data
- 404 Not Found
-
The app or attachment did not exist or was unavailable to the current user
- Content-Type application/vnd.com.fico.xpress.insight.v2+octet-stream
-
Empty response body
- Content-Type application/vnd.com.fico.xpress.insight.v2+json
Example: {
"error": {
"code": "FICO-Platform-Http-404",
"desc": "Not Found",
"innerError": {
"code": "OPTI-Insight-Persistence-DocumentNotFound",
"desc": "Document not found",
"message": "Unable to find document"
},
"message": "Not Found",
"spanId": "0000000000000123",
"timestamp": "1970-01-03T02:01:33.219Z",
"traceId": "0000000000000abc"
}
}
GET /api/scenarios/{scenarioId}/attachments
Get the metadata for all attachments belonging to a scenario.
Request Parameters
Name | Description | Type | Data Type | |
---|---|---|---|---|
page | Number of the page, starting at zero |
query | integer (int32) | |
scenarioId | The scenario ID |
path | string (uuid) | required |
size | Number of elements per page |
query | integer (int32) |
Responses
- 200 OK
-
The page of scenario attachments
- Content-Type application/vnd.com.fico.xpress.insight.v2+json
- 404 Not Found
-
The scenario did not exist or was unavailable to the current user
- Content-Type application/vnd.com.fico.xpress.insight.v2+json
Example: {
"error": {
"code": "FICO-Platform-Http-404",
"desc": "Not Found",
"innerError": {
"code": "OPTI-Insight-Persistence-DocumentNotFound",
"desc": "Document not found",
"message": "Unable to find document"
},
"message": "Not Found",
"spanId": "0000000000000123",
"timestamp": "1970-01-03T02:01:33.219Z",
"traceId": "0000000000000abc"
}
}
GET /api/scenarios/{scenarioId}/attachments/{attachmentId}
Get the metadata for a scenario attachment.
Request Parameters
Name | Description | Type | Data Type | |
---|---|---|---|---|
scenarioId | The scenario ID |
path | string (uuid) | required |
attachmentId | The attachment ID |
path | string (uuid) | required |
Responses
- 200 OK
-
The requested attachment
- Content-Type application/vnd.com.fico.xpress.insight.v2+json
- 404 Not Found
-
The scenario or attachment did not exist or was unavailable to the current user
- Content-Type application/vnd.com.fico.xpress.insight.v2+json
Example: {
"error": {
"code": "FICO-Platform-Http-404",
"desc": "Not Found",
"innerError": {
"code": "OPTI-Insight-Persistence-DocumentNotFound",
"desc": "Document not found",
"message": "Unable to find document"
},
"message": "Not Found",
"spanId": "0000000000000123",
"timestamp": "1970-01-03T02:01:33.219Z",
"traceId": "0000000000000abc"
}
}
GET /api/scenarios/{scenarioId}/attachments/{attachmentId}/file
Download the content of a scenario attachment file.
Request Parameters
Name | Description | Type | Data Type | |
---|---|---|---|---|
scenarioId | The scenario ID |
path | string (uuid) | required |
attachmentId | The attachment ID |
path | string (uuid) | required |
Responses
- 200 OK
-
A binary stream of the attachment file content
- Content-Type application/vnd.com.fico.xpress.insight.v2+octet-stream
-
string (binary)
- 404 Not Found
-
The scenario or attachment did not exist or was unavailable to the current user
- Content-Type application/vnd.com.fico.xpress.insight.v2+octet-stream
-
Empty response body
- Content-Type application/vnd.com.fico.xpress.insight.v2+json
Example: {
"error": {
"code": "FICO-Platform-Http-404",
"desc": "Not Found",
"innerError": {
"code": "OPTI-Insight-Persistence-DocumentNotFound",
"desc": "Document not found",
"message": "Unable to find document"
},
"message": "Not Found",
"spanId": "0000000000000123",
"timestamp": "1970-01-03T02:01:33.219Z",
"traceId": "0000000000000abc"
}
}
A file that is attached to an app or scenario
Properties
- app:
-
The app that this attachment belongs to
- contentUrl: string (uri)
-
The URL from which the contents of this attachment can be downloaded
- description: string
-
A description of this attachment
Example: "My file containing some data"
- filename: string
-
The file name of this attachment
Example: "my-attachment.txt"
- hidden: boolean
-
Whether the attachment is hidden. This indicates the attachment is not for general user interaction
Example: false
- id: string (uuid)
-
The ID of this attachment
Example: "b59b7e69-93ec-d814-4a64-8196c431e2c9"
- lastModified: string (date-time)
-
When the attachment contents were last modified
- lastModifiedBy:
-
The user who last modified this attachment
- name: string (1 to 255 chars) , must match ^[^\p{Cntrl}]*$ & ^\S(?:[\s\S]*\S)?$
-
The name of this attachment
Example: "my-attachment.txt"
- objectType: string , one of { ATTACHMENT }
-
- parent:
-
The parent of this attachment (either an app or a scenario). If the attachment is an app attachment, then the parent property will have the same value as the app property.
- size: integer (int64)
-
The size of this attachment in bytes
Example: 1000
- tags: string[]
-
The tags that are present on this attachment
Array of string - url: string (uri)
-
The URL of this attachment
Example: "/api/scenarios/e089a1eb-fe6f-db70-1f76-5e142fcab100/attachments/b59b7e69-93ec-d814-4a64-8196c431e2c9"
An error detail
Properties
- code: string
-
The unique code for this error
Example: "FICO_PLATFORM_VALIDATION_INVALID_VALUE"
- desc: string
-
A description of this error for client information, not intended for display to the end user
Example: "Conflict"
- message: string
-
A message providing further information which may be displayed to the end user
Example: "Conflict"
- target: string
-
An identifier to help the client locate the error. Typically a JSON property name.
- timestamp: string (date-time)
-
When the error was first detected
An error response containing fault or error information
Properties
- error:
-
The top level error
More specific error information
Properties
- code: string
-
The unique code for this error
Example: "FICO-Platform-Validation-FileTooLarge"
- desc: string
-
A description of this error for client information, not intended for display to the end user
Example: "Attachment upload too large"
- innerError:
-
More specific error information
- message: string
-
A message providing further information which may be displayed to the end user
Example: "Files larger than 300 MB cannot be uploaded as attachments."
The top level error
Properties
- code: string , one of { FICO-Platform-Http-400 , FICO-Platform-Http-404 , FICO-Platform-Http-409 , FICO-Platform-Http-413 , FICO-Platform-Http-422 , FICO-Platform-Http-423 , FICO-Platform-Http-429 , FICO-Platform-Http-500 , FICO-Platform-Http-503 }
-
The unique code for this error
Example: "FICO-Platform-Http-409"
- desc: string
-
A description of this error for client information, not intended for display to the end user
Example: "Conflict"
- details: object[]
-
Details about specific errors that led to this reported error
Array of ErrorDetail - innerError:
-
More specific error information
- message: string
-
A message providing further information which may be displayed to the end user
Example: "Conflict"
- parentId: string
-
An OpenTracing parent-span ID
Example: "0020000000000001"
- spanId: string
-
An OpenTracing span ID
Example: "b2fb4a1d1a96d312"
- timestamp: string (date-time)
-
When the error was first detected
- traceId: string
-
An OpenTracing trace ID
Example: "463ac35c9f6413ad48485a3953bb6125"
A page containing a subset of content which can be paginated through
Properties
- content: object[]
-
The items in this page of results
Array of Attachment - first: boolean
-
Whether this is the first page
Example: false
- last: boolean
-
Whether this is the last page
Example: true
- number: integer (int32)
-
The page number, starting at 0
Example: 4
- numberOfElements: integer (int32)
-
The number of elements in this page of results
Example: 18
- size: integer (int32)
-
The number of results per page
Example: 20
- sort:
-
The sort order applied to the results
- totalElements: integer (int32)
-
The total number of elements in all the pages
Example: 98
- totalPages: integer (int32)
-
The total number of pages
Example: 5
The basic details of an app
Properties
- id: string (uuid)
-
The ID of this app
Example: "00007eff-83f9-05fe-ffff-81007c05fc01"
- name: string (1 to 255 chars) , must match ^[^\p{Cntrl}]*$ & ^\S(?:[\s\S]*\S)?$
-
The name of this app
Example: "My app"
- objectType: string , one of { APP }
-
- url: string (uri)
-
The URL of this app
Example: "/api/apps/00007eff-83f9-05fe-ffff-81007c05fc01"
The basic details of a user
Properties
- id: string (uuid)
-
The ID of this user
Example: "0013ebae-4d4c-793c-ffec-1451b28ba2f9"
- name: string (1 to 255 chars) , must match ^[^\p{Cntrl}]*$ & ^\S(?:[\s\S]*\S)?$
-
The name of this user
Example: "My user"
- objectType: string , one of { USER }
-
- url: string (uri)
-
The URL of this user
Example: "/api/admin/users/0013ebae-4d4c-793c-ffec-1451b28ba2f9"
© 2001-2021 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.