Pular para o conteúdo principal
POST
/
api
/
v1
/
accounts
/
{account_id}
/
portals
Adicionar um novo portal
curl --request POST \
  --url https://airys.chat/api/v1/accounts/{account_id}/portals \
  --header 'Content-Type: application/json' \
  --header 'api_access_token: <api-key>' \
  --data '
{
  "color": "#FFFFFF",
  "custom_domain": "chatwoot.help",
  "header_text": "Handbook",
  "homepage_link": "https://www.chatwoot.com/",
  "name": "Handbook",
  "page_title": "Handbook",
  "slug": "handbook",
  "archived": false,
  "config": {
    "allowed_locales": [
      "en",
      "es"
    ],
    "default_locale": "en"
  }
}
'
import requests

url = "https://airys.chat/api/v1/accounts/{account_id}/portals"

payload = {
"color": "#FFFFFF",
"custom_domain": "chatwoot.help",
"header_text": "Handbook",
"homepage_link": "https://www.chatwoot.com/",
"name": "Handbook",
"page_title": "Handbook",
"slug": "handbook",
"archived": False,
"config": {
"allowed_locales": ["en", "es"],
"default_locale": "en"
}
}
headers = {
"api_access_token": "<api-key>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'POST',
headers: {api_access_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
color: '#FFFFFF',
custom_domain: 'chatwoot.help',
header_text: 'Handbook',
homepage_link: 'https://www.chatwoot.com/',
name: 'Handbook',
page_title: 'Handbook',
slug: 'handbook',
archived: false,
config: {allowed_locales: ['en', 'es'], default_locale: 'en'}
})
};

fetch('https://airys.chat/api/v1/accounts/{account_id}/portals', 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://airys.chat/api/v1/accounts/{account_id}/portals",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'color' => '#FFFFFF',
'custom_domain' => 'chatwoot.help',
'header_text' => 'Handbook',
'homepage_link' => 'https://www.chatwoot.com/',
'name' => 'Handbook',
'page_title' => 'Handbook',
'slug' => 'handbook',
'archived' => false,
'config' => [
'allowed_locales' => [
'en',
'es'
],
'default_locale' => 'en'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api_access_token: <api-key>"
],
]);

$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://airys.chat/api/v1/accounts/{account_id}/portals"

payload := strings.NewReader("{\n \"color\": \"#FFFFFF\",\n \"custom_domain\": \"chatwoot.help\",\n \"header_text\": \"Handbook\",\n \"homepage_link\": \"https://www.chatwoot.com/\",\n \"name\": \"Handbook\",\n \"page_title\": \"Handbook\",\n \"slug\": \"handbook\",\n \"archived\": false,\n \"config\": {\n \"allowed_locales\": [\n \"en\",\n \"es\"\n ],\n \"default_locale\": \"en\"\n }\n}")

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

req.Header.Add("api_access_token", "<api-key>")
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.post("https://airys.chat/api/v1/accounts/{account_id}/portals")
.header("api_access_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"color\": \"#FFFFFF\",\n \"custom_domain\": \"chatwoot.help\",\n \"header_text\": \"Handbook\",\n \"homepage_link\": \"https://www.chatwoot.com/\",\n \"name\": \"Handbook\",\n \"page_title\": \"Handbook\",\n \"slug\": \"handbook\",\n \"archived\": false,\n \"config\": {\n \"allowed_locales\": [\n \"en\",\n \"es\"\n ],\n \"default_locale\": \"en\"\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://airys.chat/api/v1/accounts/{account_id}/portals")

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

