Developer Function: Script: $p.apiGroupsGet
## Overview
This is a script function that allows you to obtain group information using an Ajax POST request.
## Syntax
### To Retrieve One Group By Directly Specifying The Group ID:
##### JavaScript
```
$p.apiGroupsGet({
id: <Group ID>,
done: <Optional Processing>,
fail: <Optional Processing>,
always: <Optional Processing>
});
```
### When Specifying Multiple Group IDs
##### JavaScript
```
$p.apiGroupsGet({
data:{
View: {
ColumnFilterHash: {
GroupId: '[<Specify group IDs as an array>]'
}
}
},
done: <Optional Processing>,
fail: <Optional Processing>,
always: <Optional Processing>
});
```
## Usage Example
### To Retrieve One Group By Directly Specifying The Group ID
|Parameter name|Description|Required|
|:--|:--|:--:|
|id|Group ID to get|Yes|
|done|API communication successful|Yes|
|fail|API communication failure|No|
|always|On completion|No|
##### JavaScript
```
$p.apiGroupsGet({
id: 123,
done: function (data) {
console.log(data);
console.log('Group information was retrieved successfully.');
},
fail: function () {
console.log('Failed to get group information.');
},
always: function () {
console.log('Group information has been retrieved.');
}
});
```
### When Specifying Multiple Group IDs
|Parameter name|Description|Required|
|:--|:--|:--:|
|data|Specify multiple group IDs to retrieve using an array|Yes|
|done|API communication successful|Yes|
|fail|API communication failed|No|
|always|On completion|No|
##### JavaScript
```
$p.apiGroupsGet({
data: {
View: {
ColumnFilterHash: {
GroupId: '[100,101]'
}
}
},
done: function (data) {
console.log(data);
console.log('Group information was retrieved successfully.');
},
fail: function () {
console.log('Failed to get group information.');
},
always: function () {
console.log('Group information has been retrieved.');
}
});
```