Update a widget key
Changes the fields sent. Values the key already has change nothing.
curl --request PATCH \
--url https://app.lobbystack.com/api/v1/widget-keys/{widget_key_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "<string>",
"allowed_origins": [
"<string>"
],
"config": {
"color": "<string>",
"title": "<string>",
"subtitle": "<string>",
"greeting": "<string>"
}
}
'import requests
url = "https://app.lobbystack.com/api/v1/widget-keys/{widget_key_id}"
payload = {
"label": "<string>",
"allowed_origins": ["<string>"],
"config": {
"color": "<string>",
"title": "<string>",
"subtitle": "<string>",
"greeting": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
label: '<string>',
allowed_origins: ['<string>'],
config: {
color: '<string>',
title: '<string>',
subtitle: '<string>',
greeting: '<string>'
}
})
};
fetch('https://app.lobbystack.com/api/v1/widget-keys/{widget_key_id}', 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://app.lobbystack.com/api/v1/widget-keys/{widget_key_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'label' => '<string>',
'allowed_origins' => [
'<string>'
],
'config' => [
'color' => '<string>',
'title' => '<string>',
'subtitle' => '<string>',
'greeting' => '<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://app.lobbystack.com/api/v1/widget-keys/{widget_key_id}"
payload := strings.NewReader("{\n \"label\": \"<string>\",\n \"allowed_origins\": [\n \"<string>\"\n ],\n \"config\": {\n \"color\": \"<string>\",\n \"title\": \"<string>\",\n \"subtitle\": \"<string>\",\n \"greeting\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://app.lobbystack.com/api/v1/widget-keys/{widget_key_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"<string>\",\n \"allowed_origins\": [\n \"<string>\"\n ],\n \"config\": {\n \"color\": \"<string>\",\n \"title\": \"<string>\",\n \"subtitle\": \"<string>\",\n \"greeting\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.lobbystack.com/api/v1/widget-keys/{widget_key_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"<string>\",\n \"allowed_origins\": [\n \"<string>\"\n ],\n \"config\": {\n \"color\": \"<string>\",\n \"title\": \"<string>\",\n \"subtitle\": \"<string>\",\n \"greeting\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"label": "<string>",
"status": "active",
"allowed_origins": [
"<string>"
],
"config": {
"color": "<string>",
"position": "bottom-right",
"title": "<string>",
"subtitle": "<string>",
"greeting": "<string>",
"locale": "en",
"lead_form": {
"enabled": true,
"require_phone": true,
"require_email": true,
"show_before_chat": true
}
},
"last_used_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}Autorizaciones
An API key from Settings > API keys (lsk_...), which acts on its own business, or a platform key from the PLATFORM_API_KEYS setting (lsp_...), which onboards and manages businesses. Scopes: business:read, business:write, calls:read, contacts:read, contacts:write, appointments:read, appointments:write, messages:read, knowledge:read, knowledge:write, webhooks:manage, billing:manage, phone_numbers:manage, team:manage, businesses:create, users:create, phone_numbers:purchase, partner:read, partner.businesses:write, partner.demos:write, partner.packages:write, partner.branding:write, partner.templates:write, partner.team:write, partner.billing:read, partner.billing:write. Only platform keys can hold businesses:create and users:create, and only a key a partner made in its console can hold the partner scopes, which the Partner endpoints use. Only a partner's owners grant partner.billing:read and partner.billing:write.
Encabezados
Cuerpo
curl --request PATCH \
--url https://app.lobbystack.com/api/v1/widget-keys/{widget_key_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "<string>",
"allowed_origins": [
"<string>"
],
"config": {
"color": "<string>",
"title": "<string>",
"subtitle": "<string>",
"greeting": "<string>"
}
}
'import requests
url = "https://app.lobbystack.com/api/v1/widget-keys/{widget_key_id}"
payload = {
"label": "<string>",
"allowed_origins": ["<string>"],
"config": {
"color": "<string>",
"title": "<string>",
"subtitle": "<string>",
"greeting": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
label: '<string>',
allowed_origins: ['<string>'],
config: {
color: '<string>',
title: '<string>',
subtitle: '<string>',
greeting: '<string>'
}
})
};
fetch('https://app.lobbystack.com/api/v1/widget-keys/{widget_key_id}', 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://app.lobbystack.com/api/v1/widget-keys/{widget_key_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'label' => '<string>',
'allowed_origins' => [
'<string>'
],
'config' => [
'color' => '<string>',
'title' => '<string>',
'subtitle' => '<string>',
'greeting' => '<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://app.lobbystack.com/api/v1/widget-keys/{widget_key_id}"
payload := strings.NewReader("{\n \"label\": \"<string>\",\n \"allowed_origins\": [\n \"<string>\"\n ],\n \"config\": {\n \"color\": \"<string>\",\n \"title\": \"<string>\",\n \"subtitle\": \"<string>\",\n \"greeting\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://app.lobbystack.com/api/v1/widget-keys/{widget_key_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"<string>\",\n \"allowed_origins\": [\n \"<string>\"\n ],\n \"config\": {\n \"color\": \"<string>\",\n \"title\": \"<string>\",\n \"subtitle\": \"<string>\",\n \"greeting\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.lobbystack.com/api/v1/widget-keys/{widget_key_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"<string>\",\n \"allowed_origins\": [\n \"<string>\"\n ],\n \"config\": {\n \"color\": \"<string>\",\n \"title\": \"<string>\",\n \"subtitle\": \"<string>\",\n \"greeting\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"label": "<string>",
"status": "active",
"allowed_origins": [
"<string>"
],
"config": {
"color": "<string>",
"position": "bottom-right",
"title": "<string>",
"subtitle": "<string>",
"greeting": "<string>",
"locale": "en",
"lead_form": {
"enabled": true,
"require_phone": true,
"require_email": true,
"show_before_chat": true
}
},
"last_used_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}