request = Net::HTTP::Post.new(url)
request["api_access_token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"color\": \"#FFFFFF\",\n \"custom_domain\": \"chatwoot.help\",\n \"header_text\": \"Handbook\",\n \"homepage_link\": \"https://www.chatwoot.com/\",\n \"name\": \"Handbook\",\n \"page_title\": \"Handbook\",\n \"slug\": \"handbook\",\n \"archived\": false,\n \"config\": {\n \"allowed_locales\": [\n \"en\",\n \"es\"\n ],\n \"default_locale\": \"en\"\n }\n}"

response = http.request(request)
puts response.read_body
{
  "payload": [
    {
      "id": 123,
      "archived": true,
      "color": "<string>",
      "config": {
        "allowed_locales": [
          {
            "code": "<string>",
            "articles_count": 123,
            "categories_count": 123
          }
        ]
      },
      "custom_domain": "<string>",
      "header_text": "<string>",
      "homepage_link": "<string>",
      "name": "<string>",
      "slug": "<string>",
      "page_title": "<string>",
      "account_id": 123,
      "inbox": {
        "id": 123,
        "name": "<string>",
        "website_url": "<string>",
        "channel_type": "<string>",
        "avatar_url": "<string>",
        "widget_color": "<string>",
        "website_token": "<string>",
        "enable_auto_assignment": true,
        "web_widget_script": "<string>",
        "welcome_title": "<string>",
        "welcome_tagline": "<string>",
        "greeting_enabled": true,
        "greeting_message": "<string>",
        "channel_id": 123,
        "working_hours_enabled": true,
        "enable_email_collect": true,
        "csat_survey_enabled": true,
        "auto_assignment_config": {},
        "out_of_office_message": "<string>",
        "working_hours": [
          {
            "day_of_week": 123,
            "closed_all_day": true,
            "open_hour": 123,
            "open_minutes": 123,
            "close_hour": 123,
            "close_minutes": 123,
            "open_all_day": true
          }
        ],
        "timezone": "<string>",
        "callback_webhook_url": "<string>",
        "allow_messages_after_resolved": true,
        "lock_to_single_conversation": true,
        "sender_name_type": "<string>",
        "business_name": "<string>",
        "hmac_mandatory": true,
        "selected_feature_flags": [
          "<string>"
        ],
        "reply_time": "<string>",
        "messaging_service_sid": "<string>",
        "phone_number": "<string>",
        "medium": "<string>",
        "provider": "<string>"
      },
      "logo": {
        "id": 123,
        "portal_id": 123,
        "file_type": "<string>",
        "account_id": 123,
        "file_url": "<string>",
        "blob_id": 123,
        "filename": "<string>"
      },
      "meta": {
        "all_articles_count": 123,
        "archived_articles_count": 123,
        "published_count": 123,
        "draft_articles_count": 123,
        "categories_count": 123,
        "default_locale": "<string>"
      }
    }
  ]
}
{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}

Autorizações

api_access_token
string
header
obrigatório

Este token pode ser obtido visitando a página de perfil ou por meio do console rails. Fornece acesso a endpoints com base nos níveis de permissões do usuário. Este token pode ser salvo por um sistema externo quando o usuário é criado via API, para realizar atividades em nome do usuário.

Parâmetros de caminho

account_id
integer
obrigatório

O ID numérico da conta

Corpo

application/json
color
string

Cor do cabeçalho do centro de ajuda (help center) no formato hexadecimal

Exemplo:

"#FFFFFF"

custom_domain
string

Domínio personalizado para exibir o centro de ajuda.

Exemplo:

"chatwoot.help"

header_text
string

Cabeçalho do centro de ajuda

Exemplo:

"Handbook"

link para o painel principal

Exemplo:

"https://www.chatwoot.com/"

name
string

Nome para o portal

Exemplo:

"Handbook"

page_title
string

Título da página para o portal

Exemplo:

"Handbook"

slug
string

Slug para o portal exibir no link

Exemplo:

"handbook"

archived
boolean

Status para verificar se o portal está ativo (live)

Exemplo:

false

config
object

Configuração sobre localidades suportadas

Exemplo:
{
"allowed_locales": ["en", "es"],
"default_locale": "en"
}

Resposta

Sucesso

payload
object[]