Skip to main content
PUT
/
v2
/
channel
/
{id}
/
config
cURL
curl --request PUT \
  --url https://api.gptmaker.ai/v2/channel/{id}/config \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "startTrigger": "ONLY_WHEN_CALLING_BY_NAME",
  "id": "3EC6EAFBBB17505A7EB9E6300696488C",
  "audioAction": "DISABLED",
  "tenant": "3E753A12D20F50A185E54E911FDCDB1F",
  "endTrigger": "WHEN_SAY_GOODBYE"
}
'
import requests

url = "https://api.gptmaker.ai/v2/channel/{id}/config"

payload = {
"startTrigger": "ONLY_WHEN_CALLING_BY_NAME",
"id": "3EC6EAFBBB17505A7EB9E6300696488C",
"audioAction": "DISABLED",
"tenant": "3E753A12D20F50A185E54E911FDCDB1F",
"endTrigger": "WHEN_SAY_GOODBYE"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
startTrigger: 'ONLY_WHEN_CALLING_BY_NAME',
id: '3EC6EAFBBB17505A7EB9E6300696488C',
audioAction: 'DISABLED',
tenant: '3E753A12D20F50A185E54E911FDCDB1F',
endTrigger: 'WHEN_SAY_GOODBYE'
})
};

fetch('https://api.gptmaker.ai/v2/channel/{id}/config', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gptmaker.ai/v2/channel/{id}/config",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'startTrigger' => 'ONLY_WHEN_CALLING_BY_NAME',
'id' => '3EC6EAFBBB17505A7EB9E6300696488C',
'audioAction' => 'DISABLED',
'tenant' => '3E753A12D20F50A185E54E911FDCDB1F',
'endTrigger' => 'WHEN_SAY_GOODBYE'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.gptmaker.ai/v2/channel/{id}/config"

payload := strings.NewReader("{\n \"startTrigger\": \"ONLY_WHEN_CALLING_BY_NAME\",\n \"id\": \"3EC6EAFBBB17505A7EB9E6300696488C\",\n \"audioAction\": \"DISABLED\",\n \"tenant\": \"3E753A12D20F50A185E54E911FDCDB1F\",\n \"endTrigger\": \"WHEN_SAY_GOODBYE\"\n}")

req, _ := http.NewRequest("PUT", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.put("https://api.gptmaker.ai/v2/channel/{id}/config")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"startTrigger\": \"ONLY_WHEN_CALLING_BY_NAME\",\n \"id\": \"3EC6EAFBBB17505A7EB9E6300696488C\",\n \"audioAction\": \"DISABLED\",\n \"tenant\": \"3E753A12D20F50A185E54E911FDCDB1F\",\n \"endTrigger\": \"WHEN_SAY_GOODBYE\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.gptmaker.ai/v2/channel/{id}/config")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"startTrigger\": \"ONLY_WHEN_CALLING_BY_NAME\",\n \"id\": \"3EC6EAFBBB17505A7EB9E6300696488C\",\n \"audioAction\": \"DISABLED\",\n \"tenant\": \"3E753A12D20F50A185E54E911FDCDB1F\",\n \"endTrigger\": \"WHEN_SAY_GOODBYE\"\n}"

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "tenant": "<string>",
  "audioAction": "<string>",
  "startTrigger": "<string>",
  "endTrigger": "<string>",
  "enabledTyping": true,
  "enableGroupsResponse": true,
  "replyGroupsType": "<string>",
  "enablePrivateChatResponse": true,
  "callRejectAuto": true,
  "callRejectMessage": "<string>",
  "takeOutsideService": true,
  "takeOutsideServiceMember": "<string>",
  "takeOutsideServiceCommand": "<string>",
  "takeOutsideServiceMessage": "<string>",
  "takeOutsideServiceCommandReturn": true,
  "takeOutsideServiceReturnMessage": "<string>",
  "waitingMessageEnabled": true,
  "waitingMessageText": "<string>",
  "type": "Z_API"
}
{
"error": "<string>"
}
{
"error": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

ID do canal

Body

application/json

Dados para atualização do canal. Envie apenas as configurações que deseja alterar.

Campos opcionais: informe somente os atributos que serão atualizados no canal.

id
string

ID do canal

Example:

"3EC6EAFBBB17505A7EB9E6300696488C"

tenant
string

Tenant do canal

Example:

"3E753A12D20F50A185E54E911FDCDB1F"

audioAction
string | null

Ação de áudio (quando aplicável)

Example:

"DISABLED"

startTrigger
string | null

Trigger de início (quando aplicável)

Example:

"ONLY_WHEN_CALLING_BY_NAME"

endTrigger
string | null

Trigger de encerramento (quando aplicável)

Example:

"WHEN_SAY_GOODBYE"

Response

Canal atualizado com sucesso (o retorno varia conforme o tipo do canal)

id
string

ID do canal

tenant
string

Tenant do canal

audioAction
string | null

Configuração de ação de áudio

startTrigger
string | null

Trigger de início

endTrigger
string | null

Trigger de encerramento

enabledTyping
boolean | null

Habilita indicador de 'digitando'

enableGroupsResponse
boolean | null

Habilita respostas em grupos

replyGroupsType
string | null

Tipo de resposta em grupos

enablePrivateChatResponse
boolean | null

Habilita resposta em chat privado

callRejectAuto
boolean | null

Rejeita chamadas automaticamente

callRejectMessage
string | null

Mensagem ao rejeitar chamada

takeOutsideService
boolean | null

Habilita retirar atendimento para fora do serviço

takeOutsideServiceMember
string | null

Membro/usuário alvo da ação

takeOutsideServiceCommand
string | null

Comando utilizado

takeOutsideServiceMessage
string | null

Mensagem utilizada

takeOutsideServiceCommandReturn
boolean | null

Define se deve retornar após executar o comando

takeOutsideServiceReturnMessage
string | null

Mensagem de retorno

waitingMessageEnabled
boolean | null

Habilita mensagem de espera

waitingMessageText
string | null

Texto da mensagem de espera

type
enum<string>

Tipo do canal

Available options:
Z_API