Kick or disconnect a member from a conference

This method lets you disconnect a member in a conference. When the member is disconnected the next action would be performed based on the next element in the XML.

API Endpoint

POST https://api.plivo.com/v1/Account/{auth_id}/Conference/{conference_name}/Member/{member_id}/Kick/


For eg. If the XML to start the conference is the one below, Plivo will play the text in the <Speak> tag after the member has been kicked.

<Response>
    <Conference enterSound="beep:1">MyConference</Conference>
    <Speak>Good bye. You have been kicked out of the conference</Speak>
</Response>

The member_id attribute which is passed in the URL can be one of the following two forms:

  1. Member ID: The member specified by the member_id.

  2. ‘all’: The string ‘all’, this action will be performed on all members of the conference.

Attributes

No arguments need to be passed.

Returns

Returns an acknowledgement that the member has been disconnected from conference.

Response

HTTP Status Code: 202

{
  "message": "kicked",
  "member_id": "10",
  "api_id": "2867b6e2-58c3-11e1-86da-adf28403fe48"
}

Example Request

1
2
3
4
5
6
7
import plivo

client = plivo.RestClient()
response = client.conferences.member_kick(
    conference_name='testing',
    member_id=27697, )
print(response)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#
# Example for Conference Member Kick Create
#
require 'rubygems'
require 'plivo'

include Plivo
include Plivo::Exceptions

api = RestClient.new("YOUR_AUTH_ID", "YOUR_AUTH_TOKEN")

begin
  response = api.conferences.kick_member(
    'My Conf Room',
    10
  )
  puts response
rescue PlivoRESTError => e
  puts 'Exception: ' + e.message
end
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Example for Conference Member Kick create

var plivo = require('plivo');

(function main() {
    'use strict';
    
    // As the auth_id and auth_token are unspecified, Plivo will fetch them from the PLIVO_AUTH_ID and PLIVO_AUTH_TOKEN environment variables.
    var client = new plivo.Client();
    client.conferences.kickMember(
        "My Conf Room", // conference name
        10, // member id
    ).then(function (response) {
        console.log(response);
    }, function (err) {
        console.error(err);
    });
})();
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php
/**
 * Example for Conference Member Kick create
 */
require 'vendor/autoload.php';
use Plivo\RestClient;
use Plivo\Exceptions\PlivoRestException;
$client = new RestClient("YOUR_AUTH_ID", "YOUR_AUTH_TOKEN");

try {
    $response = $client->conferences->kickMember(
        'My Conf Room',
        10
    );
    print_r($response);
}
catch (PlivoRestException $ex) {
    print_r(ex);
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package com.plivo.api.samples.conference.member.kick;

import java.io.IOException;
import com.plivo.api.Plivo;
import com.plivo.api.exceptions.PlivoRestException;
import com.plivo.api.models.conference.Conference;
import com.plivo.api.models.conference.ConferenceMemberActionResponse;

/**
* Example for Conference Member Kick create
*/
class KickCreate {
    public static void main(String [] args) {
        Plivo.init();
        try {
            ConferenceMemberActionResponse response = Conference.memberKicker("My Conf Room", "10")
                .kick();

            System.out.println(response);
        } catch (PlivoRestException | IOException e) {
            e.printStackTrace();
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/**
 * Example for Conference Member Kick Create
 */
using System;
using System.Collections.Generic;
using Plivo;
using Plivo.Exception;

namespace PlivoExamples
{
    internal class Program
    {
        public static void Main(string[] args)
        {
            var api = new PlivoApi("YOUR_AUTH_ID", "YOUR_AUTH_TOKEN");
            try
            {
                var response = api.Conference.KickMember(
                    memberId:10,
                    conferenceName:"My Conf Room"
                );
                Console.WriteLine(response);
            }
            catch (PlivoRestException e)
            {
                Console.WriteLine("Exception: " + e.Message);
            }
        }
    }
}
1
2
3
4
curl -i --user AUTH_ID:AUTH_TOKEN \
    -H "Content-Type: application/json" \
    -d '{}' \
    https://api.plivo.com/v1/Account/{auth_id}/Conference/{conference_name}/Member/{member_id}/Kick/
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Example for Conference Member Kick create
package main

import "fmt"
import "github.com/plivo/plivo-go"
 
func main() {
	client, err := plivo.NewClient("", "", &plivo.ClientOptions{})
	if err != nil {
		panic(err)
	}
	response, err := client.Conferences.MemberKick(
		"My Conf Room",
		"10",
	)
	if err != nil {
		panic(err)
	}
	fmt.Printf("Response: %#v\n", response)
}