Remove a participant from a chat
client.Chats.Participants.Remove(ctx, chatID, body) (*ChatParticipantRemoveResponse, error)
DELETE/v3/chats/{chatId}/participants
Remove a participant from an existing group chat.
Requirements:
- Group chats only
- Must have 3+ participants after removal
Remove a participant from a chat
package main
import (
"context"
"fmt"
"github.com/linq-team/linq-go"
"github.com/linq-team/linq-go/option"
)
func main() {
client := linqgo.NewClient(
option.WithAPIKey("My API Key"),
)
participant, err := client.Chats.Participants.Remove(
context.TODO(),
"550e8400-e29b-41d4-a716-446655440000",
linqgo.ChatParticipantRemoveParams{
Handle: "+12052499136",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", participant.TraceID)
}
{
"message": "Participant removal queued",
"status": "accepted",
"trace_id": "trace_id"
}{
"error": {
"status": 400,
"code": 1002,
"message": "Phone number must be in E.164 format"
},
"success": false
}{
"error": {
"status": 401,
"code": 2004,
"message": "Unauthorized - missing or invalid authentication token"
},
"success": false
}{
"error": {
"status": 404,
"code": 2001,
"message": "Resource not found"
},
"success": false
}{
"error": {
"status": 409,
"code": 2013,
"message": "This chat is unavailable"
}
}{
"error": {
"status": 500,
"code": 3006,
"message": "Internal server error"
},
"success": false
}Returns Examples
{
"message": "Participant removal queued",
"status": "accepted",
"trace_id": "trace_id"
}{
"error": {
"status": 400,
"code": 1002,
"message": "Phone number must be in E.164 format"
},
"success": false
}{
"error": {
"status": 401,
"code": 2004,
"message": "Unauthorized - missing or invalid authentication token"
},
"success": false
}{
"error": {
"status": 404,
"code": 2001,
"message": "Resource not found"
},
"success": false
}{
"error": {
"status": 409,
"code": 2013,
"message": "This chat is unavailable"
}
}{
"error": {
"status": 500,
"code": 3006,
"message": "Internal server error"
},
"success": false
}