Update an attachment
/crmRestApi/resources/11.13.18.05/opportunities/{OptyNumber}/child/Attachment/{AttachmentUniqID}
Request
-
AttachmentUniqID(required): string
This is the hash key of the attributes which make up the composite key for the Opportunity Attachments resource and used to uniquely identify an instance of Opportunity Attachments. The client should not generate the hash key value. Instead, the client should query on the Opportunity Attachments collection resource in order to navigate to a specific instance of Opportunity Attachments to get the hash key.
-
OptyNumber(required): string
The unique alternate identifier for the opportunity.
-
Metadata-Context: string
If the REST API supports runtime customizations, the shape of the service may change during runtime. The REST client may isolate itself from these changes or choose to interact with the latest version of the API by specifying this header. For example: Metadata-Context:sandbox="TrackEmployeeFeature".
-
REST-Framework-Version: string
The protocol version between a REST client and service. If the client does not specify this header in the request the server will pick a default version for the API.
- application/json
object-
CategoryName: string
Title:
CategoryMaximum Length:30The name of the category of the attachment. - ContentRepositoryFileShared: boolean
-
DatatypeCode: string
Title:
TypeMaximum Length:30Default Value:FILEThe code indicating the type of the data. -
Description: string
Title:
DescriptionMaximum Length:255The description of the attachment. -
DmDocumentId: string
Maximum Length:
255The unique identifier of the attached document. -
DmFolderPath: string
Title:
Dm Folder PathMaximum Length:1000The folder path of the attachment. -
DmVersionNumber: string
Maximum Length:
255The current version number of the attachment. -
DownloadInfo: string
Title:
DownloadInfoJSON object represented as a string containing information used to programmatically retrieve a file attachment. -
ErrorStatusCode: string
Title:
Error Status CodeThe code indicating the type of error, if any, for the attachment. -
ErrorStatusMessage: string
Title:
Error Status MessageThe error message, if any, for the attachment. -
ExpirationDate: string
(date-time)
Title:
Expiration DateThe date when the contents in the attachment expire. -
FileContents: string
(byte)
Title:
File ContentsThe contents of the attachment. -
FileName: string
Title:
File NameMaximum Length:2048The file name of the attachment. -
FileUrl: string
Title:
File UrlThe URL of the attachment. -
PostProcessingAction: string
Title:
PostProcessingActionThe name of the action that can be performed after an attachment is uploaded. -
Title: string
Title:
TitleThe title of the attachment. -
UploadedFileContentType: string
Title:
Uploaded File Content TypeThe content type of the attachment. -
UploadedFileLength: integer
Title:
File SizeThe length of the attachment file. -
UploadedFileName: string
Title:
Uploaded File NameThe name of the attachment file. -
UploadedText: string
Title:
Uploaded TextThe text of the attachment. -
Uri: string
Title:
UriMaximum Length:4000The URI of the attachment. -
Url: string
Title:
UrlMaximum Length:4000The URL of the attachment.
Response
- application/json
Default Response
-
Metadata-Context:
If the REST API supports runtime customizations, the shape of the service may change during runtime. The REST client may isolate itself from these changes or choose to interact with the latest version of the API by specifying this header. For example: Metadata-Context:sandbox="TrackEmployeeFeature".
-
REST-Framework-Version:
The protocol version between a REST client and service. If the client does not specify this header in the request the server will pick a default version for the API.
object-
AsyncTrackerId: string
Title:
Asynchronous Upload Tracker IdThe unique identifier used for tracking the uploaded files. -
AttachedDocumentId: integer
(int64)
Title:
Attached Document IdThe unique identifier of the attachment. -
CategoryName: string
Title:
CategoryMaximum Length:30The name of the category of the attachment. - ContentRepositoryFileShared: boolean
-
CreatedBy: string
Title:
Created ByRead Only:trueMaximum Length:255The user who created the attachment. -
CreatedByUserName: string
Title:
Created By User NameRead Only:trueThe login of the user who created the attachment. -
CreationDate: string
(date-time)
Title:
Creation DateRead Only:trueThe date when the attachment record was created. -
DatatypeCode: string
Title:
TypeMaximum Length:30Default Value:FILEThe code indicating the type of the data. -
Description: string
Title:
DescriptionMaximum Length:255The description of the attachment. -
DmDocumentId: string
Maximum Length:
255The unique identifier of the attached document. -
DmFolderPath: string
Title:
Dm Folder PathMaximum Length:1000The folder path of the attachment. -
DmVersionNumber: string
Maximum Length:
255The current version number of the attachment. -
DownloadInfo: string
Title:
DownloadInfoJSON object represented as a string containing information used to programmatically retrieve a file attachment. -
ErrorStatusCode: string
Title:
Error Status CodeThe code indicating the type of error, if any, for the attachment. -
ErrorStatusMessage: string
Title:
Error Status MessageThe error message, if any, for the attachment. -
ExpirationDate: string
(date-time)
Title:
Expiration DateThe date when the contents in the attachment expire. -
FileContents: string
(byte)
Title:
File ContentsThe contents of the attachment. -
FileName: string
Title:
File NameMaximum Length:2048The file name of the attachment. -
FileUrl: string
Title:
File UrlThe URL of the attachment. -
FileWebImage: string
(byte)
Title:
File Web ImageRead Only:trueThe base64 encoded image of the file displayed in .png format if the source is a convertible image. -
LastUpdateDate: string
(date-time)
Title:
Last Update DateRead Only:trueThe date when the record was last updated. -
LastUpdatedBy: string
Title:
Last Updated ByRead Only:trueMaximum Length:255The user who last updated the record. -
LastUpdatedByUserName: string
Title:
Last Updated By UserRead Only:trueThe login of the user who last updated the attachment. -
links: array
Links
Title:
LinksThe link relations associated with the resource instance. -
PostProcessingAction: string
Title:
PostProcessingActionThe name of the action that can be performed after an attachment is uploaded. -
Title: string
Title:
TitleThe title of the attachment. -
UploadedFileContentType: string
Title:
Uploaded File Content TypeThe content type of the attachment. -
UploadedFileLength: integer
Title:
File SizeThe length of the attachment file. -
UploadedFileName: string
Title:
Uploaded File NameThe name of the attachment file. -
UploadedText: string
Title:
Uploaded TextThe text of the attachment. -
Uri: string
Title:
UriMaximum Length:4000The URI of the attachment. -
Url: string
Title:
UrlMaximum Length:4000The URL of the attachment. -
UserName: string
Title:
User NameRead Only:trueMaximum Length:255The login associated with the attachment.
arrayLinksobject-
href: string
Title:
hyperlink referenceThe URI to the related resource. -
kind: string
Title:
kindAllowed Values:[ "collection", "item", "describe", "other" ]The kind of the related resource. -
name: string
Title:
nameThe name of the link to the related resource. -
properties: object
properties
-
rel: string
Title:
relationAllowed Values:[ "self", "lov", "parent", "canonical", "child", "enclosure", "action", "custom" ]The name of the relation to the resource instance. Example: self.
object-
changeIndicator: string
Change indicator or the ETag value of the resource instance.
Examples
The following example shows how to update an Opportunity attachment by submitting a POST request on the REST resource using cURL.
Update a FILE Type attachment
cURL Command
curl --user
sales_cloud_user @example_request_payload.json https://servername.fa.us2.oraclecloud.com/crmRestApi/resources/11.13.18.05/opportunities/CDRM_117503/child/Attachment/00020000000EACED00057708000110F08228F0640000000EACED00057708000110F08228F063
Example of Request Body
The following shows an example of the request body in JSON format.
{
"CategoryName": "MISC",
"DatatypeCode": "FILE",
"FileContents": "VGVzdCBjb250ZW50IHVwZGF0ZWQgMTIz",
"Title" : "Sample File attachment 07/28 test 123 Updated",
"FileName": "New_Test_Attachment_Updated.txt"
}Example of Response Body
The following example shows the contents of the response body in JSON format.
{
"LastUpdateDate":"2015-07-28T03:24:07-07:00",
"LastUpdatedBy":"SALES_ADMIN",
"EntityName":"MOO_OPTY",
"Pk1Value":"300100054323876",
"Pk2Value":null,
"Pk3Value":null,
"Pk4Value":null,
"Pk5Value":null,
"DatatypeCode":"FILE",
"FileName":"New_Test_Attachment_Updated.txt",
"DmFolderPath":null,
"DmDocumentId":"UCMFA004839",
"DmVersionNumber":"4040",
"Url":null,
"CategoryName":"MISC",
"UserName":"Miscellaneous",
"Uri":null,
"EntAppShortName":null,
"FileUrl": "/content/conn/FusionAppsContentRepository/uuid/dDocID%3a21564?&XFND_SCHEME_ID=1&XFND_CERT_FP=09B5C8AE7FFF1BC26FF8FFE8603DB27633015773&XFND_RANDOM=-5629498665627234903&XFND_EXPIRES=1501846632749&XFND_SIGNATURE=mgAmTnh0VhJgFOCQetpr-F7qla0ijIUVltQFXu~1LCfMi4QhqUViwdSgSa5RF8i2dkkjRztxHZIcoXX51drmgtI24txYNYKJeFmnhWrKr3volf~nLqJfwKvJiGigTK4hIsfoYVJoNS1imIdKFGiGy7bB0AqLemCrTCcHoIHEj23FDSqyJ31m48kwTa7pHUcXVmPxr0h-P177stprfjsfBoxh4bHQaLZwAHOVxV4UHmpfxNb1GbX6q9LOTFdSnvE2mEbGdxs98sf1Rv5LKsTL3aU~KzmS-JeizMv0t8IRrBJi6sOJs-seWAFxvOrRAvtXYpVdCBj6Axsq9PyoP8LXDg__&Id=21564&download",
"UploadedText":null,
"UploadedFileContentType":"text/plain",
"UploadedFileLength":24,
"UploadedFileName":"New_Test_Attachment_Updated.txt",
"ContentRepositoryFileShared":"false",
"Title":"Sample File attachment 07/28 test 123 Updated",
"Description":"",
"ErrorStatusCode":null,
"ErrorStatusMessage":null,
"CreatedBy":"SALES_ADMIN",
"CreationDate":"2015-07-28T03:24:05-07:00",
...
}
Update a TEXT Type attachment
cURL Command
curl --user
sales_cloud_user @example_request_payload.json https://servername.fa.us2.oraclecloud.com/crmRestApi/resources/11.13.18.05/opportunities/CDRM_117503/child/Attachment/00020000000EACED00057708000110F08228F0640000000EACED00057708000110F08228F063
Example of Request Body
The following shows an example of the request body in JSON format.
{
"CategoryName": "MISC",
"DatatypeCode": "TEXT",
"UploadedText": "Sample Text 07/28 test 1111 Updated"
}Example of Response Body
The following example shows the contents of the response body in JSON format.
{
"LastUpdateDate" : "2015-07-28T03:28:18-07:00",
"LastUpdatedBy" : "SALES_ADMIN",
"EntityName" : "MOO_OPTY",
"Pk1Value" : "300100054323876",
"Pk2Value" : null,
"Pk3Value" : null,
"Pk4Value" : null,
"Pk5Value" : null,
"DatatypeCode" : "TEXT",
"FileName" : "Sample Text 07/28 test 1111",
"DmFolderPath" : null,
"DmDocumentId" : "UCMFA004840",
"DmVersionNumber" : "4041",
"Url" : null,
"CategoryName" : "MISC",
"UserName" : "Miscellaneous",
"Uri" : null,
"EntAppShortName" : null,
"FileUrl":
"/content/conn/FusionAppsContentRepository/uuid/dDocID%3a21577?XFND_SCHEME_ID=1&XFND_CERT_FP=09B5C8AE7FFF1BC26FF8FFE8603DB27633015773&XFND_RANDOM=1538444565440720007&XFND_EXPIRES=1501852824575&XFND_SIGNATURE=dTvPLbcQLKUrLCDNo1fh4wfO~gd~yuSW-yX2BAN1zXjMJxZOflWPDpfN2fi3LsD7Uqdi9J3MHnLrBkBQ7DuDwgg8DRi8lRe5B-wZMrFhnFbQmsC7Y94~gdfMi9kfnGbuFhiZFlwnMpUrOyox-9fdq8Y2swZp8gOHa6KNg-LwaYTqSBlnoocvATPyJhrwj5JJSP1spNLvkRhz0XRWL8qES3dUzOh1aydVSzUjHjzuhxB-c13F4OGsbuKUtloWjt5qVlAiLF9wrk9F40WqtCy71qAy3Y5v9WPyvogvcz7d~q4xZbyXtiIXrYJVQfOclT1RiK-N55-xW7pA2VJYm8HdlQ__&Id=21577&download",
"UploadedText" : null,
"UploadedFileContentType" : "text/plain",
"UploadedFileLength" : 38,
"UploadedFileName" : "SALES_ADMIN-1438080896000.txt",
"ContentRepositoryFileShared" : "false",
"Title" : "Sample Text 07/28 test 1111",
"Description" : "",
"ErrorStatusCode" : null,
"ErrorStatusMessage" : null,
"CreatedBy" : "SALES_ADMIN",
"CreationDate" : "2015-07-28T03:28:17-07:00",
...
}Update a WEB_URL Type attachment
cURL Command
curl --user
sales_cloud_user @example_request_payload.json https://servername.fa.us2.oraclecloud.com/crmRestApi/resources/11.13.18.05/opportunities/CDRM_117503/child/Attachment/00020000000EACED00057708000110F08228F0640000000EACED00057708000110F08228F063
Example of Request Body
The following shows an example of the request body in JSON format.
{
"CategoryName": "MISC",
"DatatypeCode": "WEB_PAGE",
"Url": "http://www.oracle.com"
}Example of Response Body
The following example shows the contents of the response body in JSON format.
{
"LastUpdateDate": "2017-08-04T13:20:38.262+00:00",
"LastUpdatedBy": "SALES_ADMIN",
"DatatypeCode": "WEB_PAGE",
"FileName": null,
"DmFolderPath": null,
"Url": "http://www.oracle.com",
"CategoryName": "MISC",
"UserName": null,
"Url" : "http://www.google.com",
"FileUrl": null,
"UploadedText": null,
"UploadedFileContentType": null,
"UploadedFileLength": null,
"UploadedFileName": null,
"ContentRepositoryFileShared": "false",
"Title": "http://www.oracle.com",
"Description": "",
"ErrorStatusCode": null,
"ErrorStatusMessage": null,
"CreatedBy": "SALES_ADMIN",
"CreationDate": "2017-08-04T13:20:38.206+00:00",
"ExpirationDate": null,
...
}