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.3 KB

channels-kick.md

File metadata and controls

33 lines (24 loc) · 1.3 KB

channels.kick

This method allows a user to remove another member from a team channel.

Official documentation https://api.slack.com/methods/channels.kick
Payload class ChannelsKickPayload
PayloadResponse class ChannelsKickPayloadResponse

Usage

$payload = new ChannelsInvitePayload();
$payload->setChannelId('C1234567');
$payload->setUserId('U1234567');

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

if ($response->isOk()) {
    // user has been successfully invited!
} 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();
}