Production Versions API Code Samples

Selection of code samples that demonstrate the use of the Production Versions API. Copy and edit these code samples to suit your needs.

When using the code samples, remember to replace:

  • {vanity_name} with your tenant name
  • {api_key} with your API key
  • {security_token} with a valid security token

These code samples may not include all available parameters and request body fields for each endpoint. For the endpoint's full request schema, see "Production Versions" in API Reference.

Retrieve a list of all production versions

Use this sample to retrieve all the production versions for your tenant.

Copy
cURL sample request: Retrieve a list of all production versions
curl GET --url 'https://{vanity_name}.api.visier.io/v1alpha/admin/production-versions' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'

The response returns the details of the production versions.

Perform an operation on production versions

Use this sample to export the project changes of the requested production versions and their related files, such as any Guidebook images. It exports the project changes for production versions between versions 27260db4-5d2d-49f3-90da-daf903fefb32 and f630cd00-6522-43d3-af26-d52831b03126, excluding versions c9f476b4-27c6-4aea-a0a2-c6c70141ed37 and 37569b5f-aa29-46b6-a6cc-3bd84ddae5de.

Copy
cURL sample request: Export production versions
curl POST --url 'https://{vanity_name}.api.visier.io/v1alpha/admin/production-versions' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'Content-Type:application/json' \
-H 'Accept:application/zip'
-d '{
    "operation": "export",
    "exportParameters": {
      "startVersion": "27260db4-5d2d-49f3-90da-daf903fefb32",
      "endVersion": "f630cd00-6522-43d3-af26-d52831b03126",
      "excludedVersions": [
        "c9f476b4-27c6-4aea-a0a2-c6c70141ed37",
        "37569b5f-aa29-46b6-a6cc-3bd84ddae5de"
      ]
    }
}'

The response returns a ZIP file containing any relevant image files and a JSON file with the production project changes.

Perform an operation on a specific production version

Use this sample to roll back your production version to version f20b4700-7f61-4ff5-99cf-a8a24c3025a9

Copy
cURL sample request: Roll back to production version f20b4700-7f61-4ff5-99cf-a8a24c3025a9
curl POST --url 'https://{vanity_name}.api.visier.io/v1alpha/admin/production-versions/f20b4700-7f61-4ff5-99cf-a8a24c3025a9' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'Content-Type:application/json' \
-H 'Accept:application/zip'
-d '{
      "operation": "rollBackTo",
    }'

The response returns the details of the roll back operation.