Oracle CRM On Demand REST API Developer's Guide > Using the Oracle CRM On Demand REST API > Working with Resource Attachments >

Updating an Attachment


You can replace an Oracle CRM On Demand resource attachment with an attachment specified in the request by sending an HTTP PUT request to the resource's URL.

NOTE:  The PUT HTTP method is only supported for Update REST API operations for enclosure attachments.

The following details are for a request to update an attachment on the Oracle CRM On Demand Server:

  • URL: https://<host>/OnDemand/user/Rest/latest/CustomObjects8/1QA2-1S4YSD/enclosure/Attachment
  • HTTP Method: PUT
  • Content-Type: json
  • Request body:

{"CustomObjects8":[
  {
    "Attachment":"Q3JpY2tldCBpcyBhIGJhdC1hbmQtYmFsbCBnYW1lIHBsYXllZCBiZXR3ZWVuIHR3byB0ZWFtcyBvZiAxMSBwbGF5ZXJzIGVhY2ggb24gYSBmaWVsZCBhdCB0aGUgY2VudHJlIG9mIHdoaWNoIGlzIGEgcmVjdGFuZ3VsYXIgMjIteWFyZCBsb25nIHBpdGNoLiBFYWNoIHRlYW0gdGFrZXMgaXRzIHR1cm4gdG8gYmF0LCBhdHRlbXB0aW5nIHRvIHNjb3JlIHJ1bnMsIHdoaWxlIHRoZSBvdGhlciB0ZWFtIGZpZWxkcy4gRWFjaCB0dXJuIGlzIGtub3duIGFzIGFuIGlubmluZ3Mu",
    "AttachFileName":"Cricket",
    "AttachFileExt":"txt"}]
  }

The following are the details for the response to a successful request:

  • HTTP Code: 200
  • Content-Type: <enclosure dependent>
  • Location: https://<host>/OnDemand/user/Rest/latest/CustomObjects8/1QA2-1S4YSD/enclosure/Attachment
  • Response body:

{"CustomObjects8":[
  {
    "Attachment":"Q3JpY2tldCBpcyBhIGJhdC1hbmQtYmFsbCBnYW1lIHBsYXllZCBiZXR3ZWVuIHR3byB0ZWFtcyBvZiAxMSBwbGF5ZXJzIGVhY2ggb24gYSBmaWVsZCBhdCB0aGUgY2VudHJlIG9mIHdoaWNoIGlzIGEgcmVjdGFuZ3VsYXIgMjIteWFyZCBsb25nIHBpdGNoLiBFYWNoIHRlYW0gdGFrZXMgaXRzIHR1cm4gdG8gYmF0LCBhdHRlbXB0aW5nIHRvIHNjb3JlIHJ1bnMsIHdoaWxlIHRoZSBvdGhlciB0ZWFtIGZpZWxkcy4gRWFjaCB0dXJuIGlzIGtub3duIGFzIGFuIGlubmluZ3Mu",
    "AttachFileName":"Cricket",
    "AttachFileExt":"txt"}]
  }

Oracle CRM On Demand REST API Developer's Guide, Release 32 Copyright © 2016, Oracle and/or its affiliates. All rights reserved. Legal Notices.