Update an attachment
patch
/hcmRestApi/resources/11.13.18.05/documentRecords/{DocumentsOfRecordId}/child/attachments/{attachmentsUniqID}
Request
Path Parameters
-
DocumentsOfRecordId(required): integer(int64)
Surrogate identifier for the record. Applicable to existing records only.
-
attachmentsUniqID(required): string
This is the hash key of the attributes which make up the composite key for the Attachments resource and used to uniquely identify an instance of Attachments. The client should not generate the hash key value. Instead, the client should query on the Attachments collection resource in order to navigate to a specific instance of Attachments to get the hash key.
Header Parameters
-
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.
Supported Media Types
- application/json
Root Schema : schema
Type:
Show Source
object
-
AttachmentsPreview: array
Attachment Previews
Title:
Attachment Previews
The attachments preview resource is used to preview the attachment pages. -
CategoryName: string
Title:
Category
Maximum Length:30
Category name for the document type. - ContentRepositoryFileShared: boolean
-
DatatypeCode: string
Title:
Type
Maximum Length:30
Default Value:FILE
Attachment type such as FILE, TEXT, or WEB_PAGE. -
Description: string
Title:
Description
Maximum Length:255
Description of the attachment. -
DmDocumentId: string
Maximum Length:
255
Unique identifier for the document. -
DmFolderPath: string
Title:
Dm Folder Path
Maximum Length:1000
Path of the folder where the attachment is stored. -
DmVersionNumber: string
Maximum Length:
255
Version number of the document attachment. -
DownloadInfo: string
Title:
DownloadInfo
JSON object represented as a string containing information used to programmatically retrieve a file attachment. -
ErrorStatusCode: string
Title:
Error Status Code
Status code of the error. -
ErrorStatusMessage: string
Title:
Error Status Message
Error message that is displayed. -
ExpirationDate: string
(date-time)
Title:
Expiration Date
Expiry date of the document record attachment. -
FileContents: string
(byte)
Title:
File Contents
Attribute for providing the file content. -
FileName: string
Title:
File Name
Maximum Length:2048
Name of the file attached by the user. -
FileUrl: string
Title:
File Url
Relative path for downloading the attachment file. -
Title: string
Title:
Title
Title of the attachment. -
UploadedFileContentType: string
Title:
Uploaded File Content Type
Type of the content file uploaded. -
UploadedFileLength: integer
Title:
File Size
Length of the content file uploaded. -
UploadedFileName: string
Title:
Uploaded File Name
Name of uploaded file. -
UploadedText: string
Title:
Uploaded Text
Text that is uploaded to the content repository. -
Uri: string
Title:
Uri
Maximum Length:4000
Uniform Resource Identifier of the uploaded file. -
Url: string
Title:
Url
Maximum Length:4000
Uniform Resource Identifier of the document attachment.
Nested Schema : Attachment Previews
Type:
array
Title:
Attachment Previews
The attachments preview resource is used to preview the attachment pages.
Show Source
Nested Schema : documentRecords-attachments-AttachmentsPreview-item-patch-request
Type:
Show Source
object
Response
Supported Media Types
- application/json
Default Response
The following table describes the default response for this task.
Headers
-
Metadata-Context(required):
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(required):
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.
Root Schema : documentRecords-attachments-item-response
Type:
Show Source
object
-
AsyncTrackerId: string
Title:
Asynchronous Upload Tracker Id
Identifier provided by the Attachments UI component for the exclusive use of assisting in uploading files. -
AttachedDocumentId: integer
(int64)
Title:
Attached Document Id
Surrogate identifier for the record. Applicable to existing records only. -
AttachmentsPreview: array
Attachment Previews
Title:
Attachment Previews
The attachments preview resource is used to preview the attachment pages. -
CategoryName: string
Title:
Category
Maximum Length:30
Category name for the document type. - ContentRepositoryFileShared: boolean
-
CreatedBy: string
Title:
Created By
Read Only:true
Maximum Length:255
Name of the user who created the document record attachment. -
CreatedByUserName: string
Title:
Created By User Name
Read Only:true
Name of the user who created the document record attachment. -
CreationDate: string
(date-time)
Title:
Creation Date
Read Only:true
Date on which the document record attachment was created. -
DatatypeCode: string
Title:
Type
Maximum Length:30
Default Value:FILE
Attachment type such as FILE, TEXT, or WEB_PAGE. -
Description: string
Title:
Description
Maximum Length:255
Description of the attachment. -
DmDocumentId: string
Maximum Length:
255
Unique identifier for the document. -
DmFolderPath: string
Title:
Dm Folder Path
Maximum Length:1000
Path of the folder where the attachment is stored. -
DmVersionNumber: string
Maximum Length:
255
Version number of the document attachment. -
DownloadInfo: string
Title:
DownloadInfo
JSON object represented as a string containing information used to programmatically retrieve a file attachment. -
ErrorStatusCode: string
Title:
Error Status Code
Status code of the error. -
ErrorStatusMessage: string
Title:
Error Status Message
Error message that is displayed. -
ExpirationDate: string
(date-time)
Title:
Expiration Date
Expiry date of the document record attachment. -
FileContents: string
(byte)
Title:
File Contents
Attribute for providing the file content. -
FileName: string
Title:
File Name
Maximum Length:2048
Name of the file attached by the user. -
FileUrl: string
Title:
File Url
Relative path for downloading the attachment file. -
FileWebImage: string
(byte)
Title:
File Web Image
Read Only:true
The base64 encoded image of the file displayed in .png format if the source is a convertible image. -
LastUpdateDate: string
(date-time)
Title:
Last Update Date
Read Only:true
Date on which the document record attachment was last updated. -
LastUpdatedBy: string
Title:
Last Updated By
Read Only:true
Maximum Length:255
Name of the user who last updated the document record attachment. -
LastUpdatedByUserName: string
Title:
Last Updated By User
Read Only:true
Name of the user who last updated the document record attachment. -
links: array
Links
Title:
Links
The link relations associated with the resource instance. -
Title: string
Title:
Title
Title of the attachment. -
UploadedFileContentType: string
Title:
Uploaded File Content Type
Type of the content file uploaded. -
UploadedFileLength: integer
Title:
File Size
Length of the content file uploaded. -
UploadedFileName: string
Title:
Uploaded File Name
Name of uploaded file. -
UploadedText: string
Title:
Uploaded Text
Text that is uploaded to the content repository. -
Uri: string
Title:
Uri
Maximum Length:4000
Uniform Resource Identifier of the uploaded file. -
Url: string
Title:
Url
Maximum Length:4000
Uniform Resource Identifier of the document attachment. -
UserName: string
Title:
User Name
Read Only:true
Maximum Length:255
Name of the user who created the attachment.
Nested Schema : Attachment Previews
Type:
array
Title:
Attachment Previews
The attachments preview resource is used to preview the attachment pages.
Show Source
Nested Schema : Links
Type:
array
Title:
Links
The link relations associated with the resource instance.
Show Source
Nested Schema : documentRecords-attachments-AttachmentsPreview-item-response
Type:
Show Source
object
-
ImageHeight: integer
Title:
Image Height
Read Only:true
The height of the previewed image. -
ImageSource: string
Title:
Image Source
Read Only:true
The preview of the image in base64 encoded PNG format. -
ImageWidth: integer
Title:
Image Width
Read Only:true
The width of the previewed image. -
links: array
Links
Title:
Links
The link relations associated with the resource instance. -
PageNum: integer
Title:
Page Number
Read Only:true
The number of the page in the preview.
Nested Schema : Links
Type:
array
Title:
Links
The link relations associated with the resource instance.
Show Source
Nested Schema : link
Type:
Show Source
object
-
href: string
Title:
hyperlink reference
The URI to the related resource. -
kind: string
Title:
kind
Allowed Values:[ "collection", "item", "describe", "other" ]
The kind of the related resource. -
name: string
Title:
name
The name of the link to the related resource. -
properties: object
properties
-
rel: string
Title:
relation
Allowed Values:[ "self", "lov", "parent", "canonical", "child", "enclosure", "action", "custom" ]
The name of the relation to the resource instance. Example: self.
Nested Schema : properties
Type:
Show Source
object
-
changeIndicator: string
Change indicator or the ETag value of the resource instance.
Links
- AttachmentsPreview
-
Parameters:
- DocumentsOfRecordId:
$request.path.DocumentsOfRecordId
- attachmentsUniqID:
$request.path.attachmentsUniqID
The attachments preview resource is used to preview the attachment pages. - DocumentsOfRecordId:
Examples
The following example shows how to update an attachment of a document record by submitting a PATCH request on the REST resource using cURL.
curl -i -u "<username>:<password>" -H "Content-Type: application/vnd.oracle.adf.resourceitem+json" -H "Effective-Of:RangeStartDate=2019-05-12" -X PATCH -d <payload> http://<host>:<port>/hcmRestApi/resources/11.13.18.05/documentRecords/300100184455604/child/attachments/00020000000EACED00057708000110F084E74BBB0000000EACED00057708000110F084E74BBA
Example of Payload
The following is an example of the payload.
{ "FileName": "Birth_Certificate_New.pdf" }
Example of Response Header
The following is an example of the response header.
HTTP/1.1 200 OK Content-Type : application/vnd.oracle.adf.resourcecollection+json
Example of Response Body
The following example shows the contents of the response body in JSON format.
{ "AttachedDocumentId": 300100184656827, "LastUpdateDate": "2019-05-30T09:22:29.878+00:00", "LastUpdatedBy": "VMOSS", "DatatypeCode": "FILE", "FileName": "Birth_Certificate_New.pdf", "DmFolderPath": null, "Url": null, "CategoryName": "MISC", "UserName": "Miscellaneous", "Uri": null, "FileUrl": "/content/conn/FusionAppsContentRepository/uuid/dDocID%3a21302?XFND_SCHEME_ID=1FND_CERT_FP=608AFAE1C10F7C0227D2405D40429C3C078A9B2E&XFND_RANDOM=-3705416754707073248&XFND_EXPIRES=1559212008143&XFND_SIGNATURE=Jmx3yKrJ3d9nQK3QoUgBIerbpWnBBZQsxTQ4mGwQaxyVw0mlBRj-SznBE5bT5ToQ~Kr9TSfjLVcrg2Q88TMebbLIcU0hoKPStaT4q5Frg3b39otDHtuFUto2bl-UigzMB1a9SDuPvsZBtITvPNR13ZDLZggMTsDabqt-Mfjml~oVpTjMGSABX1yJecx8sk-CB3swhMTDxswi~YwlTcjcymC8EW7h6CCEKWk6gptRByJ~yA~NIQlnviZQ1wfvurG541nuL93BtCzP3BkVtLUSI7vFiZXKzl6kh5llUneICvNKRU-BVEIigk6CTvf72sK1zXblQVesS-BwqBfk4KBIZQ__&Id=21302&download", "UploadedText": null, "UploadedFileContentType": "application/pdf", "UploadedFileLength": 13264, "UploadedFileName": null, "ContentRepositoryFileShared": "false", "Title": "Birth_Certificate.pdf", "Description": "", "ErrorStatusCode": null, "ErrorStatusMessage": null, "CreatedBy": "VMOSS", "CreationDate": "2019-05-30T09:22:29+00:00", "ExpirationDate": null, "LastUpdatedByUserName": "Veda Moss", "CreatedByUserName": "Veda Moss", "links": { ...} ] }