"use strict";(self.webpackChunknewoaks_help=self.webpackChunknewoaks_help||[]).push([[7496],{3222:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>h,default:()=>u,frontMatter:()=>l,metadata:()=>o,toc:()=>c});const o=JSON.parse('{"id":"api/chatbot/edit-chatbot","title":"Edit Chatbot Settings","description":"The  API enables you to update the configuration of a specified chatbot by sending a POST request to the /chat/Chatbot/Edit endpoint.","source":"@site/developer/api/002.chatbot/105.edit-chatbot.md","sourceDirName":"api/002.chatbot","slug":"/api/chatbot/edit-chatbot","permalink":"/guides/developer/api/chatbot/edit-chatbot","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":105,"frontMatter":{"sidebar_position":105},"sidebar":"sidebar","previous":{"title":"Create a chatbot","permalink":"/guides/developer/api/chatbot/create-a-chatbot"},"next":{"title":"Delete Chatbot","permalink":"/guides/developer/api/chatbot/delete-chatbot"}}');var s=n(4848),a=n(8453),i=n(767),r=n(8175);const l={sidebar_position:105},h="Edit Chatbot Settings",d={},c=[{value:"Endpoint",id:"endpoint",level:2},{value:"Request Headers",id:"request-headers",level:2},{value:"Request Body",id:"request-body",level:2},{value:"Example Request",id:"example-request",level:2},{value:"Response",id:"response",level:2},{value:"Error Handling",id:"error-handling",level:2}];function p(e){const t={code:"code",h1:"h1",h2:"h2",header:"header",p:"p",...(0,a.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.header,{children:(0,s.jsx)(t.h1,{id:"edit-chatbot-settings",children:"Edit Chatbot Settings"})}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(r.A,{})," API enables you to update the configuration of a specified chatbot by sending a ",(0,s.jsx)(t.code,{children:"POST"})," request to the ",(0,s.jsx)(t.code,{children:"/chat/Chatbot/Edit"})," endpoint."]}),"\n",(0,s.jsx)(t.h2,{id:"endpoint",children:"Endpoint"}),"\n",(0,s.jsx)(i.TM,{path:"/chat/Chatbot/Edit"}),"\n",(0,s.jsx)(t.h2,{id:"request-headers",children:"Request Headers"}),"\n",(0,s.jsx)(i.iW,{}),"\n",(0,s.jsx)(t.h2,{id:"request-body",children:"Request Body"}),"\n",(0,s.jsx)(i.VQ,{requestBody:{serialNumber:"3254a9d0424c4806b9ea3d0763ccfxxx",Name:"NewName",Model:"2",SystemMessage:"new Prompt",Temperature:0,TimeZone:"Asia/Shanghai",AnswerSuffix:"Asia/Shanghai",ChatProfilePicture:"34327",ChatIcon:"34327",ChatBubbleAlign:0,ChatBubbleColor:"rgb(37,99,235)",ChatbotPopupOnce:!0,ChatbotPrivacyPolicyDescription:"",ChatbotPrivacyPolicyName:"privacy policy",ChatbotPrivacyPolicyUrl:"",EnablePushToTalk:!1,EnableUploadImage:!1,FacebookUrl:"",InstagramUrl:"",RemoveChatLogOnBrowserClose:!1,SuggestedMessage:"",TalkToHumanEmail:"",TalkToHumanResponseMessage:"",UserInputPlaceholder:"",UserMessageColor:"rgb(59, 129, 246)",WelcomeMessage:"Hi this is your AI assistant! What can I help you with?",WhatsappUrl:"",VerifyDomain:!1,Domains:"",RateLimitCount:20,RateLimitMessage:"Too many messages in a row",RateLimitTime:240,CustomDomain:"",EmailForDailyChatLogs:"",EmailForDailyLeads:"",AIResponseLanguage:"",MessageLimit:-1},requestBodyParams:{serialNumber:"string, required - The unique identifier (ID) of the chatbot",Name:"string, optional - New name for the chatbot",Model:"string, optional - AI model ID, you can call the Get Model List interface to obtain",SystemMessage:"string, optional - System prompt for the chatbot",Temperature:"integer, optional - Temperature setting for responses",TimeZone:"string, optional - Time zone setting",AnswerSuffix:"string, optional - Text to append to answers",ChatProfilePicture:"string, optional - File ID for profile picture",ChatIcon:"string, optional - File ID for bubble icon",ChatBubbleAlign:"integer, optional - Alignment of chat bubble",ChatBubbleColor:"string, optional - Color of chat bubble (RGB format)",ChatbotPopupOnce:"boolean, optional - Whether to show popup only once",ChatbotPrivacyPolicyDescription:"string, optional - Privacy policy description",ChatbotPrivacyPolicyName:"string, optional - Privacy policy name",ChatbotPrivacyPolicyUrl:"string, optional - Privacy policy URL",EnablePushToTalk:"boolean, optional - Enable push-to-talk feature",EnableUploadImage:"boolean, optional - Enable image upload feature",FacebookUrl:"string, optional - Facebook page URL",InstagramUrl:"string, optional - Instagram profile URL",RemoveChatLogOnBrowserClose:"boolean, optional - Clear chat history on browser close",SuggestedMessage:"string, optional - Suggested messages",TalkToHumanEmail:"string, optional - Email for human handoff",TalkToHumanResponseMessage:"string, optional - Message when transferring to human",UserInputPlaceholder:"string, optional - Placeholder text for input field",UserMessageColor:"string, optional - Color of user messages (RGB format)",WelcomeMessage:"string, optional - Initial greeting message",WhatsappUrl:"string, optional - WhatsApp contact URL",VerifyDomain:"boolean, optional - Enable domain verification",Domains:"string, optional - Allowed domains for embedding",RateLimitCount:"integer, optional - Maximum messages allowed",RateLimitMessage:"string, optional - Rate limit exceeded message",RateLimitTime:"integer, optional - Rate limit duration in seconds",CustomDomain:"string, optional - Custom domain for embedding",EmailForDailyChatLogs:"string, optional - Email for daily chat logs",EmailForDailyLeads:"string, optional - Email for daily leads",AIResponseLanguage:"string, optional - Language for AI responses (use full language name, e.g., 'English', 'Spanish', 'French')",MessageLimit:"integer, optional - Maximum number of messages allowed for every month (default is -1, which means unlimited)"}}),"\n",(0,s.jsx)(t.h2,{id:"example-request",children:"Example Request"}),"\n",(0,s.jsx)(i.r3,{path:"/chat/Chatbot/Edit",requestBody:{serialNumber:"3254a9d0424c4806b9ea3d0763ccfxxx",Name:"NewName"}}),"\n",(0,s.jsx)(t.h2,{id:"response",children:"Response"}),"\n",(0,s.jsx)(i.zV,{responseExample:{Data:1,Version:"1.0.0",Success:!0,Code:200,Message:""},responseComments:{Data:"integer - Operation result (1 indicates success)",Version:"string - API version",Success:"boolean - Overall success status",Code:"integer - HTTP status code",Message:"string - Error message if any"}}),"\n",(0,s.jsx)(t.h2,{id:"error-handling",children:"Error Handling"}),"\n",(0,s.jsx)(i.NH,{})]})}function u(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}},767:(e,t,n)=>{n.d(t,{Ay:()=>m,NH:()=>u,TM:()=>l,VQ:()=>d,iW:()=>h,r3:()=>c,zV:()=>p});n(6540);var o=n(3532),s=n(8069),a=n(9303),i=n(4848);const r=function(e,t){void 0===t&&(t={});const n=JSON.stringify(e,null,2).split("\n"),o=[];return n.forEach((e=>{const n=e.match(/"([^"]+)":/);if(n&&t[n[1]]){const s=e.match(/^\s*/)?.[0]||"";o.push(`${s}// ${t[n[1]]}`)}o.push(e)})),o.join("\n")},l=e=>{let{path:t,method:n="POST"}=e;const s=(0,o.r)()(t)||`https://usapi.hottask.com${t}`;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("p",{children:[(0,i.jsx)("strong",{children:"Request URL:"})," ",s]}),(0,i.jsxs)("p",{children:[(0,i.jsx)("strong",{children:"Method:"})," ",n]})]})},h=e=>{let{headers:t={Authorization:"<Your-Secret-Key>","Content-Type":"application/json"},headersDescription:n={Authorization:"string, required - The secret key for authenticating the API request","Content-Type":"string, required - The content type of the request payload (must be application/json)"}}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("p",{children:"The API request must include the following headers:"}),(0,i.jsx)("ul",{children:Object.entries(t).map((e=>{let[t,o]=e;return(0,i.jsxs)("li",{children:[(0,i.jsxs)("code",{children:[t,": ",o]})," - ",n[t]]},t)}))})]})},d=e=>{let{requestBody:t,requestBodyParams:n,addCommentsToJson:o=r}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("p",{children:"The request body should contain the following parameters:"}),(0,i.jsx)(s.A,{language:"json",children:o(t,n)}),(0,i.jsx)("ul",{children:Object.entries(n).map((e=>{let[t,n]=e;return(0,i.jsxs)("li",{children:[(0,i.jsx)("code",{children:t})," - ",n]},t)}))})]})},c=e=>{let{method:t="POST",path:n,requestBody:r,headers:l={Authorization:"<Your-Secret-Key>","Content-Type":"application/json"}}=e;const h=(0,o.r)()(n),d="undefined"==typeof window?"usapi.hottask.com":new URL(h||`https://usapi.hottask.com${n}`).host,c={javascript:`const res = await fetch('${h||`https://usapi.hottask.com${n}`}', {\n  method: '${t}',\n  headers: ${JSON.stringify(l,null,2)},\n  body: JSON.stringify(${JSON.stringify(r,null,2)})\n});\n\nconst data = await res.json();\nconsole.log(data);`,python:`import requests\nimport json\n\nurl = '${h||`https://usapi.hottask.com${n}`}'\nheaders = ${JSON.stringify(l,null,4)}\ndata = ${JSON.stringify(r,null,2)}\n\nresponse = requests.${t.toLowerCase()}(url, headers=headers, json=data)\ndata = response.json()\nprint(data)`,bash:`curl '${h||`https://usapi.hottask.com${n}`}' \\\n  -X ${t} \\\n${Object.entries(l).map((e=>{let[t,n]=e;return`  -H '${t}: ${n}' \\`})).join("\n")}\n  -d '${JSON.stringify(r)}'`,http:`${t} ${n} HTTP/1.1\nHost: ${d}\n${Object.entries(l).map((e=>{let[t,n]=e;return`${t}: ${n}`})).join("\n")}\n\n${JSON.stringify(r,null,2)}`};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a.A,{as:"h3",children:"JavaScript (Fetch API)"}),(0,i.jsx)(s.A,{language:"javascript",children:c.javascript}),(0,i.jsx)(a.A,{as:"h3",children:"Python (Requests Library)"}),(0,i.jsx)(s.A,{language:"python",children:c.python}),(0,i.jsx)(a.A,{as:"h3",children:"cURL"}),(0,i.jsx)(s.A,{language:"bash",children:c.bash}),(0,i.jsx)(a.A,{as:"h3",children:"HTTP Request"}),(0,i.jsx)(s.A,{language:"http",children:c.http})]})},p=e=>{let{responseExample:t,responseComments:n,addCommentsToJson:o=r}=e;const a={...t,Version:"1.0.0",Success:!0,Code:200,Message:""},l={...n,Version:"string - API version",Success:"boolean - Operation success status",Code:"integer - HTTP status code",Message:"string - Error message if any"};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("p",{children:"The API response will be a JSON object with the following structure:"}),(0,i.jsx)(s.A,{language:"json",children:o(a,l)})]})},u=e=>{let{errorHandling:t="If the request fails, you should:\n1. Check the HTTP status code for network-level errors\n2. Examine the `Code` and `Message` fields in the response for business-level errors\n3. The `Message` field will contain detailed error information"}=e;return(0,i.jsx)("div",{style:{whiteSpace:"pre-line"},children:t})};function m(e){let{title:t,path:n,method:s="POST",description:a="",requestBody:m={timeZone:"Asia/Shanghai",type:0},requestBodyDescription:g={timeZone:"The time zone of the chatbot. The standard time zone format: e.g., Asia/Shanghai or America/New_York.",type:"Create a generic chatbot with a fixed value of 0"},requestBodyComments:b={timeZone:"string, required",type:"integer, required"},responseExample:f={Data:"3254a9d0424c4806b9ea3d0763xxxxxx",Version:"1.0.0",Success:!0,Code:200,Message:""},responseComments:y={Data:"chatbot id"},headers:x={Authorization:"<Your-Secret-Key>","Content-Type":"application/json"},headersDescription:j={Authorization:"The secret key for authenticating the API request.","Content-Type":"The content type of the request payload."},errorHandling:C="If it's an HTTP network error, you should check the `HTTP status code`. If it's a business exception, you need to examine the `Code` and `Message` fields, which will provide the error details."}=e;const w=(0,o.r)()(n),T="undefined"==typeof window?"usapi.hottask.com":new URL(w||`https://usapi.hottask.com${n}`).host;JSON.stringify(x,null,2),r(m,b),JSON.stringify(x,null,4),r(m,b),s.toLowerCase(),Object.entries(x).map((e=>{let[t,n]=e;return`  -H '${t}: ${n}' \\`})).join("\n"),JSON.stringify(m),Object.entries(x).map((e=>{let[t,n]=e;return`${t}: ${n}`})).join("\n"),r(m,b);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l,{path:n,method:s}),(0,i.jsx)(h,{headers:x,headersDescription:j}),(0,i.jsx)(d,{requestBody:m,requestBodyParams:g,addCommentsToJson:r}),(0,i.jsx)(c,{method:s,path:n,requestBody:m,headers:x}),(0,i.jsx)(p,{responseExample:f,responseComments:y,addCommentsToJson:r}),(0,i.jsx)(u,{errorHandling:C})]})}},8175:(e,t,n)=>{n.d(t,{A:()=>a});n(6540);var o=n(5872),s=n(4848);function a(){let e=(0,o.K)()();return["newoaks.ai","www.newoaks.ai","eu.newoaks.ai"].includes(e)&&(e="NewOaks AI"),"appointify.ai"===e&&(e="Appointify AI"),(0,s.jsx)("code",{children:e})}},3532:(e,t,n)=>{function o(){return function(e){if("undefined"==typeof window)return"";const t=window.location.hostname;let n="";return n="www.newoaks.ai"==t||"newoaks.ai"==t?"https://usapi.hottask.com":"eu.newoaks.ai"==t?"https://euapi.hottask.com":`https://${t}`,e?`${n}${e.startsWith("/")?e:`/${e}`}`:n}}n.d(t,{r:()=>o})},5872:(e,t,n)=>{function o(){return function(){return"undefined"==typeof window?"":window.location.hostname}}n.d(t,{K:()=>o})}}]);