cURL
curl --request PUT \
--url https://api.gptmaker.ai/v2/channel/{channelId}/widget-settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"isPublic": true,
"initialMessage": "<string>",
"origins": [
"<string>"
],
"suggestMessages": [
"<string>"
],
"headerBackground": "<string>",
"headerColor": "<string>",
"messageUserBackground": "<string>",
"buttonBackground": "<string>"
}
'import requests
url = "https://api.gptmaker.ai/v2/channel/{channelId}/widget-settings"
payload = {
"isPublic": True,
"initialMessage": "<string>",
"origins": ["<string>"],
"suggestMessages": ["<string>"],
"headerBackground": "<string>",
"headerColor": "<string>",
"messageUserBackground": "<string>",
"buttonBackground": "<string>"
}
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({
isPublic: true,
initialMessage: '<string>',
origins: ['<string>'],
suggestMessages: ['<string>'],
headerBackground: '<string>',
headerColor: '<string>',
messageUserBackground: '<string>',
buttonBackground: '<string>'
})
};
fetch('https://api.gptmaker.ai/v2/channel/{channelId}/widget-settings', 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/{channelId}/widget-settings",
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([
'isPublic' => true,
'initialMessage' => '<string>',
'origins' => [
'<string>'
],
'suggestMessages' => [
'<string>'
],
'headerBackground' => '<string>',
'headerColor' => '<string>',
'messageUserBackground' => '<string>',
'buttonBackground' => '<string>'
]),
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/{channelId}/widget-settings"
payload := strings.NewReader("{\n \"isPublic\": true,\n \"initialMessage\": \"<string>\",\n \"origins\": [\n \"<string>\"\n ],\n \"suggestMessages\": [\n \"<string>\"\n ],\n \"headerBackground\": \"<string>\",\n \"headerColor\": \"<string>\",\n \"messageUserBackground\": \"<string>\",\n \"buttonBackground\": \"<string>\"\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/{channelId}/widget-settings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"isPublic\": true,\n \"initialMessage\": \"<string>\",\n \"origins\": [\n \"<string>\"\n ],\n \"suggestMessages\": [\n \"<string>\"\n ],\n \"headerBackground\": \"<string>\",\n \"headerColor\": \"<string>\",\n \"messageUserBackground\": \"<string>\",\n \"buttonBackground\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gptmaker.ai/v2/channel/{channelId}/widget-settings")
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 \"isPublic\": true,\n \"initialMessage\": \"<string>\",\n \"origins\": [\n \"<string>\"\n ],\n \"suggestMessages\": [\n \"<string>\"\n ],\n \"headerBackground\": \"<string>\",\n \"headerColor\": \"<string>\",\n \"messageUserBackground\": \"<string>\",\n \"buttonBackground\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"error": "<string>"
}{
"error": "<string>"
}Widget
Configurações
Atualiza as configurações do canal do tipo widget
PUT
/
v2
/
channel
/
{channelId}
/
widget-settings
cURL
curl --request PUT \
--url https://api.gptmaker.ai/v2/channel/{channelId}/widget-settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"isPublic": true,
"initialMessage": "<string>",
"origins": [
"<string>"
],
"suggestMessages": [
"<string>"
],
"headerBackground": "<string>",
"headerColor": "<string>",
"messageUserBackground": "<string>",
"buttonBackground": "<string>"
}
'import requests
url = "https://api.gptmaker.ai/v2/channel/{channelId}/widget-settings"
payload = {
"isPublic": True,
"initialMessage": "<string>",
"origins": ["<string>"],
"suggestMessages": ["<string>"],
"headerBackground": "<string>",
"headerColor": "<string>",
"messageUserBackground": "<string>",
"buttonBackground": "<string>"
}
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({
isPublic: true,
initialMessage: '<string>',
origins: ['<string>'],
suggestMessages: ['<string>'],
headerBackground: '<string>',
headerColor: '<string>',
messageUserBackground: '<string>',
buttonBackground: '<string>'
})
};
fetch('https://api.gptmaker.ai/v2/channel/{channelId}/widget-settings', 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/{channelId}/widget-settings",
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([
'isPublic' => true,
'initialMessage' => '<string>',
'origins' => [
'<string>'
],
'suggestMessages' => [
'<string>'
],
'headerBackground' => '<string>',
'headerColor' => '<string>',
'messageUserBackground' => '<string>',
'buttonBackground' => '<string>'
]),
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/{channelId}/widget-settings"
payload := strings.NewReader("{\n \"isPublic\": true,\n \"initialMessage\": \"<string>\",\n \"origins\": [\n \"<string>\"\n ],\n \"suggestMessages\": [\n \"<string>\"\n ],\n \"headerBackground\": \"<string>\",\n \"headerColor\": \"<string>\",\n \"messageUserBackground\": \"<string>\",\n \"buttonBackground\": \"<string>\"\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/{channelId}/widget-settings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"isPublic\": true,\n \"initialMessage\": \"<string>\",\n \"origins\": [\n \"<string>\"\n ],\n \"suggestMessages\": [\n \"<string>\"\n ],\n \"headerBackground\": \"<string>\",\n \"headerColor\": \"<string>\",\n \"messageUserBackground\": \"<string>\",\n \"buttonBackground\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gptmaker.ai/v2/channel/{channelId}/widget-settings")
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 \"isPublic\": true,\n \"initialMessage\": \"<string>\",\n \"origins\": [\n \"<string>\"\n ],\n \"suggestMessages\": [\n \"<string>\"\n ],\n \"headerBackground\": \"<string>\",\n \"headerColor\": \"<string>\",\n \"messageUserBackground\": \"<string>\",\n \"buttonBackground\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
ID do canal
Body
application/json
Configurações do widget a serem atualizadas
Define se o widget é público ou apenas permitido em alguns sites
Mensagem inicial do widget
Lista de domínios autorizados
Lista de sugestões de perguntas
Cor do fundo do topo do widget
Cor da fonte do topo
Cor de fundo da mensagem do usuário
Cor de fundo do botão flutuante
Response
Configurações do widget atualizadas com sucesso
Example:
true
⌘I

