Developer Function: Script: $p.apiGet
## Overview
Retrieves record information for the specified site. For tables that have "[Site Integration](/en/manual/table-site-integration)" configured, information for each integrated record is also retrieved.
## Limitations
1. The maximum number of records that can be retrieved is the PageSize (default 200) in Api.json. If you want to retrieve more than 200 records, please refer to "[FAQ: I want to retrieve data exceeding 200 records via API](/en/manual/faq-api-paging)".
## Syntax
##### JavaScript
```
$p.apiGet({
id: <Site ID>,
data: {
<Acquisition conditions>
},
done: <Optional Processing>,
fail: <Optional Processing>,
always: <Optional Processing>
});
```
## Description Of Each Parameter
|Parameter name|Description|Required|
|:--|:--|:--:|
|id|Specify the site ID or record ID to be operated. |Yes|
|data|Specify the JSON data to be POSTed. You can specify "「JSON Data Layout: View」" and table type (TableType). For the table types that can be specified, see "About Table Types" below. |No|
|done|Describe the process to be performed when API communication is successful. |No|
|fail|Describe the process to be performed when API communication fails. |No|
|always|Describe the process to be performed at the end of API communication. |No|
### About Table Types
The following values can be specified for table type (TableType):
|Value|Description|
|:--|:--|
|Normal|Specify this when retrieving record information for the specified site. The retrieved record information has the latest version history. This value is also the default value for TableType, and if TableType is not specified, this value will be set internally and processing will be performed. |
|History|Specify this when retrieving record history information for the specified site. The retrieved record information has past versions history (not including the latest version). |
|NormalAndHistory|Specify this when retrieving both record information and history information for the specified site. The retrieved record information has all versions history. |
## Usage Example 1
To specify the JSON data layout of "View" in the data to be POSTed, write as follows. For information on the layout of "View", please see "「JSON Data Layout: View」".
##### JavaScript
```
$p.apiGet({
id: 123,
data: {
View: {
ApiDataType: "KeyValues",
GridColumns: ["Title", "ClassA"]
}
},
done: function (data) {
alert('The communication was successful.');
}
});
```
## Usage Example 2
If you want to specify the table type "TableType" in the data to be POSTed, write it as follows.
##### JavaScript
```
$p.apiGet({
id: 123,
data: {
TableType: 'History'
},
done: function (data) {
alert('The communication was successful.');
}
});
```
## Example 3
If you want to specify the JSON data layout of "View" and the table type "TableType" in the data to be POSTed, write it as follows.
##### Javascript
```
$p.apiGet({
id: 123,
data: {
View: {
ColumnFilterHash:{
ClassA: 'Nakano District'
}
},
TableType: 'History'
},
done: function (data) {
console.log(data);
}
});
```