Rooms: UpdateRoomFieldData

This method lets you update one or more fields in a room's field data, the information that appears in the room's Details tab. To better understand the room's field data, use the Rooms::GetRoomFieldSet method to retrieve the set of fields that the room uses.

To get the current values of a room's field data, use Rooms::GetRoomFieldData.

For example, to update the "Tax annual amount" and Buyer1's name fields in a room, you would use a request body that looks like this:

{
  "data": {
    "taxAnnualAmount": 3389.12,
    "buyer1": {
      "name": "Elizabeth Bennet"
    }
  }
}

If successful, the response body will have the same contents as the request body.

All of the fields must be updated successfully for the method to succeed. For example, if you were to set the tax amount to a negative number, the method will fail and none of the fields will be updated.

Request

HTTP request

PUT /restapi/v2/accounts/{accountId}/rooms/{roomId}/field_data

Parameters

Parameter NameValueDescription
Path Parameters
roomIdinteger

The id of the room.

accountIdstring

The globally unique identifier (GUID) for the account.

Request Body

fieldDataForUpdate

Responses

CodeDescriptionReference
200

Field data successfully updated.

FieldData
400

Bad request. See ErrorCode and Message for details

ApiError
401

Not authorized to make this request.

ApiError

SDK Method

Rooms::UpdateRoomFieldData

Definitions

ApiError

This object describes errors that occur. It is valid only for responses and ignored in requests.

errorCodestring

The code associated with the error condition.

messagestring

A brief message describing the error condition.

FieldData

The field data associated with a room. See Rooms::GetRoomFieldData.

dataobject

Field data is a collection of name/value pairs where the names correspond to the fields in the room's Details tab. The value of name/value object can be a field data collection itself. These collections are implemented as JSON objects.

For example, the field data for fields named "Tax annual amount" and "buyer1" might look like this:

{
  "data": {
    "taxAnnualAmount": 3389.12,
    "buyer1": {
      "email": "lizzy@example.com",
      "country": "England",
      "businessPhone": null,
      "name": "Elizabeth Bennet",
      "homePhone": null,
      "city": "Meryton",
      "address2": null,
      "postalCode": null,
      "state": "Hertfordshire",
      "company": null,
      "cellPhone": null,
      "address1": "Longbourn Estate"
    }
  }
}

FieldDataForUpdate

The field data to update. When updating field data, specify only the fields being updated.

dataobject

Field data is a collection of name/value pairs where the names correspond to the fields in the room's Details tab. The value of name/value object can be a field data collection itself. These collections are implemented as JSON objects.

For example, the field data for fields named "Tax annual amount" and "buyer1" might look like this:

{
  "data": {
    "taxAnnualAmount": 3389.12,
    "buyer1": {
      "email": "lizzy@example.com",
      "country": "England",
      "businessPhone": null,
      "name": "Elizabeth Bennet",
      "homePhone": null,
      "city": "Meryton",
      "address2": null,
      "postalCode": null,
      "state": "Hertfordshire",
      "company": null,
      "cellPhone": null,
      "address1": "Longbourn Estate"
    }
  }
}

}} />