Developer Function: API: Table Operation: Export Table
Overview¶
You can export a specific table using the API.
Preparation¶
Please Create an API Key before performing API operations.
Request¶
Send json data in the following request format:
| Setting column | Value |
|---|---|
| HTTP Method | POST |
| Content-Type | application/json |
| Character Code | UTF-8 |
| URL | http://{server name}/api/items/{site ID}/export (*1) |
| Body | Please refer to the json data below |
(*1) Please edit the {server name} and {site ID} parts suit your environment as appropriate.
For pleasanter.net, the format is as follows:
https://pleasanter.net/fs/api/items/{site ID}/export
(a) Export tables with standard export settings¶
JSON¶
(b) Export tables using export settings already created in Pleasanter¶
You can export using the export settings you created on the "Export" tab of "Manage Table".
In the JSON of the settings file, specify the API key and the ID of the export setting you created.
JSON¶
© Export tables with export settings directly in the configuration file¶
JSON¶
{
"ApiVersion": 1.1,
"ApiKey": "60gds37dF4fds2D...",
"Export": {
"Name": "Test A-1",
"Columns": [
{
"ColumnName": "Title"
},
{
"ColumnName": "Body"
}
],
"Header": false,
"Type": "csv"
}
}
- Name: Name of export setting
- Columns: Name of column to be output
- Header: Setting for whether to add a header row to the output CSV
- Type: Specify the type of file to be output. Two types can be specified: "csv" and "json".
(d) Export tables by specifying the filtering and sorting order of the retrieved records¶
JSON¶
{
"ApiVersion": 1.1,
"ApiKey": "61dsf0D8D4g2DE4df23...",
"ExportId": 1,
"View": {
"ColumnSorterHash": {
"Title": "desc"
},
"ColumnFilterHash": {
"Owner": "[1]"
}
}
}
Response¶
The json data in the following format will be returned.
JSON¶
{
"StatusCode": 200,
"LimitPerDate": 10000,
"LimitRemaining": 9990,
"Response": {
"Name": "Time-limited table_20xx_xx_xx xx_xx_xx.Csv",
"Content": "\"ID\",\"Title\",\"Content\",\"Title/Content\",\"Comment\".........."
}
}
Confirmation Column in Case of Error¶
・Precautions when using the API and things to check if an error occurs
・FAQ: What to check if modified configuration files or API requests (JSON format) are not recognized correctly