Skip to main content

Environment Variables

Environment Variables are global variables scoped to a specific Environment and can be used to manage environment specific values or configurations. They can be accessed from Connections and Orchestration Components using environmentVariable('myVariable'). In mapper Components, access Environment Variables through the Source Data expression.

An Environment Variable can be of type String, number, or Object.

Environment Variables Management API

An Environment Variable has an environmentVariableCode that represents the variable key, a name which represents a user-friendly name for the variable, a value which represents the variable value, and an optional description for any additional information you need to store regarding this variable.

Create an Environment Variable

POST {{engineUrl}}/experience/environment-variables
X-Customer-Code: {{customerCode}}
X-Environment-Code: {{environmentCode}}
Authorization: Bearer {{dxEngineToken}}

{
"environmentVariableCode": "region",
"name": "Region",
"value": "Pacific",
"description": "My Region"
}
POST {{engineUrl}}/experience/environment-variables
X-Customer-Code: {{customerCode}}
X-Environment-Code: {{environmentCode}}
Authorization: Bearer {{dxEngineToken}}

{
"environmentVariableCode": "envObject",
"name": "Environment Object",
"value": {
"stringValue": "Conscia",
"numberValue": 123,
"objectValue": {
"name": "Ayana",
"age": 9
}
}
}

Fetch all Environment Variables

GET {{engineUrl}}/experience/environment-variables
X-Customer-Code: {{customerCode}}
X-Environment-Code: {{environmentCode}}
Authorization: Bearer {{dxEngineToken}}

Fetch an Environment Variable

GET {{engineUrl}}/experience/environment-variables/{{environmentVariableCode}}
X-Customer-Code: {{customerCode}}
X-Environment-Code: {{environmentCode}}
Authorization: Bearer {{dxEngineToken}}

Update an Environment Variable

PATCH {{engineUrl}}/experience/environment-variables/{{environmentVariableCode}}
X-Customer-Code: {{customerCode}}
X-Environment-Code: {{environmentCode}}
Authorization: Bearer {{dxEngineToken}}

{
"value": "Atlantic"
}

Remove an Environment Variable

DELETE {{engineUrl}}/experience/environment-variables/{{environmentVariableCode}}
X-Customer-Code: {{customerCode}}
X-Environment-Code: {{environmentCode}}
Authorization: Bearer {{dxEngineToken}}