Publish a draft version
Publishing a draft version means replacing the currently published version by the draft version. The draft version is deleted afterwards. This cannot be undone!
- Text
- PHP
- C#
- Java
- Python
- Ruby
- Javascript
- Go
POST https://api-{region}.seatsio.net/charts/{chartKey}/version/draft/actions/publish
$seatsioClient->charts->publishDraftVersion("4250fffc-e41f-c7cb-986a-2c5e728b8c28");
await Client.Charts.PublishDraftVersionAsync("4250fffc-e41f-c7cb-986a-2c5e728b8c28");
client.charts.publishDraftVersion("4250fffc-e41f-c7cb-986a-2c5e728b8c28");
client.charts.publish_draft_version("4250fffc-e41f-c7cb-986a-2c5e728b8c28")
client.charts.publish_draft_version("4250fffc-e41f-c7cb-986a-2c5e728b8c28")
await client.charts.publishDraftVersion('chartKey');
err = client.Charts.PublishDraftVersion("chartKey")
curl -X POST https://api-{region}.seatsio.net/charts/749b9650-24fb-11e7-93ae-92361f002671/version/draft/actions/publish \
-u aSecretKey:
Response
If everything goes well and the draft chart is published, you'll get a 204 No Content response.
If, however, the chart contains validation errors, the chart is not published and a 400 Bad Request response is issued. The response body contains details of why the validation failed and looks like this:
{
"status": 400,
"messages": [
"Failed to publish chart [key: <Chart key>]: invalid draft drawing",
"Invalid draft drawing"
],
"errors": [
{
"code": "DRAWING_VALIDATION_FAILED",
"message": "Failed to publish chart [key: <Chart key>]: invalid draft drawing",
"data": {
"failedValidations": [
"VALIDATE_OBJECTS_WITHOUT_CATEGORIES",
"VALIDATE_FOCAL_POINT",
"VALIDATE_OBJECT_TYPES_PER_CATEGORY"
]
}
}
],
"warnings": [
{
"code": "DRAWING_VALIDATION_FAILED",
"message": "Invalid draft drawing",
"data": {
"failedValidations": [
"VALIDATE_DUPLICATE_LABELS",
"VALIDATE_UNLABELED_OBJECTS"
]
}
}
],
"requestId": "<request id>"
}
Currently the following validators are supported:
- VALIDATE_UNLABELED_OBJECTS: can a chart contain unlabeled seats?
- VALIDATE_DUPLICATE_LABELS: can a chart contain two bookable objects that have the same label (e.g. two seats with label A-1)
- VALIDATE_OBJECTS_WITHOUT_CATEGORIES: Is it allowed for a seat to have no category?
- VALIDATE_FOCAL_POINT: Is a focal point required for a seating chart to be valid? Charts without focal point cannot use Best Available seat selection.
- VALIDATE_OBJECT_TYPES_PER_CATEGORY: Is it allowed to, for example, apply a category A to both seats and booths?
Tip
You can set the validation level for each of them via your settings page.