Copy a chart to a workspace
Use this call to copy a published chart version from its workspace to another workspace. Events and tags linked to the original chart are not copied.
The response contains the chartKey of the new chart. You can store this in your database, and use it to refer to the newly created chart in the future.
- Text
- PHP
- C#
- Java
- Python
- Ruby
- Javascript
- Go
# if you want to pass in the from workspace key explicitly
POST https://api-{region}.seatsio.net/charts/{chartKey}/version/published/actions/copy/from/{fromWorkspaceKey}/to/{toWorkspaceKey}
# if you want to copy from the default workspace
POST https://api-{region}.seatsio.net/charts/{chartKey}/version/published/actions/copy-to-workspace/{workspaceKey}
// passing in the from workspace explicitly
$seatsioClient->charts->copyFromWorkspaceTo("{chart key}", "{from workspace key}", "{to workspace key}");
// using the default workspace of $seatsioClient as from workspace
$seatsioClient->charts->copyToWorkspace("{chart key}", "{to workspace key}");
// passing in the from workspace explicitly
await Client.Charts.CopyToWorkspaceAsync("{chart key}", "{from workspace key}", "{to workspace key}");
// using the default workspace of Client as from workspace
await Client.Charts.CopyToWorkspaceAsync("{chart key}", "{to workspace key}");
// passing in the from workspace explicitly
client.charts.copyToWorkspace("{chart key}", "{from workspace key}", "{to workspace key}");
// using the default workspace of the client as from workspace
client.charts.copyToWorkspace("{chart key}", "{to workspace key}");
# passing in the from workspace explicitly
client.charts.copy_from_workspace_to("{chart key}", "{from workspace key}", "{to workspace key}")
# using the default workspace of the client as from workspace
client.charts.copy_to_workspace("{chart key}", "{to workspace key}")
# passing in the from workspace explicitly
client.charts.copy_from_workspace_to("{chart key}", "{from workspace key}", "{to workspace key}")
# using the default workspace of the client as from workspace
client.charts.copy_to_workspace("{chart key}", "{to workspace key}")
// passing in the from workspace explicitly
await client.charts.copyFromWorkspaceTo('chartKey', '{from workspace key}', '{to workspace key}');
// using the default workspace of the client as from workspace
await client.charts.copyToWorkspace('chartKey', '{to workspace key}');
// passing in the from workspace explicitly
copiedChart, err := client.Charts.CopyFromWorkspaceTo("chartKey", "{from workspace key}", "{to workspace key}")
// using the default workspace of the client as from workspace
copiedChart, err := client.Charts.CopyToWorkspace("chartKey", "{to workspace key}")
curl -X POST https://api-{region}.seatsio.net/charts/{chart key}/version/published/actions/copy/from/{from workspace key}/to/{to workspace key} \
-u {admin key}:
curl -X POST https://api-{region}.seatsio.net/charts/{chart key}/version/published/actions/copy-to-workspace/{to workspace key} \
-u {admin key}: \
-H X-Workspace-Key: {public key of from workspace}
{
"name":"chart2",
"id":"19",
"key":"749b9650-24fb-11e7-93ae-92361f002671",
"status":"NOT_USED",
"tags": [],
"archived": false,
"publishedVersionThumbnailUrl": "https://cdn.seats.io/system/public/.../published/.../thumbnail"
}
A note about authentication
Because copying a chart between workspaces is an operation that requires privileges on both workspaces, you'll need to use your company admin key as a secret key. You can find the admin key at your company settings page.