Dimensions API Code Samples

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

Retrieve a list of dimensions

Use this sample request to retrieve all the dimensions for the Employee subject with detailed information. To get fewer details about the dimensions, omit the query parameter with=details. To get dimensions from all subjects, not just Employee, omit the query parameter analyticObjectName=Employee.

Copy
cURL sample request: Retrieve a list of all Employee dimensions with details
curl -X GET --url 'https://{vanity_name}.api.visier.io/v2alpha/data/model/dimensions?with=details&analyticObjectName=Employee' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'

The response returns the details of all dimensions, including object names, dimension types, and descriptions.

Retrieve a list of dimensions by analytic object

Use this sample request to retrieve all the dimensions for the Applicant Stage subject.

Copy
cURL sample request: Retrieve a list of all Applicant Stage dimensions
curl -X GET --url 'https://{vanity_name}.api.visier.io/v2alpha/data/model/dimensions/Applicant_Stage' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}'

The response returns the details of dimensions for the specified analytic object, including object names, dimension types, and descriptions.

Create dimensions

Use this sample request to create a new dimension. To publish the new dimension directly to production, omit the ProjectID header.

Copy
cURL sample request: Create a new Employee dimension
curl -X POST --url 'https://{vanity_name}.api.visier.io/v2alpha/data/model/dimensions' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'ProjectID:{project_id}' \
-H 'Content-Type: application/json' \
-d '{
    "dimensions": [
        {
            "executionContext": {
                "tenantCode": "WFF_j1r~c7o"
            },
            "dimension": {
                "objectName": "Employee.OrganizationalStructure",
                "basicInformation": {
                    "displayName": "Organizational Structure",
                    "shortDisplayName": "Org Structure",
                    "description": "Employee organizational hierarchy",
                    "explanation": "This dimension represents employee positions within the organizational structure"
                },
                "details": {
                    "leveled": {
                        "levelList": {
                            "levels": [
                                {
                                    "objectName": "OrgStructure.Division",
                                    "displayName": "Division",
                                    "description": "Top-level organizational division",
                                    "type": "String",
                                    "propertyDependencyList": {
                                        "propertyDependencies": [
                                            {
                                                "analyticObjectName": "Employee",
                                                "propertyObjectName": "Level1_Property"
                                            }
                                        ]
                                    }
                                }
                            ]
                        },
                        "hideNullValues": false,
                        "enableLargeDimensionSearch": false
                    }
                },
                "visibleInApp": true,
                "includeWithVee": false,
                "tagList": {
                    "tags": [
                        {
                            "objectName": "Category_Leadership"
                        },
                        {
                            "objectName": "Assignment"
                        },
                        {
                            "objectName": "Category_Performance"
                        }
                    ]
                }
            }
        }
    ]
}'

The response returns whether the dimension was successfully created or not.

Update dimensions

Use this sample request update an existing dimension's entire definition. To publish the update directly to production, omit the ProjectID header.

Copy
cURL sample request: Update the Organizational Structure dimension by adding a new level
curl -X PUT --url 'https://{vanity_name}.api.visier.io/v2alpha/data/model/dimensions' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'ProjectID:{project_id}' \
-H 'Content-Type: application/json' \
-d '{
    "dimensions": [
        {
            "executionContext": {
                "tenantCode": "WFF_j1r~c7o'
            },
            "dimension": {
                "objectName": "Employee.OrganizationalStructure",
                "basicInformation": {
                    "displayName": "Organizational Structure",
                    "shortDisplayName": "Org Structure",
                    "description": "Employee organizational hierarchy",
                    "explanation": "This dimension represents employee positions within the organizational structure"
                },
                "details": {
                    "leveled": {
                        "levelList": {
                            "levels": [
                                {
                                    "objectName": "OrgStructure.Division",
                                    "displayName": "Division",
                                    "description": "Top-level organizational division",
                                    "type": "String",
                                    "propertyDependencyList": {
                                        "propertyDependencies": [
                                            {
                                                "analyticObjectName": "Employee",
                                                "propertyObjectName": "Level1_Property"
                                            }
                                        ]
                                    }
                                },
                                {
                                    "objectName": "OrgStructure.Department",
                                    "displayName": "Department",
                                    "description": "Department within division",
                                    "type": "String",
                                    "propertyDependencyList": {
                                        "propertyDependencies": [
                                            {
                                                "analyticObjectName": "Employee",
                                                "propertyObjectName": "Level2_Property"
                                            }
                                        ]
                                    }
                                }
                            ]
                        },
                        "hideNullValues": false,
                        "enableLargeDimensionSearch": false
                    }
                },
                "visibleInApp": true,
                "includeWithVee": false,
                "tagList": {
                    "tags": [
                        {
                            "objectName": "Category_Leadership"
                        },
                        {
                            "objectName": "Assignment"
                        },
                        {
                            "objectName": "Category_Performance"
                        }
                    ]
                }
            }
        }
    ]
}'

The response returns whether the dimension was successfully updated or not.

Partially update dimensions

Use this sample request update certain fields for an existing dimension. To publish the update directly to production, omit the ProjectID header.

Copy
cURL sample request: Partially update the Organizational Structure dimension by adding a new level
curl -X PATCH --url 'https://{vanity_name}.api.visier.io/v2alpha/data/model/dimensions' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'ProjectID:{project_id}' \
-H 'Content-Type: application/json' \
-d '{
    "dimensions": [
        {
            "executionContext": {
                "tenantCode": "WFF_j1r~c7o"
            },
            "dimension": {
                "objectName": "Employee.OrganizationalStructure",
                "basicInformation": {
                    "displayName": "Patched Organizational Structure",
                    "shortDisplayName": "Patched Org Structure",
                    "description": "Patched Employee organizational hierarchy",
                    "explanation": "This dimension represents patched employee positions within the organizational structure"
                },
                "details": {
                    "leveled": {
                        "levelList": {
                            "levels": [
                                {
                                    "objectName": "OrgStructure.Department",
                                    "displayName": "Department",
                                    "description": "Department within division",
                                    "type": "String",
                                    "propertyDependencyList": {
                                        "propertyDependencies": [
                                            {
                                                "analyticObjectName": "Employee",
                                                "propertyObjectName": "Level2_Property"
                                            }
                                        ]
                                    }
                                }
                            ]
                        },
                        "hideNullValues": false,
                        "enableLargeDimensionSearch": false
                    }
                },
                "visibleInApp": true,
                "includeWithVee": false,
            }
        }
    ]
}'

The response returns whether the dimension was successfully updated or not.

Delete dimensions

Use this sample request to delete an existing dimension. To publish the change directly to production, omit the ProjectID header.

Copy
cURL sample request: Delete the Organizational Structure dimension
curl -X DELETE --url 'https://{vanity_name}.api.visier.io/v2alpha/data/model/dimensions' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'ProjectID:{project_id}' \
-H 'Content-Type: application/json' \
-d '{
    "dimensions": [
        {
            "executionContext": {
                "tenantCode": "WFF_j1r~c7o"
            },
            "dimension": {
                "objectName": "Employee.OrganizationalStructure",
                }
            }
        }
    ]
}'

The response returns whether the dimension was successfully deleted or not.