Pular para o conteúdo principal
POST
/
api
/
v1
/
accounts
/
{account_id}
/
inboxes
Criar an inbox
curl --request POST \
  --url https://airys.chat/api/v1/accounts/{account_id}/inboxes \
  --header 'Content-Type: application/json' \
  --header 'api_access_token: <api-key>' \
  --data '
{
  "name": "Support",
  "avatar": "<string>",
  "greeting_enabled": true,
  "greeting_message": "Hello, how can I help you?",
  "enable_email_collect": true,
  "csat_survey_enabled": true,
  "enable_auto_assignment": true,
  "working_hours_enabled": true,
  "out_of_office_message": "We are currently out of office. Please leave a message and we will get back to you.",
  "timezone": "America/New_York",
  "allow_messages_after_resolved": true,
  "lock_to_single_conversation": true,
  "portal_id": 1,
  "sender_name_type": "friendly",
  "business_name": "My Business",
  "channel": {
    "type": "web_widget",
    "website_url": "https://example.com",
    "welcome_title": "Welcome to our support",
    "welcome_tagline": "We are here to help you",
    "widget_color": "#FF5733"
  }
}
'
import requests

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

payload = {
    "name": "Support",
    "avatar": "<string>",
    "greeting_enabled": True,
    "greeting_message": "Hello, how can I help you?",
    "enable_email_collect": True,
    "csat_survey_enabled": True,
    "enable_auto_assignment": True,
    "working_hours_enabled": True,
    "out_of_office_message": "We are currently out of office. Please leave a message and we will get back to you.",
    "timezone": "America/New_York",
    "allow_messages_after_resolved": True,
    "lock_to_single_conversation": True,
    "portal_id": 1,
    "sender_name_type": "friendly",
    "business_name": "My Business",
    "channel": {
        "type": "web_widget",
        "website_url": "https://example.com",
        "welcome_title": "Welcome to our support",
        "welcome_tagline": "We are here to help you",
        "widget_color": "#FF5733"
    }
}
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({
    name: 'Support',
    avatar: '<string>',
    greeting_enabled: true,
    greeting_message: 'Hello, how can I help you?',
    enable_email_collect: true,
    csat_survey_enabled: true,
    enable_auto_assignment: true,
    working_hours_enabled: true,
    out_of_office_message: 'We are currently out of office. Please leave a message and we will get back to you.',
    timezone: 'America/New_York',
    allow_messages_after_resolved: true,
    lock_to_single_conversation: true,
    portal_id: 1,
    sender_name_type: 'friendly',
    business_name: 'My Business',
    channel: {
      type: 'web_widget',
      website_url: 'https://example.com',
      welcome_title: 'Welcome to our support',
      welcome_tagline: 'We are here to help you',
      widget_color: '#FF5733'
    }
  })
};

fetch('https://airys.chat/api/v1/accounts/{account_id}/inboxes', 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}/inboxes",
  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([
    'name' => 'Support',
    'avatar' => '<string>',
    'greeting_enabled' => true,
    'greeting_message' => 'Hello, how can I help you?',
    'enable_email_collect' => true,
    'csat_survey_enabled' => true,
    'enable_auto_assignment' => true,
    'working_hours_enabled' => true,
    'out_of_office_message' => 'We are currently out of office. Please leave a message and we will get back to you.',
    'timezone' => 'America/New_York',
    'allow_messages_after_resolved' => true,
    'lock_to_single_conversation' => true,
    'portal_id' => 1,
    'sender_name_type' => 'friendly',
    'business_name' => 'My Business',
    'channel' => [
        'type' => 'web_widget',
        'website_url' => 'https://example.com',
        'welcome_title' => 'Welcome to our support',
        'welcome_tagline' => 'We are here to help you',
        'widget_color' => '#FF5733'
    ]
  ]),
  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}/inboxes"

	payload := strings.NewReader("{\n  \"name\": \"Support\",\n  \"avatar\": \"<string>\",\n  \"greeting_enabled\": true,\n  \"greeting_message\": \"Hello, how can I help you?\",\n  \"enable_email_collect\": true,\n  \"csat_survey_enabled\": true,\n  \"enable_auto_assignment\": true,\n  \"working_hours_enabled\": true,\n  \"out_of_office_message\": \"We are currently out of office. Please leave a message and we will get back to you.\",\n  \"timezone\": \"America/New_York\",\n  \"allow_messages_after_resolved\": true,\n  \"lock_to_single_conversation\": true,\n  \"portal_id\": 1,\n  \"sender_name_type\": \"friendly\",\n  \"business_name\": \"My Business\",\n  \"channel\": {\n    \"type\": \"web_widget\",\n    \"website_url\": \"https://example.com\",\n    \"welcome_title\": \"Welcome to our support\",\n    \"welcome_tagline\": \"We are here to help you\",\n    \"widget_color\": \"#FF5733\"\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}/inboxes")
  .header("api_access_token", "<api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Support\",\n  \"avatar\": \"<string>\",\n  \"greeting_enabled\": true,\n  \"greeting_message\": \"Hello, how can I help you?\",\n  \"enable_email_collect\": true,\n  \"csat_survey_enabled\": true,\n  \"enable_auto_assignment\": true,\n  \"working_hours_enabled\": true,\n  \"out_of_office_message\": \"We are currently out of office. Please leave a message and we will get back to you.\",\n  \"timezone\": \"America/New_York\",\n  \"allow_messages_after_resolved\": true,\n  \"lock_to_single_conversation\": true,\n  \"portal_id\": 1,\n  \"sender_name_type\": \"friendly\",\n  \"business_name\": \"My Business\",\n  \"channel\": {\n    \"type\": \"web_widget\",\n    \"website_url\": \"https://example.com\",\n    \"welcome_title\": \"Welcome to our support\",\n    \"welcome_tagline\": \"We are here to help you\",\n    \"widget_color\": \"#FF5733\"\n  }\n}")
  .asString();
