Planning Data Load API Code Samples

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

Retrieve a list of plans

Use this sample request to retrieve all your plans.

Copy
Retrieve a list of plans
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1alpha/planning/model/plans' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'

Use this sample request to retrieve plans with the following attributes:

  • Display name: Test
  • Plan status: In Progress
  • Created on or after: 2024-11-13
  • Created on or before: 2024-11-13
Copy
Retrieve all plans with the display name Test, plan status In Progress, and created on 2024-11-13
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1alpha/planning/model/plans?displayName=Test&planStatus=IN_PROGRESS&createdStart=2024-11-13&createdEnd=2024-11-13' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'

The response returns a list of plans and their plan IDs.

Retrieve a plan's details

Use this sample request to retrieve a specific plan and its schema.

Copy
Retrieve plan 93668189-8734-4cd8-b340-e9bb9f4a38f0 with its schema
curl -X GET --url 'https://{vanity_name}.api.visier.io/v1alpha/planning/model/plans/93668189-8734-4cd8-b340-e9bb9f4a38f0?withSchema=true' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'

The response returns the plan's scenarios, currency, plan items, and segments.

Upload plan data

This sample request sends a data file to Visier. This request uses the roll up calculation method and skips any rows with errors.

Copy
Upload plan_data.csv to Visier
curl --location --request PATCH 'https://{vanity_name}.api.visier.io/v1alpha/planning/data/plans/93668189-8734-4cd8-b340-e9bb9f4a38f0/scenarios/gn2tuq1948hrqb3?calculation=ROLLUP&method=SKIP_ERRORS' \
-H 'apikey: {api_key}' \
-H 'Cookie: VisierASIDToken={security_token}'
--form 'file=@"./plan_data.csv"'

The response returns details about the data that was modified in the plan, including any errors that occurred.

Add or remove plan rows

This sample request adds and removes rows in a plan. This request skips any rows with errors.

Copy
Upload plan_rows.csv to Visier
curl --location --request PATCH 'https://{vanity_name}.api.visier.io/v1alpha/planning/data/plans/93668189-8734-4cd8-b340-e9bb9f4a38f0/rows?method=SKIP_ERRORS' \
--header 'apikey: {api_key}' \
--header 'Cookie: VisierASIDToken={security_token}'
--form 'file=@"./plan_rows.csv"'

The response returns the number of rows added and removed, the custom members created, and any errors that occurred.