"use strict";(self.webpackChunknewoaks_help=self.webpackChunknewoaks_help||[]).push([[1289],{767:(e,t,n)=>{n.d(t,{Ay:()=>m,TM:()=>l,VQ:()=>c,iW:()=>d,r3:()=>h,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")},l=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]})]})},d=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)}))})]})},c=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)}))})]})},h=e=>{let{method:t="POST",path:n,requestBody:i,headers:l={Authorization:"<Your-Secret-Key>","Content-Type":"application/json"}}=e;const d=(0,s.r)()(n),c="undefined"==typeof window?"usapi.hottask.com":new URL(d||`https://usapi.hottask.com${n}`).host,h={javascript:`const res = await fetch('${d||`https://usapi.hottask.com${n}`}', {\n method: '${t}',\n headers: ${JSON.stringify(l,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 = '${d||`https://usapi.hottask.com${n}`}'\nheaders = ${JSON.stringify(l,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 '${d||`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${i?` -d '${JSON.stringify(i)}'`:""}`,http:`${t} ${n} HTTP/1.1\nHost: ${c}\n${Object.entries(l).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:h.javascript}),(0,o.jsx)(a.A,{as:"h3",children:"Python (Requests Library)"}),(0,o.jsx)(r.A,{language:"python",children:h.python}),(0,o.jsx)(a.A,{as:"h3",children:"cURL"}),(0,o.jsx)(r.A,{language:"bash",children:h.bash}),(0,o.jsx)(a.A,{as:"h3",children:"HTTP Request"}),(0,o.jsx)(r.A,{language:"http",children:h.http})]})},u=e=>{let{responseExample:t,responseComments:n,addCommentsToJson:s=i}=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,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,l)})]})},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:g={timeZone:"string, required",type:"integer, required"},responseExample:x={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:T={Authorization:"The secret key for authenticating the API request.","Content-Type":"The content type of the request payload."},errorHandling:b="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,s.r)()(n),$="undefined"==typeof window?"usapi.hottask.com":new URL(w||`https://usapi.hottask.com${n}`).host;JSON.stringify(y,null,2),i(m,g),JSON.stringify(y,null,4),i(m,g),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,g);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(l,{path:n,method:r}),(0,o.jsx)(d,{headers:y,headersDescription:T}),(0,o.jsx)(c,{requestBody:m,requestBodyParams:j,addCommentsToJson:i}),(0,o.jsx)(h,{method:r,path:n,requestBody:m,headers:y}),(0,o.jsx)(u,{responseExample:x,responseComments:f,addCommentsToJson:i}),(0,o.jsx)(p,{errorHandling:b})]})}},2932:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>l,default:()=>u,frontMatter:()=>i,metadata:()=>s,toc:()=>c});const s=JSON.parse('{"id":"api/project-data-managerment/get-table-collection","title":"Get Table Collection","description":"GetTableList Api","source":"@site/developer/api/project-data-managerment/002.get-table-collection.md","sourceDirName":"api/project-data-managerment","slug":"/api/project-data-managerment/get-table-collection","permalink":"/guides/developer/api/project-data-managerment/get-table-collection","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":2,"frontMatter":{"sidebar_position":2},"sidebar":"sidebar","previous":{"title":"Get API authentication information","permalink":"/guides/developer/api/project-data-managerment/get-aPI-authentication-information"},"next":{"title":"Get Table Data Collection","permalink":"/guides/developer/api/project-data-managerment/get-table-data-collection"}}');var r=n(4848),a=n(8453),o=n(767);n(4405),n(8175);const i={sidebar_position:2},l="Get Table Collection",d={},c=[{value:"GetTableList Api",id:"gettablelist-api",level:2},{value:"Endpoint",id:"endpoint",level:3},{value:"Request Headers",id:"request-headers",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 h(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:"get-table-collection",children:"Get Table Collection"})}),"\n",(0,r.jsx)(t.h2,{id:"gettablelist-api",children:"GetTableList Api"}),"\n",(0,r.jsx)(t.h3,{id:"endpoint",children:"Endpoint"}),"\n",(0,r.jsx)(o.TM,{path:"/autodev/CustomTableValue/GetTableList/{{randomCode}}",method:"GET"}),"\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:["Example: ",(0,r.jsx)(t.code,{children:"/autodev/CustomTableValue/GetTableList/7qaucizgxdrb"}),"."]}),"\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:"example-request",children:"Example Request"}),"\n",(0,r.jsx)(o.r3,{method:"GET",path:"/autodev/CustomTableValue/GetTableList/{{randomCode}}",headers:{customauth:"project auth token","Content-Type":"application/json"}}),"\n",(0,r.jsx)(t.h3,{id:"response",children:"Response"}),"\n",(0,r.jsx)(o.zV,{responseExample:{Data:[{ID:123,TableName:"easysite_auth_users",TableDisplayName:"easysite auth users",FieldDefinitions:[{FieldName:"id"}]}]},responseComments:{Data:"array - The project tables"}}),"\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)(h,{...e})}):h(e)}},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})}})}},8175:(e,t,n)=>{n.d(t,{A:()=>r});n(6540);var s=n(4848);function r(){return(0,s.jsx)("code",{children:"EZsite"})}}}]);