require 'uri'
require 'net/http'

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

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  \"name\": \"Support\",\n  \"avatar\": \"<string>\",\n  \"greeting_enabled\": true,\n  \"greeting_message\": \"Hello, how can I help you?\",\n  \"enable_email_collect\": true,\n  \"csat_survey_enabled\": true,\n  \"enable_auto_assignment\": true,\n  \"working_hours_enabled\": true,\n  \"out_of_office_message\": \"We are currently out of office. Please leave a message and we will get back to you.\",\n  \"timezone\": \"America/New_York\",\n  \"allow_messages_after_resolved\": true,\n  \"lock_to_single_conversation\": true,\n  \"portal_id\": 1,\n  \"sender_name_type\": \"friendly\",\n  \"business_name\": \"My Business\",\n  \"channel\": {\n    \"type\": \"web_widget\",\n    \"website_url\": \"https://example.com\",\n    \"welcome_title\": \"Welcome to our support\",\n    \"welcome_tagline\": \"We are here to help you\",\n    \"widget_color\": \"#FF5733\"\n  }\n}"

response = http.request(request)
puts response.read_body
{
  "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>"
}
{
  "description": "<string>",
  "errors": [
    {
      "field": "<string>",
      "message": "<string>",
      "code": "<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
name
string

O nome da caixa de entrada

Exemplo:

"Support"

avatar
file

Arquivo de imagem para avatar

greeting_enabled
boolean

Ativar mensagem de saudação

Exemplo:

true

greeting_message
string

Mensagem de saudação a ser exibida no widget

Exemplo:

"Hello, how can I help you?"

enable_email_collect
boolean

Habilitar coleta de e-mail

Exemplo:

true

csat_survey_enabled
boolean

Habilitar pesquisa CSAT

Exemplo:

true

enable_auto_assignment
boolean

Habilitar Atribuição Automática

Exemplo:

true

working_hours_enabled
boolean

Habilitar horário comercial

Exemplo:

true

out_of_office_message
string

Mensagem de ausência temporária (Out of office) a ser exibida no widget

Exemplo:

"We are currently out of office. Please leave a message and we will get back to you."

timezone
string

Fuso horário da caixa de entrada

Exemplo:

"America/New_York"

allow_messages_after_resolved
boolean

Permitir mensagens após a conversa ser resolvida

Exemplo:

true

lock_to_single_conversation
boolean

Bloquear para conversa única

Exemplo:

true

portal_id
integer

Id do portal do centro de ajuda (help center) a ser anexado à caixa de entrada

Exemplo:

1

sender_name_type
enum<string>

Tipo de nome do remetente para a caixa de entrada

Opções disponíveis:
friendly,
professional
Exemplo:

"friendly"

business_name
string

Nome da empresa para a caixa de entrada

Exemplo:

"My Business"

channel
object

Resposta

Sucesso

id
number

ID da caixa de entrada

name
string

O nome da caixa de entrada

website_url
string

URL do site

channel_type
string

O tipo da caixa de entrada

avatar_url
string

A imagem de avatar da caixa de entrada

widget_color
string

Cor do widget usada para personalização do widget

website_token
string

Token do site

enable_auto_assignment
boolean

A sinalização que mostra se a Atribuição Automática está habilitada ou não

web_widget_script
string

Script usado para carregar o widget do site

welcome_title
string | null

Título de boas-vindas a ser exibido no widget

welcome_tagline
string | null

Slogan de boas-vindas a ser exibido no widget

greeting_enabled
boolean

A sinalização que mostra se a saudação está habilitada

greeting_message
string | null

Uma mensagem de saudação quando o usuário inicia a conversa

channel_id
number

ID do canal ao qual esta caixa de entrada pertence

working_hours_enabled
boolean

A sinalização que mostra se o recurso de horário comercial está ativado

enable_email_collect
boolean

A sinalização para permitir a coleta de e-mail de contatos

csat_survey_enabled
boolean

A sinalização para habilitar a pesquisa CSAT

auto_assignment_config
object

Configurações para atribuição automática

out_of_office_message
string | null

Mensagem para mostrar quando os agentes estiverem fora do escritório

working_hours
object[]

Configuração para o horário comercial da caixa de entrada

timezone
string

Configuração de fuso horário para a caixa de entrada

callback_webhook_url
string | null

URL do webhook para callbacks

allow_messages_after_resolved
boolean

Se deve permitir mensagens após uma conversa ser resolvida

lock_to_single_conversation
boolean

Se deve bloquear um contato a uma única conversa

sender_name_type
string

Tipo de nome do remetente a ser exibido (ex., amigável)

business_name
string | null

Nome da empresa associada à caixa de entrada

hmac_mandatory
boolean

Se a verificação HMAC é obrigatória

selected_feature_flags
string[] | null

Sinalizadores de recursos (feature flags) selecionados para a caixa de entrada

reply_time
string

Tempo de resposta esperado

messaging_service_sid
string | null

SID do serviço de mensagens para provedores de SMS

phone_number
string | null

Número de telefone associado à caixa de entrada

medium
string

Meio de comunicação (ex., sms, email)

provider
string | null

Provedor do canal