| Method | HTTP request | Release Stage |
|---|---|---|
| get | GET /v2/ontologies/attachments/{attachmentRid} | Stable |
| read | GET /v2/ontologies/attachments/{attachmentRid}/content | Stable |
| upload | POST /v2/ontologies/attachments/upload | Stable |
| upload_with_rid | POST /v2/ontologies/attachments/upload/{attachmentRid} | Private Beta |
Get the metadata of an attachment.
| Name | Type | Description | Notes |
|---|---|---|---|
| attachment_rid | AttachmentRid | The RID of the attachment. |
AttachmentV2
from foundry_sdk import FoundryClient
import foundry_sdk
from pprint import pprint
client = FoundryClient(auth=foundry_sdk.UserTokenAuth(...), hostname="example.palantirfoundry.com")
# AttachmentRid | The RID of the attachment.
attachment_rid = "ri.attachments.main.attachment.bb32154e-e043-4b00-9461-93136ca96b6f"
try:
api_response = client.ontologies.Attachment.get(attachment_rid)
print("The get response:\n")
pprint(api_response)
except foundry_sdk.PalantirRPCException as e:
print("HTTP error when calling Attachment.get: %s\n" % e)See README
| Status Code | Type | Description | Content Type |
|---|---|---|---|
| 200 | AttachmentV2 | Success response. | application/json |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Get the content of an attachment.
| Name | Type | Description | Notes |
|---|---|---|---|
| attachment_rid | AttachmentRid | The RID of the attachment. |
bytes
from foundry_sdk import FoundryClient
import foundry_sdk
from pprint import pprint
client = FoundryClient(auth=foundry_sdk.UserTokenAuth(...), hostname="example.palantirfoundry.com")
# AttachmentRid | The RID of the attachment.
attachment_rid = "ri.attachments.main.attachment.bb32154e-e043-4b00-9461-93136ca96b6f"
try:
api_response = client.ontologies.Attachment.read(attachment_rid)
print("The read response:\n")
pprint(api_response)
except foundry_sdk.PalantirRPCException as e:
print("HTTP error when calling Attachment.read: %s\n" % e)See README
| Status Code | Type | Description | Content Type |
|---|---|---|---|
| 200 | bytes | Success response. | / |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Upload an attachment to use in an action. Any attachment which has not been linked to an object via
an action within one hour after upload will be removed.
Previously mapped attachments which are not connected to any object anymore are also removed on
a biweekly basis.
The body of the request must contain the binary content of the file and the Content-Type header must be application/octet-stream.
| Name | Type | Description | Notes |
|---|---|---|---|
| body | bytes | Body of the request | |
| content_length | ContentLength | The size in bytes of the file content being uploaded. | |
| content_type | ContentType | The media type of the file being uploaded. | |
| filename | Filename | The name of the file being uploaded. |
AttachmentV2
from foundry_sdk import FoundryClient
import foundry_sdk
from pprint import pprint
client = FoundryClient(auth=foundry_sdk.UserTokenAuth(...), hostname="example.palantirfoundry.com")
# bytes | Body of the request
body = None
# ContentLength | The size in bytes of the file content being uploaded.
content_length = None
# ContentType | The media type of the file being uploaded.
content_type = None
# Filename | The name of the file being uploaded.
filename = "My Image.jpeg"
try:
api_response = client.ontologies.Attachment.upload(
body, content_length=content_length, content_type=content_type, filename=filename
)
print("The upload response:\n")
pprint(api_response)
except foundry_sdk.PalantirRPCException as e:
print("HTTP error when calling Attachment.upload: %s\n" % e)See README
| Status Code | Type | Description | Content Type |
|---|---|---|---|
| 200 | AttachmentV2 | Success response. | application/json |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
This endpoint is identical to /v2/ontologies/attachments/upload but additionally accepts a previously
generated AttachmentRid.
| Name | Type | Description | Notes |
|---|---|---|---|
| attachment_rid | AttachmentRid | The AttachmentRid of the attachment being uploaded. |
|
| body | bytes | Body of the request | |
| content_length | ContentLength | The size in bytes of the file content being uploaded. | |
| content_type | ContentType | The media type of the file being uploaded. | |
| filename | Filename | The name of the file being uploaded. | |
| preview | Optional[PreviewMode] | A boolean flag that, when set to true, enables the use of beta features in preview mode. | [optional] |
AttachmentV2
from foundry_sdk import FoundryClient
import foundry_sdk
from pprint import pprint
client = FoundryClient(auth=foundry_sdk.UserTokenAuth(...), hostname="example.palantirfoundry.com")
# AttachmentRid | The `AttachmentRid` of the attachment being uploaded.
attachment_rid = "ri.attachments.main.attachment.bb32154e-e043-4b00-9461-93136ca96b6f"
# bytes | Body of the request
body = None
# ContentLength | The size in bytes of the file content being uploaded.
content_length = None
# ContentType | The media type of the file being uploaded.
content_type = None
# Filename | The name of the file being uploaded.
filename = "My Image.jpeg"
# Optional[PreviewMode] | A boolean flag that, when set to true, enables the use of beta features in preview mode.
preview = None
try:
api_response = client.ontologies.Attachment.upload_with_rid(
attachment_rid,
body,
content_length=content_length,
content_type=content_type,
filename=filename,
preview=preview,
)
print("The upload_with_rid response:\n")
pprint(api_response)
except foundry_sdk.PalantirRPCException as e:
print("HTTP error when calling Attachment.upload_with_rid: %s\n" % e)See README
| Status Code | Type | Description | Content Type |
|---|---|---|---|
| 200 | AttachmentV2 | Success response. | application/json |
[Back to top] [Back to API list] [Back to Model list] [Back to README]