"use strict";(self.webpackChunknewoaks_help=self.webpackChunknewoaks_help||[]).push([[3139],{7402:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>u,contentTitle:()=>l,default:()=>c,frontMatter:()=>d,metadata:()=>n,toc:()=>p});const n=JSON.parse('{"id":"api/realestate/update","title":"Update Real Estate","description":"The  API provides functionality to update an existing real estate listing by sending a POST request to the /chat/Chatbot/RealEstateUpdate endpoint.","source":"@site/developer/api/004.realestate/002.update.md","sourceDirName":"api/004.realestate","slug":"/api/realestate/update","permalink":"/guides/developer/api/realestate/update","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":2,"frontMatter":{"sidebar_position":2},"sidebar":"sidebar","previous":{"title":"Create Real Estate","permalink":"/guides/developer/api/realestate/create"},"next":{"title":"Delete Real Estate","permalink":"/guides/developer/api/realestate/delete"}}');var s=r(4848),a=r(8453),i=r(767),o=(r(9357),r(8175));const d={sidebar_position:2},l="Update Real Estate",u={},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 h(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:"update-real-estate",children:"Update Real Estate"})}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(o.A,{})," API provides functionality to update an existing real estate listing by sending a ",(0,s.jsx)(t.code,{children:"POST"})," request to the ",(0,s.jsx)(t.code,{children:"/chat/Chatbot/RealEstateUpdate"})," endpoint."]}),"\n",(0,s.jsx)(t.h2,{id:"endpoint",children:"Endpoint"}),"\n",(0,s.jsx)(i.TM,{path:"/chat/Chatbot/RealEstateUpdate"}),"\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:"3254a9d0424c4806b9ea3d0763xxxxxx",Key:"PROP123456",KeyType:"NewOaks",SaleType:"for_sale",Status:"Active",CurrencySymbol:"$",PropertyType:"Single Family Residential",Bedrooms:3,Bathrooms:2.5,Url:"https://example.com/property/123",MLSNumber:"MLS123456",YearBuilt:1998,DaysOnMarket:2,LotArea:800,BuildingArea:2500,AreaUnit:"Square Feet",Images:["https://example.com/img1.jpg","https://example.com/img2.jpg"],Tours:"OpenHouse",ParkingSpots:8,Description:"Beautiful family home with modern amenities",ExtensionColumn:[{Key:"Pool",value:"Yes"},{Key:"Garage",value:"2 cars"}],Location:"Residential Area",Address:"123 Main St",City:"Los Angeles",State:"CA",ZIP:"90001",Latitude:30.96,Longitude:-78.93,SalePrice:1e5,UnitAreaPrice:100,HOAMonth:500,ZestimatePrice:1e5,RentPrice:2500,SpaceType:"Entire place",DepositFee:5e3},requestBodyParams:{SerialNumber:"string, required - The ID of the chatbot (found on the chatbot settings -> general -> chatbot ID)",Key:"string, required - The value of the primary key used for the update",KeyType:"string, required - Must be one of: [NewOaks, MLSNumber, URL]",SaleType:"string, required - Must be one of: [for_sale, for_rent]",Status:"string, required - Must be one of: [Active, PreOnMarket, Sold]",CurrencySymbol:"string, required - Currency symbol (e.g., $)",PropertyType:"string, required - Type of property (e.g., Single Family Residential)",Bedrooms:"number, required - Number of bedrooms",Bathrooms:"number, required - Number of bathrooms",Url:"string, required - Property listing URL",MLSNumber:"string, required - MLS number",YearBuilt:"number, required - Year the property was built",DaysOnMarket:"number, required - Number of days on market",LotArea:"number, required - Lot area size",BuildingArea:"number, required - Building area size",AreaUnit:"string, required - Must be one of: [Square Feet, Square Meters]",Images:"array - Array of image URLs",Tours:"string - Must be one of: [OpenHouse, 3D]",ParkingSpots:"number, required - Number of parking spots",Description:"string - Property description",ExtensionColumn:"array - Additional property information in format [{'Key': 'xx', 'value': 'xx'}]",Location:"string - Property location description",Address:"string - Street address",City:"string - City name",State:"string - State name",ZIP:"string - ZIP code",Latitude:"number - Property latitude",Longitude:"number - Property longitude",SalePrice:"number - Sale price",UnitAreaPrice:"number - Price per unit area",HOAMonth:"number - Monthly HOA fee",ZestimatePrice:"number - Zestimate price",RentPrice:"number - Monthly rent price",SpaceType:"string - Must be one of: [Entire place, Room]",DepositFee:"number - Required deposit amount"}}),"\n",(0,s.jsx)(t.h2,{id:"example-request",children:"Example Request"}),"\n",(0,s.jsx)(i.r3,{path:"/chat/Chatbot/RealEstateUpdate",requestBody:{SerialNumber:"3254a9d0424c4806b9ea3d0763xxxxxx",Key:"PROP123456",KeyType:"NewOaks",SaleType:"for_sale",Status:"Active",PropertyType:"Single Family Residential",Bedrooms:3,Bathrooms:2.5,MLSNumber:"MLS123456",SalePrice:1e5},headers:{"chatrobot-sessionkey":"<Your-Session-Key>"}}),"\n",(0,s.jsx)(t.h2,{id:"response",children:"Response"}),"\n",(0,s.jsx)(i.zV,{responseExample:{Data:1},responseComments:{Data:"integer - Number of records updated (1 indicates success)"}}),"\n",(0,s.jsx)(t.h2,{id:"error-handling",children:"Error Handling"}),"\n",(0,s.jsx)(i.NH,{})]})}function c(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}},767:(e,t,r)=>{r.d(t,{Ay:()=>m,NH:()=>c,TM:()=>d,VQ:()=>u,iW:()=>l,r3:()=>p,zV:()=>h});r(6540);var n=r(3532),s=r(8069),a=r(9303),i=r(4848);const o=function(e,t){void 0===t&&(t={});const r=JSON.stringify(e,null,2).split("\n"),n=[];return r.forEach((e=>{const r=e.match(/"([^"]+)":/);if(r&&t[r[1]]){const s=e.match(/^\s*/)?.[0]||"";n.push(`${s}// ${t[r[1]]}`)}n.push(e)})),n.join("\n")},d=e=>{let{path:t,method:r="POST"}=e;const s=(0,n.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:"})," ",r]})]})},l=e=>{let{headers:t={Authorization:"<Your-Secret-Key>","Content-Type":"application/json"},headersDescription:r={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,n]=e;return(0,i.jsxs)("li",{children:[(0,i.jsxs)("code",{children:[t,": ",n]})," - ",r[t]]},t)}))})]})},u=e=>{let{requestBody:t,requestBodyParams:r,addCommentsToJson:n=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)(s.A,{language:"json",children:n(t,r)}),(0,i.jsx)("ul",{children:Object.entries(r).map((e=>{let[t,r]=e;return(0,i.jsxs)("li",{children:[(0,i.jsx)("code",{children:t})," - ",r]},t)}))})]})},p=e=>{let{method:t="POST",path:r,requestBody:o,headers:d={Authorization:"<Your-Secret-Key>","Content-Type":"application/json"}}=e;const l=(0,n.r)()(r),u="undefined"==typeof window?"usapi.hottask.com":new URL(l||`https://usapi.hottask.com${r}`).host,p={javascript:`const res = await fetch('${l||`https://usapi.hottask.com${r}`}', {\n  method: '${t}',\n  headers: ${JSON.stringify(d,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 = '${l||`https://usapi.hottask.com${r}`}'\nheaders = ${JSON.stringify(d,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 '${l||`https://usapi.hottask.com${r}`}' \\\n  -X ${t} \\\n${Object.entries(d).map((e=>{let[t,r]=e;return`  -H '${t}: ${r}' \\`})).join("\n")}\n  -d '${JSON.stringify(o)}'`,http:`${t} ${r} HTTP/1.1\nHost: ${u}\n${Object.entries(d).map((e=>{let[t,r]=e;return`${t}: ${r}`})).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)(s.A,{language:"javascript",children:p.javascript}),(0,i.jsx)(a.A,{as:"h3",children:"Python (Requests Library)"}),(0,i.jsx)(s.A,{language:"python",children:p.python}),(0,i.jsx)(a.A,{as:"h3",children:"cURL"}),(0,i.jsx)(s.A,{language:"bash",children:p.bash}),(0,i.jsx)(a.A,{as:"h3",children:"HTTP Request"}),(0,i.jsx)(s.A,{language:"http",children:p.http})]})},h=e=>{let{responseExample:t,responseComments:r,addCommentsToJson:n=o}=e;const a={...t,Version:"1.0.0",Success:!0,Code:200,Message:""},d={...r,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:n(a,d)})]})},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 m(e){let{title:t,path:r,method:s="POST",description:a="",requestBody:m={timeZone:"Asia/Shanghai",type:0},requestBodyDescription:y={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: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:S="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,n.r)()(r),T="undefined"==typeof window?"usapi.hottask.com":new URL(q||`https://usapi.hottask.com${r}`).host;JSON.stringify(j,null,2),o(m,g),JSON.stringify(j,null,4),o(m,g),s.toLowerCase(),Object.entries(j).map((e=>{let[t,r]=e;return`  -H '${t}: ${r}' \\`})).join("\n"),JSON.stringify(m),Object.entries(j).map((e=>{let[t,r]=e;return`${t}: ${r}`})).join("\n"),o(m,g);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(d,{path:r,method:s}),(0,i.jsx)(l,{headers:j,headersDescription:b}),(0,i.jsx)(u,{requestBody:m,requestBodyParams:y,addCommentsToJson:o}),(0,i.jsx)(p,{method:s,path:r,requestBody:m,headers:j}),(0,i.jsx)(h,{responseExample:x,responseComments:f,addCommentsToJson:o}),(0,i.jsx)(c,{errorHandling:S})]})}},8175:(e,t,r)=>{r.d(t,{A:()=>a});r(6540);var n=r(5872),s=r(4848);function a(){let e=(0,n.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})}},9357:(e,t,r)=>{r.d(t,{A:()=>i});r(6540);var n=r(5872),s=r(5363),a=r(4848);function i(e){let{children:t}=e;return(0,a.jsx)(s.A,{children:()=>{const e=(0,n.K)()();if("function"==typeof t){const r=t(e);return(0,a.jsx)("div",{className:"markdown markdown--section",children:r})}return(0,a.jsx)("code",{children:e})}})}},3532:(e,t,r)=>{function n(){return function(e){if("undefined"==typeof window)return"";const t=window.location.hostname;let r="";return r="www.newoaks.ai"==t||"newoaks.ai"==t?"https://usapi.hottask.com":"eu.newoaks.ai"==t?"https://euapi.hottask.com":`https://${t}`,e?`${r}${e.startsWith("/")?e:`/${e}`}`:r}}r.d(t,{r:()=>n})},5872:(e,t,r)=>{function n(){return function(){return"undefined"==typeof window?"":window.location.hostname}}r.d(t,{K:()=>n})}}]);