Skip to content
This repository has been archived by the owner on Dec 17, 2018. It is now read-only.

Latest commit

 

History

History
33 lines (24 loc) · 1.28 KB

groups-create-child.md

File metadata and controls

33 lines (24 loc) · 1.28 KB

groups.createChild

Creates a new group.

Official documentation https://api.slack.com/methods/groups.createChild
Payload class GroupsCreateChildPayload
PayloadResponse class GroupsCreateChildPayloadResponse

Usage

$payload = new GroupsCreateChildPayload();
$payload->setGroupId('G1234567');

$apiClient = new ApiClient('your-token-here');
$response  = $apiClient->send($payload);

if ($response->isOk()) {
    // child has been created!
    $response->getGroup(); // the new (child) Group object
} else {
    // something went wrong, but what?
    
    // simple error (Slack's error message)
    echo $response->getError();
    
    // explained error (Slack's explanation of the error, according to the documentation)
    echo $response->getErrorExplanation();
}