"use strict";(self.webpackChunknewoaks_help=self.webpackChunknewoaks_help||[]).push([[9247],{767:(e,t,n)=>{n.d(t,{Ay:()=>m,TM:()=>d,VQ:()=>h,iW:()=>l,r3:()=>c,zV:()=>u});n(6540);var s=n(3532),r=n(8069),a=n(9303),o=n(4848);const i=function(e,t){void 0===t&&(t={});const n=JSON.stringify(e,null,2).split("\n"),s=[];return n.forEach((e=>{const n=e.match(/"([^"]+)":/);if(n&&t[n[1]]){const r=e.match(/^\s*/)?.[0]||"";s.push(`${r}// ${t[n[1]]}`)}s.push(e)})),s.join("\n")},d=e=>{let{path:t,method:n="POST"}=e;const r=(0,s.r)()(t)||`https://usapi.hottask.com${t}`;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("p",{children:[(0,o.jsx)("strong",{children:"Request URL:"})," ",r]}),(0,o.jsxs)("p",{children:[(0,o.jsx)("strong",{children:"Method:"})," ",n]})]})},l=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,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("p",{children:"The API request must include the following headers:"}),(0,o.jsx)("ul",{children:Object.entries(t).map((e=>{let[t,s]=e;return(0,o.jsxs)("li",{children:[(0,o.jsxs)("code",{children:[t,": ",s]})," - ",n[t]]},t)}))})]})},h=e=>{let{requestBody:t,requestBodyParams:n,addCommentsToJson:s=i}=e;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("p",{children:"The request body should contain the following parameters:"}),(0,o.jsx)(r.A,{language:"json",children:s(t,n)}),(0,o.jsx)("ul",{children:Object.entries(n).map((e=>{let[t,n]=e;return(0,o.jsxs)("li",{children:[(0,o.jsx)("code",{children:t})," - ",n]},t)}))})]})},c=e=>{let{method:t="POST",path:n,requestBody:i,headers:d={Authorization:"<Your-Secret-Key>","Content-Type":"application/json"}}=e;const l=(0,s.r)()(n),h="undefined"==typeof window?"usapi.hottask.com":new URL(l||`https://usapi.hottask.com${n}`).host,c={javascript:`const res = await fetch('${l||`https://usapi.hottask.com${n}`}', {\n  method: '${t}',\n  headers: ${JSON.stringify(d,null,2)}${i?`,\n  body: JSON.stringify(${JSON.stringify(i,null,2)})`:""}\n});\n\nconst data = await res.json();\nconsole.log(data);`,python:`import requests\nimport json\n\nurl = '${l||`https://usapi.hottask.com${n}`}'\nheaders = ${JSON.stringify(d,null,4)}${i?`,\nbody: JSON.stringify(${JSON.stringify(i,null,2)})`:""}\n\nresponse = requests.${t.toLowerCase()}(url, headers=headers, json=data)\ndata = response.json()\nprint(data)`,bash:`curl '${l||`https://usapi.hottask.com${n}`}' \\\n  -X ${t} \\\n${Object.entries(d).map((e=>{let[t,n]=e;return`  -H '${t}: ${n}' \\`})).join("\n")}\n${i?`  -d '${JSON.stringify(i)}'`:""}`,http:`${t} ${n} HTTP/1.1\nHost: ${h}\n${Object.entries(d).map((e=>{let[t,n]=e;return`${t}: ${n}`})).join("\n")}\n\n${i?`${JSON.stringify(i,null,2)}`:""}`};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(a.A,{as:"h3",children:"JavaScript (Fetch API)"}),(0,o.jsx)(r.A,{language:"javascript",children:c.javascript}),(0,o.jsx)(a.A,{as:"h3",children:"Python (Requests Library)"}),(0,o.jsx)(r.A,{language:"python",children:c.python}),(0,o.jsx)(a.A,{as:"h3",children:"cURL"}),(0,o.jsx)(r.A,{language:"bash",children:c.bash}),(0,o.jsx)(a.A,{as:"h3",children:"HTTP Request"}),(0,o.jsx)(r.A,{language:"http",children:c.http})]})},u=e=>{let{responseExample:t,responseComments:n,addCommentsToJson:s=i}=e;const a={...t,Version:"1.0.0",Success:!0,Code:200,Message:""},d={...n,Version:"string - API version",Success:"boolean - Operation success status",Code:"integer - HTTP status code",Message:"string - Error message if any"};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("p",{children:"The API response will be a JSON object with the following structure:"}),(0,o.jsx)(r.A,{language:"json",children:s(a,d)})]})},p=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,o.jsx)("div",{style:{whiteSpace:"pre-line"},children:t})};function m(e){let{title:t,path:n,method:r="POST",description:a="",requestBody:m={timeZone:"Asia/Shanghai",type:0},requestBodyDescription:j={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:x={timeZone:"string, required",type:"integer, required"},responseExample:g={Data:"3254a9d0424c4806b9ea3d0763xxxxxx",Version:"1.0.0",Success:!0,Code:200,Message:""},responseComments:f={Data:"chatbot id"},headers:y={Authorization:"<Your-Secret-Key>","Content-Type":"application/json"},headersDescription:b={Authorization:"The secret key for authenticating the API request.","Content-Type":"The content type of the request payload."},errorHandling:T="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 q=(0,s.r)()(n),w="undefined"==typeof window?"usapi.hottask.com":new URL(q||`https://usapi.hottask.com${n}`).host;JSON.stringify(y,null,2),i(m,x),JSON.stringify(y,null,4),i(m,x),r.toLowerCase(),Object.entries(y).map((e=>{let[t,n]=e;return`  -H '${t}: ${n}' \\`})).join("\n"),JSON.stringify(m),Object.entries(y).map((e=>{let[t,n]=e;return`${t}: ${n}`})).join("\n"),i(m,x);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(d,{path:n,method:r}),(0,o.jsx)(l,{headers:y,headersDescription:b}),(0,o.jsx)(h,{requestBody:m,requestBodyParams:j,addCommentsToJson:i}),(0,o.jsx)(c,{method:r,path:n,requestBody:m,headers:y}),(0,o.jsx)(u,{responseExample:g,responseComments:f,addCommentsToJson:i}),(0,o.jsx)(p,{errorHandling:T})]})}},3532:(e,t,n)=>{function s(){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:()=>s})},4405:(e,t,n)=>{n.d(t,{A:()=>o});n(6540);var s=n(9136),r=n(4848);function a(e){let{children:t,fallback:n}=e;return(0,s.A)()?(0,r.jsx)(r.Fragment,{children:t?.()}):n??null}function o(e){let{children:t}=e;return(0,r.jsx)(a,{children:()=>{const e=function(){return"undefined"==typeof window?"":window.location.hostname}();if("function"==typeof t){const n=t(e);return(0,r.jsx)("div",{className:"markdown markdown--section",children:n})}return(0,r.jsx)("code",{children:e})}})}},4609:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>d,default:()=>u,frontMatter:()=>i,metadata:()=>s,toc:()=>h});const s=JSON.parse('{"id":"api/project-data-managerment/delete-table-data","title":"Delete table data","description":"Delete table data API","source":"@site/developer/api/project-data-managerment/005.delete-table-data.md","sourceDirName":"api/project-data-managerment","slug":"/api/project-data-managerment/delete-table-data","permalink":"/guides/developer/api/project-data-managerment/delete-table-data","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":2,"frontMatter":{"sidebar_position":2},"sidebar":"sidebar","previous":{"title":"Create table data","permalink":"/guides/developer/api/project-data-managerment/create-table-data"},"next":{"title":"Update table data","permalink":"/guides/developer/api/project-data-managerment/update-table-data"}}');var r=n(4848),a=n(8453),o=n(767);n(4405),n(8175);const i={sidebar_position:2},d="Delete table data",l={},h=[{value:"Delete table data API",id:"delete-table-data-api",level:2},{value:"Endpoint",id:"endpoint",level:3},{value:"Request Headers",id:"request-headers",level:3},{value:"Request Body",id:"request-body",level:3},{value:"Example Request",id:"example-request",level:3},{value:"Response",id:"response",level:3},{value:"Error Handling",id:"error-handling",level:3}];function c(e){const t={code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",strong:"strong",ul:"ul",...(0,a.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.header,{children:(0,r.jsx)(t.h1,{id:"delete-table-data",children:"Delete table data"})}),"\n",(0,r.jsx)(t.h2,{id:"delete-table-data-api",children:"Delete table data API"}),"\n",(0,r.jsx)(t.h3,{id:"endpoint",children:"Endpoint"}),"\n",(0,r.jsx)(o.TM,{path:"/autodev/CustomTableValue/Delete/{{randomCode}}/{{customTableID}}"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"randomCode:"})," The project randomCode. Example: ",(0,r.jsx)(t.code,{children:"7qaucizgxdrb"})]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"customTableID:"})," The table ID. ",(0,r.jsx)(t.code,{children:"123"})]}),"\n",(0,r.jsxs)(t.li,{children:["Example: ",(0,r.jsx)(t.code,{children:"/autodev/CustomTableValue/Delete/7qaucizgxdrb/123"})]}),"\n"]}),"\n",(0,r.jsx)(t.h3,{id:"request-headers",children:"Request Headers"}),"\n",(0,r.jsx)(o.iW,{headers:{customauth:"project auth token","Content-Type":"application/json"},headersDescription:{customauth:"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)"}}),"\n",(0,r.jsx)(t.h3,{id:"request-body",children:"Request Body"}),"\n",(0,r.jsx)(o.VQ,{headers:{customauth:"project auth token","Content-Type":"application/json"},requestBody:{id:456},requestBodyParams:{id:"integer, required - The table data ID"}}),"\n",(0,r.jsx)(t.h3,{id:"example-request",children:"Example Request"}),"\n",(0,r.jsx)(o.r3,{method:"POST",path:"/autodev/CustomTableValue/Delete/{{randomCode}}/{{customTableID}}",requestBody:{id:456}}),"\n",(0,r.jsx)(t.h3,{id:"response",children:"Response"}),"\n",(0,r.jsx)(o.zV,{responseExample:{Data:1},responseComments:{Data:"int - The number of data items that were successfully operated"}}),"\n",(0,r.jsx)(t.h3,{id:"error-handling",children:"Error Handling"})]})}function u(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},8175:(e,t,n)=>{n.d(t,{A:()=>r});n(6540);var s=n(4848);function r(){return(0,s.jsx)("code",{children:"EZsite"})}}}]);