Skip to content
TriedDocs
Public endpoints

Get widget settings

Read how the chat widget should look for a public key, from its chat agent's widget settings.

GEThttps://api.tried.com.au/public/chat/config

Returns the widget settings of the public key's chat agent. The chat widget calls this when the page loads, before anything is shown, so changes in the chat builder reach your site without editing the snippet. With an A/B split (chat_agents on the key), the first agent's settings are used.

Call it from the browser: the request must carry an Origin that the key allows. No Authorization header is used, and no chat is started or billed.

Request#

Query parameters#

Parameter Type Required Description
public_key string Yes The public key, public_key_.... See Public keys.

Example request#

# A browser sends Origin itself; cURL must set it to an allowed domain.
curl "https://api.tried.com.au/public/chat/config?public_key=public_key_c6190cdfff21015a05ac4e386d1158ce" \
  -H "Origin: https://www.example.com"
// Runs in the browser on an allowed domain.
const res = await fetch("https://api.tried.com.au/public/chat/config?public_key=public_key_c6190cdfff21015a05ac4e386d1158ce");
const { widget } = await res.json();
import requests

res = requests.get(
    "https://api.tried.com.au/public/chat/config",
    params={"public_key": "public_key_c6190cdfff21015a05ac4e386d1158ce"},
    headers={"Origin": "https://www.example.com"},
)
widget = res.json()["widget"]

Response#

200 OK

{
  "widget": {
    "title": "Bright Dental",
    "subtitle": "We usually reply straight away",
    "color": "#2563eb",
    "position": "right",
    "placeholder": "Type a message",
    "teaser": "Questions? We're here to help.",
    "suggested_replies": ["Opening hours", "Book a check-up"],
    "pre_chat_form": { "enabled": true, "fields": ["name", "email"], "intro": "" }
  }
}
Field Type Description
widget object See Widget object. Defaults fill any field the agent has not set.

Errors#

Status When
400 public_key is missing.
403 Unknown public key (no such key, or the key has no chat agent), or Origin <origin> is not allowed for this key.
429 Per-IP rate limit exceeded. See Rate limits.

See Errors for the body format.