Update an attachment

patch

/crmRestApi/resources/11.13.18.05/opportunities/{OptyNumber}/child/Attachment/{AttachmentUniqID}

Request

Path Parameters
  • 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.
  • The unique alternate identifier for the opportunity.
Header Parameters
  • 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".
  • 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.
Supported Media Types
Request Body - application/json ()
Root Schema : schema
Type: object
Show Source
Back to Top

Response

Supported Media Types

Default Response

The following table describes the default response for this task.
Headers
  • 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".
  • 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.
Body ()
Root Schema : opportunities-Attachment-item-response
Type: object
Show Source
Back to Top

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,
  ...
}
Back to Top