group.get

Get a Group

Request Parameters

group_idint (required)

The id of the group to get.

Response Parameters

nameString

Name of the group.

descriptionString

Description of the group

date_createdString

Date when group was created in ISO 8601 format. (YYYY-MM-DDTHH:mm:ss+00:00)

group_idint

Unique Group Id.

date_updatedString

Date when group was latest updated in ISO 8601 format. (YYYY-MM-DDTHH:mm:ss+00:00)

Code Examples

JSON


//Request
{
  "method":"group.get",
  "params":{
    "group_id":786
   }, 
  "id":0
}

//Response
{
  "id":0,
  "result":{
    "group_id":786,
    "name":"My Personal Group",
    "description":"",
    "date_updated":"2011-04-29T09:58:12+00:00",
    "date_created":"2011-04-29T09:58:12+00:00",
    "language":"en"
   }
}

Java


// You need to have a ready-to-use client to use the other methods
SaploClient client = new SaploClient("YOUR_API_KEY", "YOUR_SECRET_KEY");

// Create a SaploGroupManager to work with groups
SaploGroupManager groupMgr = new SaploGroupManager(client);

// Assuming you know the groupId you want to retrieve
SaploGroup group = new SaploGroup();
group.setId(id);

groupMgr.get(group);

// Your group object's attributes get populated by the API
System.out.println(group.getName());
System.out.println(group.getDescription());
System.out.println(group.getLanguage());
// etc

PHP

$client = new SaploAPI("YOUR API KEY", "YOUR SECRET KEY");
  
$params = array(
    "group_id" => 2
);
 
try {
    $result = $client->group->get($params);
} catch(SaploException $e) {
    echo '(' . $e->getCode() . ') ' . $e->getMessage();
}
   
var_dump($result);

Python


client = SaploJSONClient("YOUR API KEY", "YOUR SECRET KEY")

group = client.group.get(
            group_id=788,
            )

print "Fetched group:", group

Matlab

params.group_id = 415;
 
response = saploRequest('group.get', params)