Extra data
Sometimes it's necessary to pass in some custom data when changing the object status. For example, you might need to store who booked a seat, to use in the object popover shown in an embedded chart.
It's possible to set extra data on seats and booths, but not on areas.
You can choose whether your extraData should be private or public. You can control this through the company settings page.
If you choose for public extraData, then all data you store along with bookings will be made available to the Renderer through callbacks, such as onObjectSelected, objectColor, and others. You should make sure to never store information that can identify individual users (names, emails, etc) in clear text: a tech-savvy user will be able to read your extraData.
However, if you opt for private extraData, you can store whatever you want: extraData will not be made available to the renderer, and so will remain private.
Note that this setting does not impact the Event Manager: in Event Manager, extraData is always made available to callbacks, regardless of the company setting.
/change-object-status, /book, /release, /hold and /put-up-for-resale 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, /change-object-status or /put-up-for-resale
{
"objects": [
{ "objectId": "A-5", "extraData": { "userId": "123" }},
{ "objectId": "A-6", "extraData": { "userId": "456" }}
]
}
- PHP
- C#
- Java
- Python
- Ruby
- Javascript
- Go
$objects = [
["objectId" => "A-5", "extraData" => ["userId" => "123"]],
["objectId" => "A-6", "extraData" => ["userId" => "456"]]
];
$seatsioClient->events->book("event1", $objects);
var objects = new [] {
new ObjectProperties("A-5", new Dictionary<string, object> {{"userId", "123"}}),
new ObjectProperties("A-6", new Dictionary<string, object> {{"userId", "456"}})
};
await Client.Events.BookAsync("event1", objects);
List<ObjectProperties> objects = List.of(
new ObjectProperties("A-5", Map.of("userId", "123")),
new ObjectProperties("A-6", Map.of("userId", "456"))
);
client.events.book("event1", objects);
objects = [
ObjectProperties("A-5", extra_data={"userId": "123"}),
ObjectProperties("A-6", extra_data={"userId": "456"})
]
client.events.book("event1", objects)
objects = [
{:objectId => 'A-5', :extraData => {"userId": "123"}},
{:objectId => 'A-6', :extraData => {"userId": "456"}}
]
client.events.book('event1', objects)
let objects = [
{'objectId' : 'A-5', 'extraData' : {'userId' : '123'}},
{'objectId' : 'A-6', 'extraData' : {'userId' : '456'}}
];
await client.events.book('eventKey', objects);
object1 := events.ObjectProperties{ObjectId: "A-5", ExtraData: map[string]string{"userId": "123"}}
object2 := events.ObjectProperties{ObjectId: "A-6", ExtraData: map[string]string{"userId": "456"}}
result, err := client.Events.BookWithObjectProperties("eventKey", object1, object2)
When changing object status, extraData gets cleared. To avoid that, pass in the keepExtraData flag:
// /book, /release, /hold or /change-object-status
{
"objects": [
{ "objectId": "A-5"},
{ "objectId": "A-6"}
],
"keepExtraData": true
}