Projects API Code Samples

Selection of code samples that demonstrate the use of the Projects 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 "Projects" in API Reference.

Retrieve a list of draft projects accessible to the user

Use this sample request to retrieve all the draft projects that you can access in Visier.

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

The response returns the details of all draft projects that your user can access.

Retrieve a draft project's information

Use this sample request to retrieve the details of a specific draft project.

Copy
cURL sample request: Retrieve a project's details
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1alpha/admin/projects/8b132f3c-8074-4663-a971-a1b62cab4007' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'

The response returns the details of the requested project.

Create a new draft project

Use this sample request to create a new project.

Copy
cURL sample request: Create a project
curl -X POST --url 'https://{vanity_name}.api.visier.io/v1alpha/admin/projects' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-d '{
    "name": "Sample Project 3",
    "description": "This is a sample project",
    "releaseVersion": "1",
    "ticketNumber": "12345",
    "versionNumber": 1005
}'

The response returns the details of the created project.

Perform an operation on a draft project

Use this sample publish a project to production.

Copy
cURL sample request: Publish a project
curl -X POST --url 'https://{vanity_name}.api.visier.io/v1alpha/admin/projects/5a031f08-5895-4e54-9333-32de249f2e5a' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-d '{
    "operation": "commitAndPublish"
}'

The response returns the results of the API request.

Delete a draft project

Use this sample request to delete an existing draft project.

Copy
cURL sample request: Delete a project
curl -X DELETE --url 'https://{vanity_name}.api.visier.io/v1alpha/admin/projects/8b132f3c-8074-4663-a971-a1b62cab4007' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'

The response returns the results of the API request.