curl --request PUT \
--url https://api.anhome.tuanle.dev/api/v1/rooms/{room_id}/listing \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"headline": "<string>",
"description": "<string>",
"amenities": [
"<string>"
],
"contact_phone": "<string>",
"zalo_url": "<string>",
"available_date": "2023-12-25",
"min_lease_months": 30,
"images": [
{
"image_url": "<string>",
"media_asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"alt_text": "<string>",
"sort_order": 123
}
]
}
'import requests
url = "https://api.anhome.tuanle.dev/api/v1/rooms/{room_id}/listing"
payload = {
"headline": "<string>",
"description": "<string>",
"amenities": ["<string>"],
"contact_phone": "<string>",
"zalo_url": "<string>",
"available_date": "2023-12-25",
"min_lease_months": 30,
"images": [
{
"image_url": "<string>",
"media_asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"alt_text": "<string>",
"sort_order": 123
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
headline: '<string>',
description: '<string>',
amenities: ['<string>'],
contact_phone: '<string>',
zalo_url: '<string>',
available_date: '2023-12-25',
min_lease_months: 30,
images: [
{
image_url: '<string>',
media_asset_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
alt_text: '<string>',
sort_order: 123
}
]
})
};
fetch('https://api.anhome.tuanle.dev/api/v1/rooms/{room_id}/listing', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.anhome.tuanle.dev/api/v1/rooms/{room_id}/listing",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'headline' => '<string>',
'description' => '<string>',
'amenities' => [
'<string>'
],
'contact_phone' => '<string>',
'zalo_url' => '<string>',
'available_date' => '2023-12-25',
'min_lease_months' => 30,
'images' => [
[
'image_url' => '<string>',
'media_asset_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'alt_text' => '<string>',
'sort_order' => 123
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.anhome.tuanle.dev/api/v1/rooms/{room_id}/listing"
payload := strings.NewReader("{\n \"headline\": \"<string>\",\n \"description\": \"<string>\",\n \"amenities\": [\n \"<string>\"\n ],\n \"contact_phone\": \"<string>\",\n \"zalo_url\": \"<string>\",\n \"available_date\": \"2023-12-25\",\n \"min_lease_months\": 30,\n \"images\": [\n {\n \"image_url\": \"<string>\",\n \"media_asset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"alt_text\": \"<string>\",\n \"sort_order\": 123\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.anhome.tuanle.dev/api/v1/rooms/{room_id}/listing")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"headline\": \"<string>\",\n \"description\": \"<string>\",\n \"amenities\": [\n \"<string>\"\n ],\n \"contact_phone\": \"<string>\",\n \"zalo_url\": \"<string>\",\n \"available_date\": \"2023-12-25\",\n \"min_lease_months\": 30,\n \"images\": [\n {\n \"image_url\": \"<string>\",\n \"media_asset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"alt_text\": \"<string>\",\n \"sort_order\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.anhome.tuanle.dev/api/v1/rooms/{room_id}/listing")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"headline\": \"<string>\",\n \"description\": \"<string>\",\n \"amenities\": [\n \"<string>\"\n ],\n \"contact_phone\": \"<string>\",\n \"zalo_url\": \"<string>\",\n \"available_date\": \"2023-12-25\",\n \"min_lease_months\": 30,\n \"images\": [\n {\n \"image_url\": \"<string>\",\n \"media_asset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"alt_text\": \"<string>\",\n \"sort_order\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"property_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"room_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "<string>",
"headline": "<string>",
"amenities": [
"<string>"
],
"is_published": true,
"images": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"image_url": "<string>",
"sort_order": 123,
"media_asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"alt_text": "<string>"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"contact_phone": "<string>",
"zalo_url": "<string>",
"available_date": "2023-12-25",
"min_lease_months": 123
},
"request_id": "<string>",
"meta": {}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}Admin upsert room listing
Documents an AnHome API operation.
curl --request PUT \
--url https://api.anhome.tuanle.dev/api/v1/rooms/{room_id}/listing \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"headline": "<string>",
"description": "<string>",
"amenities": [
"<string>"
],
"contact_phone": "<string>",
"zalo_url": "<string>",
"available_date": "2023-12-25",
"min_lease_months": 30,
"images": [
{
"image_url": "<string>",
"media_asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"alt_text": "<string>",
"sort_order": 123
}
]
}
'import requests
url = "https://api.anhome.tuanle.dev/api/v1/rooms/{room_id}/listing"
payload = {
"headline": "<string>",
"description": "<string>",
"amenities": ["<string>"],
"contact_phone": "<string>",
"zalo_url": "<string>",
"available_date": "2023-12-25",
"min_lease_months": 30,
"images": [
{
"image_url": "<string>",
"media_asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"alt_text": "<string>",
"sort_order": 123
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
headline: '<string>',
description: '<string>',
amenities: ['<string>'],
contact_phone: '<string>',
zalo_url: '<string>',
available_date: '2023-12-25',
min_lease_months: 30,
images: [
{
image_url: '<string>',
media_asset_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
alt_text: '<string>',
sort_order: 123
}
]
})
};
fetch('https://api.anhome.tuanle.dev/api/v1/rooms/{room_id}/listing', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.anhome.tuanle.dev/api/v1/rooms/{room_id}/listing",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'headline' => '<string>',
'description' => '<string>',
'amenities' => [
'<string>'
],
'contact_phone' => '<string>',
'zalo_url' => '<string>',
'available_date' => '2023-12-25',
'min_lease_months' => 30,
'images' => [
[
'image_url' => '<string>',
'media_asset_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'alt_text' => '<string>',
'sort_order' => 123
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.anhome.tuanle.dev/api/v1/rooms/{room_id}/listing"
payload := strings.NewReader("{\n \"headline\": \"<string>\",\n \"description\": \"<string>\",\n \"amenities\": [\n \"<string>\"\n ],\n \"contact_phone\": \"<string>\",\n \"zalo_url\": \"<string>\",\n \"available_date\": \"2023-12-25\",\n \"min_lease_months\": 30,\n \"images\": [\n {\n \"image_url\": \"<string>\",\n \"media_asset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"alt_text\": \"<string>\",\n \"sort_order\": 123\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.anhome.tuanle.dev/api/v1/rooms/{room_id}/listing")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"headline\": \"<string>\",\n \"description\": \"<string>\",\n \"amenities\": [\n \"<string>\"\n ],\n \"contact_phone\": \"<string>\",\n \"zalo_url\": \"<string>\",\n \"available_date\": \"2023-12-25\",\n \"min_lease_months\": 30,\n \"images\": [\n {\n \"image_url\": \"<string>\",\n \"media_asset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"alt_text\": \"<string>\",\n \"sort_order\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.anhome.tuanle.dev/api/v1/rooms/{room_id}/listing")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"headline\": \"<string>\",\n \"description\": \"<string>\",\n \"amenities\": [\n \"<string>\"\n ],\n \"contact_phone\": \"<string>\",\n \"zalo_url\": \"<string>\",\n \"available_date\": \"2023-12-25\",\n \"min_lease_months\": 30,\n \"images\": [\n {\n \"image_url\": \"<string>\",\n \"media_asset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"alt_text\": \"<string>\",\n \"sort_order\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"property_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"room_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "<string>",
"headline": "<string>",
"amenities": [
"<string>"
],
"is_published": true,
"images": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"image_url": "<string>",
"sort_order": 123,
"media_asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"alt_text": "<string>"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"contact_phone": "<string>",
"zalo_url": "<string>",
"available_date": "2023-12-25",
"min_lease_months": 123
},
"request_id": "<string>",
"meta": {}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}{
"error": {
"message": "<string>",
"request_id": "<string>",
"fields": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": "<unknown>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Room ID
Body
JSON payload used to admin upsert room listing.
Landlord admin: create or replace the listing overlay for one room.
headline value for upsert listing request.
1 - 200Human-readable description for the resource or line item.
4000amenities value for upsert listing request.
contact phone value for upsert listing request.
40zalo url value for upsert listing request.
500available date value for upsert listing request.
min lease months value for upsert listing request.
0 <= x <= 60images value for upsert listing request.
Show child attributes
Show child attributes
Response
Created or updated room listing
Endpoint-specific response payload. See the referenced schema for the resource fields.
Show child attributes
Show child attributes
Request correlation identifier returned from X-Request-Id or generated by the API.
Optional response metadata such as pagination limits, counts, or export context.