Create an attachment

post

/crmRestApi/resources/11.13.18.05/serviceRequests/{SrNumber}/child/messages/{MessageId}/child/Attachment

Request

Path Parameters
  • The unique identifier of the service request message.
  • The unique number that is used to identify a service request. You can configure the service request number to a format that is best suitable to your organizational requirements. For example, service request may have the formats service request0000012345, service request_000_12345, 12345_00_service request, and so on depending on your requirements.
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.
  • Contains one of the following values: true or false. If true, the server performs an Upsert operation instead of a Create operation. During an Upsert operation, the server attempts to find an existing resource that matches the payload. If a match is found, the server updates the existing resource instead of creating a new one. If not found or false (default), the server performs a Create operation. Note that the Upsert operation isn't supported for date-effective REST resources.
Supported Media Types
Request Body - application/json ()
Root Schema : schema
Type: object
Show Source
Nested Schema : AttachmentsDFFVL
Type: array
Show Source
Nested Schema : Attachments Preview
Type: array
Title: Attachments Preview
The attachments preview resource is used to preview the attachment pages.
Show Source
Nested Schema : serviceRequests-messages-Attachment-AttachmentsDFFVL-item-post-request
Type: object
Show Source
Nested Schema : serviceRequests-messages-Attachment-AttachmentsPreview-item-post-request
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 : serviceRequests-messages-Attachment-item-response
Type: object
Show Source
Nested Schema : AttachmentsDFFVL
Type: array
Show Source
Nested Schema : Attachments Preview
Type: array
Title: Attachments Preview
The attachments preview resource is used to preview the attachment pages.
Show Source
Nested Schema : serviceRequests-messages-Attachment-AttachmentsDFFVL-item-response
Type: object
Show Source
Nested Schema : serviceRequests-messages-Attachment-AttachmentsPreview-item-response
Type: object
Show Source
Back to Top

Examples

The following example shows how to create an attachment by submitting a POST request on the REST resource.

Example of Request Header

The following shows an example of the request header.

POST /crmRestApi/resources/11.13.18.05/serviceRequests/SR0000002001/child/messages/300100090124787/child/Attachment HTTP/1.1
HOST: servername.fa.us2.oraclecloud.com
authorization: Basic U0FMRVNfQURNSU46V2VsY29tZTE=
content-type: application/vnd.oracle.adf.resourceitem+json

Example of Request Body

The following example shows the contents of the request body in JSON format.

{
"DatatypeCode" : "FILE",
"FileName" : "abc1.txt",
"Description" : "The alphabet",
"FileContents" : "U29sYWkgQWxhZ2FwcGFu",
"CategoryName" : "MISC"
}

Example of Response Header

The following shows an example of the response header.

HTTP/1.1 201: Created
Date: Mon, 14 Nov 2016 14:39:39 GMT
Server: Oracle-HTTP-Server-11g
Content-Type: application/vnd.oracle.adf.resourceitem+json
Content-Language: en

Example of Response Body

The following example shows the contents of the response body in JSON format.

{
"LastUpdateDate": "2016-11-14T06:39:39-08:00",
"LastUpdatedBy": "SALES_ADMIN",
"DatatypeCode": "FILE",
"FileName": "abc1.txt",
"DmFolderPath": null,
"Url": null,
"CategoryName": "MISC",
"UserName": null,
"Uri": null,
"FileUrl": "/content/conn/FusionAppsContentRepository/uuid/dDocID%3a7632?XFND_SCHEME_ID=1&XFND_CERT_FP=799EDAB7820F013D866DB151E62B45D5DBDD804B&XFND_RANDOM=3000445710728612335&XFND_EXPIRES=1479134980060&XFND_SIGNATURE=eRjSnmH8TEyzneJdDXk5AZAGHaS0~VPpdxIVMMqcrZ4XkSBhgqWTLZaZGVZ5meslN0vnHRCDuD0blwYjfaWyQB48w3fsRMLl5u99T32nbN2jejvGsN9HeKRdbA0bmCyL6j7oFlzjikfpuaBIjGhGMWzdmpX~4ZJtxWch-ACnYS42rMfv5HsxQRRoCfx0tLCkEirmEp8lbgEMOjD5p9UkzzuXj5IzVjD2WbOV72MIXsNIp870b0gkEbcCsZMnqKI7t~j-J~5WokkFcfz1IabiZZb5E01HYRhNX40sV0Z~TTNyP3Km4NJ8J~xu9a-86cC~uVqdk8Vn3aT4SrHMb5~-DA__&Id=7632&download",
"UploadedText": null,
"UploadedFileContentType": "text/plain",
"UploadedFileLength": 15,
"UploadedFileName": "abc1.txt",
"ContentRepositoryFileShared": "false",
"Title": "abc1.txt",
"Description": "The alphabet",
"ErrorStatusCode": null,
"ErrorStatusMessage": null,
"CreatedBy": "SALES_ADMIN",
"CreationDate": "2016-11-14T06:39:39-08:00",
"ExpirationDate": null,
"links": [
  
{
"rel": "self",
"href": "http://servername.fa.us2.oraclecloud.com/crmRestApi/resources/11.13.18.05/serviceRequests/SR0000002001/child/messages/300100090124787/child/Attachment/00020000000EACED00057708000110F07F4B13A20000000EACED00057708000110F07F4B13A1",
"name": "Attachment",
"kind": "item"
}
,
  
{
"rel": "canonical",
"href": "http://servername.fa.us2.oraclecloud.com/crmRestApi/resources/11.13.18.05/serviceRequests/SR0000002001/child/messages/300100090124787/child/Attachment/00020000000EACED00057708000110F07F4B13A20000000EACED00057708000110F07F4B13A1",
"name": "Attachment",
"kind": "item"
}
,
  
{
"rel": "parent",
"href": "http://servername.fa.us2.oraclecloud.com/crmRestApi/resources/11.13.18.05/serviceRequests/SR0000002001/child/messages/300100090124787",
"name": "messages",
"kind": "item"
}
,
  
{
"rel": "enclosure",
"href": "http://servername.fa.us2.oraclecloud.com/crmRestApi/resources/11.13.18.05/serviceRequests/SR0000002001/child/messages/300100090124787/child/Attachment/00020000000EACED00057708000110F07F4B13A20000000EACED00057708000110F07F4B13A1/enclosure/FileContents",
"name": "FileContents",
"kind": "other"
}
],
}
Back to Top