group.update
Update an existing group with another name or description. Return group object.
Request Parameters
| group_id | int (required) |
Id of the group to update.
| name | String |
Name of group. Has to be unique for your account.
| description | String |
Description of the group.
Response Parameters
| group_id | int |
Id for group.
| name | String |
Name of group.
| description | String |
Description of group.
| language | String |
The language the group works on.
| date_created | String |
Date when the group was created in ISO 8601 format. (YYYY-MM-DDTHH:mm:ssZ)
| date_updated | String |
Date when the group was last updated (e.g. text added/deleted) in ISO 8601 format. (YYYY-MM-DDTHH:mm:ssZ)
Code Examples
JSON
//Request
{
"method":"group.update",
"params":{
"group_id":13,
"description":"Group based on tech articles."
},
"id":0
}
//Response
{
"id":0,
"result":{
"group_id":13,
"name":"My Tech Group",
"language":"en",
"description":"Group based on tech articles.",
"date_created":"2011-03-30T10:31:33z",
"date_updated":"2011-07-15T23:08:54z",
}
}
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 already you have the group you want to update, with a valid groupId
group.setName("NEW_NAME");
group.setDescription("UPDATED_COLLECTION");
// To apply the changes, call the manager's "update" method
groupMgr.update(group);
PHP
$client = new SaploAPI("YOUR API KEY", "YOUR SECRET KEY");
//Set parameters
$params = array(
"group_id" => 21,
"description" => "My updated description.",
);
try {
$result = $client->group->update($params);
} catch(SaploException $e) {
echo '(' . $e->getCode() . ') ' . $e->getMessage();
}
var_dump($result);
Python
client = SaploJSONClient("YOUR API KEY", "YOUR SECRET KEY")
updated_group = client.group.update(
group_id=787,
name="New Name",
description="New Description",
)
print "Updated group:", updated_group
Matlab
params.group_id = 415;
params.name = 'My group name 2';
response = saploRequest('group.update', params)