Developer Function: API: Table Operation: Retrieve Attachments
## Overview
This API retrieves information about files attached to attachment column, and image files pasted into content, description column, and comments.
## Limitations
1. This API retrieves file information. Please perform the conversion (Base64 Decode) to retrieve the actual file. Please refer to the following FAQ for the conversion process.
[FAQ: Sample Code: Download Attachments](https://pleasanter.org/manual/faq-download-attachment)
## Preparation
Please [Create an API Key](/manual/api-key) before performing API operations.
|Setting column|Value|
|:--|:--|
|HTTP Method|POST|
|Content-Type |application/json|
|Character Code|UTF-8|
|URL|http://{server name}/api/binaries/{Guid}/get(*1)|
|Body|See the json data below for reference|
(*1) Please edit the {server name} and {Guid} parts suit your environment as appropriate.
For pleasanter.net, the format is as follows:
https\://pleasanter.net/fs/api/binaries/{Guid}/get
(*2)
If you want to retrieve record information including the Guid of an attachment, please follow the link below.
[API Function: Retrieve Single Record](/manual/api-record-get)
## Request
##### JSON
```
{
"ApiVersion": 1.1,
"ApiKey": "234S567dStfghjkA..."
}
```
## Response
The json data in the following format will be returned.
|Acquired column|Description|
|:--|:--|
|Id|The ID of the record in the Binaries table that was acquired is stored. |
|StatusCode|The status code upon completion is stored. The value is 200 when the operation is successful. |
|Message|The message upon completion is stored. |
|ReferenceId|The ID of the record to which the file is linked is stored. |
|BinaryType|Attachments is stored for attachments, and Images is stored for images. |
|Base64|The contents of the file encoded in Base64 are stored. To obtain the actual file, decode this value with Base64. |
|Guid|The GUID of the file is stored. |
|FileName|The file name is stored. |
|Extension|The extension is stored. |
|Size|The file size in bytes is stored. |
|ContentType|The MimeType of the file is stored. |
|Creator|The user ID of the file creator is stored. |
|Updater |The user ID of the file updater is stored. |
|CreatedTime|The file creation datetime is stored. |
|UpdatedTime|The file update datetime is stored. |
##### JSON
```
{
"Id": 123,
"StatusCode": 200,
"Message": "Test file is retrieved.",
"Response": {
"ReferenceId": 30,
"BinaryType": "Attachments",
"Base64": "dGVzdA==...",
"Guid": "5E23245...",
"FileName": "Test file",
"Extension": ".txt",
"Size": 54,
"ContentType": "text/plain",
"Creator": 1,
"Updator": 1,
"CreatedTime": "2023/08/16 12:00:00",
"UpdatedTime": "2023/08/17 12:00:00"
}
}
```
## Confirmation Column in Case of Error
[・Precautions when using the API and things to check if an error occurs](/manual/faq-api)
[・FAQ: What to check if modified configuration files or API requests (JSON format) are not recognized correctly](/manual/faq-json-format)
## Specification Changes
***API specifications have been partially changed since November 2018.**
- The URL format has been changed from '/pleasanter/api_items/xxxx' to '/pleasanter/api/items/xxxx'.
- The Content-Type specification has been changed from 'application/x-www-form-urlencoded' to 'application/json'.