Attachment Write Method
The Attachment API provides access to an attachment.
Attachment Write enables the user to newly register or update the specified Attachment information.
POST |
https://{Request URI Host}/v1/attachment?partition=[value] |
---|
Scope
The access privilege required for Attachment Write is as follows:
attachment_w
Input Variables
When using the GET or POST Method, the parameter of the HTTP Header must be specified with a value. For details, see HTTP Header.
The following shows the Parameters that can be specified:
Required | Parameter | Definition |
---|---|---|
● | partition | Specify a numerical value for the Partition Id. To check the Partition Id that can be accessed, acquire the information using Partition Read. |
The following value can be specified in the XML format for the data block for POST.
No optional Field can be handled by the Attachment API.
Tag | Definition |
---|---|
Attachment | Root element that indicates the Attachment. |
Item | Indicates one piece of Attachment information. |
Id | Id of the Attachment Specify -1 for new registration, and the ID of the Attachment to be updated for update. |
Resource | Specify the Resource for which you want to register the Attachment For the value of the Resource, see Resource List. |
ResourceId | Specify the record Id of the Resource for which you want to register the Attachment |
ContentType | Specify the Mime Type of the Content. For details, see Attachment - Mime Type List. |
FileName | Specify a file name with an extension. |
Content | Specify Bease64 encoded file content. |
Notes on new registration and update
- A file exceeding 2 MB is not supported.
- Any characters that are not supported for a Windows file name cannot be specified.
- The file name including the extension must be within 255 bytes.
- The attached file where data are written by the Attachment API is attached to the “Sub List Attachment” displayed at the bottom of the details screen of each Resource of HRBC.
Note that when the “Sub List Attachment” is hidden, the attachment cannot be checked from the screen.
Result Values
When the processing is successfully completed, “200” is returned to the Response Header as the HTTP status, and the value that is described in Output Values can be acquired.
If an error occurs, a value other than 200 is returned.
Output Values
The output value can be acquired in the XML format.
Tag | Definition |
---|---|
Attachment | Root element that indicates the Attachment data. |
Item | Indicates one piece of Attachment information. |
Id | The Id of the updated or newly registered Attachment. |
Code | The code that represents the processing result. For details, see Result Code List. |
Attachment Write Sample
This sample code shown below is not encoded. In the case of an actual Request, encoding/decoding may be necessary depending on the content.
The following sample newly registers a resume in the Word file with the record having the Resume ID = 10001.
Input XML <?xml version=”1.0” encoding=”UTF-8” standalone=”yes”?> |
Output XML <?xml version=”1.0” encoding=”UTF-8” standalone=”yes”?> |