"use strict";(self.webpackChunknewoaks_help=self.webpackChunknewoaks_help||[]).push([[8339],{14:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>h,contentTitle:()=>d,default:()=>c,frontMatter:()=>l,metadata:()=>r,toc:()=>p});const r=JSON.parse('{"id":"api/realestate/get-list","title":"Get Real Estate List","description":"The API provides functionality to retrieve a list of real estate listings by sending a POST request to the /chat/Chatbot/RealEstateList endpoint.","source":"@site/developer/api/004.realestate/004.get-list.md","sourceDirName":"api/004.realestate","slug":"/api/realestate/get-list","permalink":"/guides/developer/api/realestate/get-list","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":4,"frontMatter":{"sidebar_position":4},"sidebar":"sidebar","previous":{"title":"Delete Real Estate","permalink":"/guides/developer/api/realestate/delete"},"next":{"title":"Lead/Appointment Data API","permalink":"/guides/developer/api/lead"}}');var n=s(4848),a=s(8453),i=(s(9357),s(8175)),o=s(767);const l={sidebar_position:4},d="Get Real Estate List",h={},p=[{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 u(e){const t={code:"code",h1:"h1",h2:"h2",header:"header",p:"p",...(0,a.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.header,{children:(0,n.jsx)(t.h1,{id:"get-real-estate-list",children:"Get Real Estate List"})}),"\n",(0,n.jsxs)(t.p,{children:["The ",(0,n.jsx)(i.A,{})," API provides functionality to retrieve a list of real estate listings by sending a ",(0,n.jsx)(t.code,{children:"POST"})," request to the ",(0,n.jsx)(t.code,{children:"/chat/Chatbot/RealEstateList"})," endpoint."]}),"\n",(0,n.jsx)(t.h2,{id:"endpoint",children:"Endpoint"}),"\n",(0,n.jsx)(o.TM,{path:"/chat/Chatbot/RealEstateList"}),"\n",(0,n.jsx)(t.h2,{id:"request-headers",children:"Request Headers"}),"\n",(0,n.jsx)(o.iW,{headers:{"chatrobot-sessionkey":"<Your-Session-Key>"},headersDescription:{"chatrobot-sessionkey":"string, required - The session key for authenticating the API request (found on the Workspace -> Webhooks API -> chatrobot-sessionkey)"}}),"\n",(0,n.jsx)(t.h2,{id:"request-body",children:"Request Body"}),"\n",(0,n.jsx)(o.VQ,{requestBody:{SerialNumber:"3254a9d0424c4806b9ea3d0763xxxxxx",CityName:"Los Angeles",SaleType:"for_sale",MLSNumber:"MLS123456",PageNumber:1,PageSize:20},requestBodyParams:{SerialNumber:"string, required - The ID of the chatbot (found on the chatbot settings -> general -> chatbot ID)",CityName:"string, optional - Filter properties by city name",SaleType:"string, optional - Must be one of: [for_sale, for_rent]",MLSNumber:"string, optional - Filter properties by MLS number",PageNumber:"integer, optional - Page number for pagination (default: 1)",PageSize:"integer, optional - Number of items per page (default: 20)"}}),"\n",(0,n.jsx)(t.h2,{id:"example-request",children:"Example Request"}),"\n",(0,n.jsx)(o.r3,{path:"/chat/Chatbot/RealEstateList",requestBody:{SerialNumber:"3254a9d0424c4806b9ea3d0763xxxxxx",CityName:"Los Angeles",SaleType:"for_sale",PageNumber:1,PageSize:20},headers:{"chatrobot-sessionkey":"<Your-Session-Key>"}}),"\n",(0,n.jsx)(t.h2,{id:"response",children:"Response"}),"\n",(0,n.jsx)(o.zV,{responseExample:{Data:{List:[{ID:7459,PropertyType:"Single Family Residential",SaleType:"For Rent",Status:"Active",Images:"",CurrencySymbol:"$",Price:"80000.00",State:"CA",City:"Los Angeles",Address:"123 Main St",ZIP:"90001",LATITUDE:30.96,LONGITUDE:-78.93,Area:"Downtown",Bathrooms:"4",Bedrooms:"4",Url:"https://example.com/property/123",Tours:"3D",YearBuilt:"2020",MLSNumber:"MLS123456",DaysOnMarket:"20",LotArea:"800",BuildingArea:"2500",ParkingSpots:"8",Description:"Beautiful property in prime location",ExtensionColumn:"[{'Key':'Pool', 'value':'Yes'}]",RentPrice:"80000.00",SpaceType:"Entire place",DepositFee:"5000.00",SalePrice:"",UnitAreaPrice:"",ZestimatePrice:"",HOAMonth:""}],VirtualCount:10}},responseComments:{Data:"object - The response data","Data.List":"array - List of properties","Data.List[].ID":"integer - Property ID","Data.List[].PropertyType":"string - Type of property","Data.List[].SaleType":"string - Sale type (For Sale/For Rent)","Data.List[].Status":"string - Property status","Data.List[].Images":"string - Property images","Data.List[].CurrencySymbol":"string - Currency symbol","Data.List[].Price":"string - Property price","Data.List[].State":"string - State name","Data.List[].City":"string - City name","Data.List[].Address":"string - Property address","Data.List[].ZIP":"string - ZIP code","Data.List[].LATITUDE":"number - Property latitude","Data.List[].LONGITUDE":"number - Property longitude","Data.List[].Area":"string - Area name","Data.List[].Bathrooms":"string - Number of bathrooms","Data.List[].Bedrooms":"string - Number of bedrooms","Data.List[].Url":"string - Property URL","Data.List[].Tours":"string - Tour type","Data.List[].YearBuilt":"string - Year built","Data.List[].MLSNumber":"string - MLS number","Data.List[].DaysOnMarket":"string - Days on market","Data.List[].LotArea":"string - Lot area","Data.List[].BuildingArea":"string - Building area","Data.List[].ParkingSpots":"string - Number of parking spots","Data.List[].Description":"string - Property description","Data.List[].ExtensionColumn":"string - Additional property information","Data.List[].RentPrice":"string - Rent price","Data.List[].SpaceType":"string - Space type","Data.List[].DepositFee":"string - Deposit fee","Data.List[].SalePrice":"string - Sale price","Data.List[].UnitAreaPrice":"string - Price per unit area","Data.List[].ZestimatePrice":"string - Zestimate price","Data.List[].HOAMonth":"string - Monthly HOA fee","Data.VirtualCount":"integer - Total number of properties matching the filter"}}),"\n",(0,n.jsx)(t.h2,{id:"error-handling",children:"Error Handling"}),"\n",(0,n.jsx)(o.NH,{})]})}function c(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(u,{...e})}):u(e)}},767:(e,t,s)=>{s.d(t,{Ay:()=>g,NH:()=>c,TM:()=>l,VQ:()=>h,iW:()=>d,r3:()=>p,zV:()=>u});s(6540);var r=s(3532),n=s(8069),a=s(9303),i=s(4848);const o=function(e,t){void 0===t&&(t={});const s=JSON.stringify(e,null,2).split("\n"),r=[];return s.forEach((e=>{const s=e.match(/"([^"]+)":/);if(s&&t[s[1]]){const n=e.match(/^\s*/)?.[0]||"";r.push(`${n}// ${t[s[1]]}`)}r.push(e)})),r.join("\n")},l=e=>{let{path:t,method:s="POST"}=e;const n=(0,r.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:"})," ",n]}),(0,i.jsxs)("p",{children:[(0,i.jsx)("strong",{children:"Method:"})," ",s]})]})},d=e=>{let{headers:t={Authorization:"<Your-Secret-Key>","Content-Type":"application/json"},headersDescription:s={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,r]=e;return(0,i.jsxs)("li",{children:[(0,i.jsxs)("code",{children:[t,": ",r]})," - ",s[t]]},t)}))})]})},h=e=>{let{requestBody:t,requestBodyParams:s,addCommentsToJson:r=o}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("p",{children:"The request body should contain the following parameters:"}),(0,i.jsx)(n.A,{language:"json",children:r(t,s)}),(0,i.jsx)("ul",{children:Object.entries(s).map((e=>{let[t,s]=e;return(0,i.jsxs)("li",{children:[(0,i.jsx)("code",{children:t})," - ",s]},t)}))})]})},p=e=>{let{method:t="POST",path:s,requestBody:o,headers:l={Authorization:"<Your-Secret-Key>","Content-Type":"application/json"}}=e;const d=(0,r.r)()(s),h="undefined"==typeof window?"usapi.hottask.com":new URL(d||`https://usapi.hottask.com${s}`).host,p={javascript:`const res = await fetch('${d||`https://usapi.hottask.com${s}`}', {\n method: '${t}',\n headers: ${JSON.stringify(l,null,2)},\n body: JSON.stringify(${JSON.stringify(o,null,2)})\n});\n\nconst data = await res.json();\nconsole.log(data);`,python:`import requests\nimport json\n\nurl = '${d||`https://usapi.hottask.com${s}`}'\nheaders = ${JSON.stringify(l,null,4)}\ndata = ${JSON.stringify(o,null,2)}\n\nresponse = requests.${t.toLowerCase()}(url, headers=headers, json=data)\ndata = response.json()\nprint(data)`,bash:`curl '${d||`https://usapi.hottask.com${s}`}' \\\n -X ${t} \\\n${Object.entries(l).map((e=>{let[t,s]=e;return` -H '${t}: ${s}' \\`})).join("\n")}\n -d '${JSON.stringify(o)}'`,http:`${t} ${s} HTTP/1.1\nHost: ${h}\n${Object.entries(l).map((e=>{let[t,s]=e;return`${t}: ${s}`})).join("\n")}\n\n${JSON.stringify(o,null,2)}`};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a.A,{as:"h3",children:"JavaScript (Fetch API)"}),(0,i.jsx)(n.A,{language:"javascript",children:p.javascript}),(0,i.jsx)(a.A,{as:"h3",children:"Python (Requests Library)"}),(0,i.jsx)(n.A,{language:"python",children:p.python}),(0,i.jsx)(a.A,{as:"h3",children:"cURL"}),(0,i.jsx)(n.A,{language:"bash",children:p.bash}),(0,i.jsx)(a.A,{as:"h3",children:"HTTP Request"}),(0,i.jsx)(n.A,{language:"http",children:p.http})]})},u=e=>{let{responseExample:t,responseComments:s,addCommentsToJson:r=o}=e;const a={...t,Version:"1.0.0",Success:!0,Code:200,Message:""},l={...s,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)(n.A,{language:"json",children:r(a,l)})]})},c=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 g(e){let{title:t,path:s,method:n="POST",description:a="",requestBody:g={timeZone:"Asia/Shanghai",type:0},requestBodyDescription:m={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:y={timeZone:"string, required",type:"integer, required"},responseExample:f={Data:"3254a9d0424c4806b9ea3d0763xxxxxx",Version:"1.0.0",Success:!0,Code:200,Message:""},responseComments:x={Data:"chatbot id"},headers:j={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:L="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 S=(0,r.r)()(s),D="undefined"==typeof window?"usapi.hottask.com":new URL(S||`https://usapi.hottask.com${s}`).host;JSON.stringify(j,null,2),o(g,y),JSON.stringify(j,null,4),o(g,y),n.toLowerCase(),Object.entries(j).map((e=>{let[t,s]=e;return` -H '${t}: ${s}' \\`})).join("\n"),JSON.stringify(g),Object.entries(j).map((e=>{let[t,s]=e;return`${t}: ${s}`})).join("\n"),o(g,y);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l,{path:s,method:n}),(0,i.jsx)(d,{headers:j,headersDescription:b}),(0,i.jsx)(h,{requestBody:g,requestBodyParams:m,addCommentsToJson:o}),(0,i.jsx)(p,{method:n,path:s,requestBody:g,headers:j}),(0,i.jsx)(u,{responseExample:f,responseComments:x,addCommentsToJson:o}),(0,i.jsx)(c,{errorHandling:L})]})}},8175:(e,t,s)=>{s.d(t,{A:()=>a});s(6540);var r=s(5872),n=s(4848);function a(){let e=(0,r.K)()();return["newoaks.ai","www.newoaks.ai","eu.newoaks.ai"].includes(e)&&(e="NewOaks AI"),"appointify.ai"===e&&(e="Appointify AI"),(0,n.jsx)("code",{children:e})}},9357:(e,t,s)=>{s.d(t,{A:()=>i});s(6540);var r=s(5872),n=s(5363),a=s(4848);function i(e){let{children:t}=e;return(0,a.jsx)(n.A,{children:()=>{const e=(0,r.K)()();if("function"==typeof t){const s=t(e);return(0,a.jsx)("div",{className:"markdown markdown--section",children:s})}return(0,a.jsx)("code",{children:e})}})}},3532:(e,t,s)=>{function r(){return function(e){if("undefined"==typeof window)return"";const t=window.location.hostname;let s="";return s="www.newoaks.ai"==t||"newoaks.ai"==t?"https://usapi.hottask.com":"eu.newoaks.ai"==t?"https://euapi.hottask.com":`https://${t}`,e?`${s}${e.startsWith("/")?e:`/${e}`}`:s}}s.d(t,{r:()=>r})},5872:(e,t,s)=>{function r(){return function(){return"undefined"==typeof window?"":window.location.hostname}}s.d(t,{K:()=>r})}}]);