Extra data

Sometimes it's necessary to pass in some custom data when changing the object status. For example, you might need to store the name of the person that booked a seat, to use in the tooltip of a rendered chart.

Extra data is public data

When rendering your floor plan, anything you store in extra data is made available to the client through callbacks, such as onObjectSelected, objectColor, and others.

Therefore, you should consider extra data to be public data, and never use it to store information that can identify individual users (names, emails, etc) in clear text. In general, technical identifiers without context are fine, as long as they can't be used to access sensitive data through other parts of your system.

In short: think twice about what you store in extraData :)

/change-object-status, /book, /release and /hold take an optional extraData object for each object ID in the request. extraData must be a JSON object with key value pairs, not a JSON primitive.

// /book, /release, /hold or /change-object-status
{
'objects': [
{ 'objectId': 'A-5', 'extraData': { 'userId': '123' }},
{ 'objectId': 'A-6', 'extraData': { 'userId': '456' }}
]
}
$objects = [
["objectId" => "A-5", "extraData" => ["userId" => "123"]],
["objectId" => "A-6", "extraData" => ["userId" => "456"]]
];
$seatsioClient->events->book("event1", $objects);
  • API: added keepExtraData flag to calls that change the object status. If set to true, the existing extra data doesn't get cleared
// /book, /release, /hold or /change-object-status
{
'objects': [
{ 'objectId': 'A-5'},
{ 'objectId': 'A-6'}
],
'keepExtraData': true
}

Updating extra data#

You can update extra data for objects without changing their status too. Check https://docs.seats.io/docs/api-update-extra-data-for-an-object and https://docs.seats.io/docs/api-update-extra-data-for-multiple-objects for more information.