Project variable APIs
Project variables are user-defined key-value pairs that are accessible across all flow services within a specific project. They help you manage configuration values that might be reused in multiple flow services. By using project variable APIs, you can create and manage project variables.
POST - Create project variables
Create a project variable in a specific project.
- URL
../apis/v2/rest/projects/{projectName}/configurations/variables?type=projectVariable- Parameters
-
- {projectName} - Name of the project.
- Request headers
-
{ Authorization: Basic Auth } - Request body
-
{ "key": "<variablekey>", "value": "<value>", "isPassword": <specify true if the variable is of type password, else, false>, "isGlobal": <specify true if the variable is a global varaible, else false> } - Response
- If the request is successful, the HTTP 201 Created status response code is
displayed.
{ "message": "Project variable created successfully." }
PUT - Update project variables
Updates the value of a specific project variable.
- URL
../apis/v2/rest/projects/{projectName}/configurations/variables/{variableName}?type=projectVariable- Parameters
-
- {projectName} - Name of the project.
- {variableName} - Name of the variable.
- Request headers
-
Headers: { Authorization: Basic Auth } - Request body
-
{ "key": "<variablekey>", "value": "<value>", "isPassword": <specify true if the variable is of type password, else, false>, "isGlobal": <specify true if the variable is a global varaible, else false> } - Response
-
{ "message": "Project variable updated successfully." }
DELETE - Delete project variables
Deletes a specific project variable.
- URL
../apis/v2/rest/projects/{projectName}/configurations/variables/{variableName}?type=projectVariable- Parameters
-
- {projectName} - Name of the project.
- {variableName} - Name of the variable.
- Request headers
-
{ Authorization: Basic Auth } - Request body
- None
- Response
- If the request is successful, the HTTP 204 No content response code is
displayed.
{ "message": "Project variable deleted successfully." }
GET - Get project variables
Retrieves the value of a specific project variable.
- URL
../apis/v2/rest/projects/{projectName}/configurations/variables/{variableName}?type=projectVariable- Parameters
-
- {projectName} - Name of the project.
- {variableName} - Name of the variable.
- Request headers
-
{ Authorization: Basic Auth } - Request body
- None
- Response
-
{ "key": "<variablekey>", "value": "<value>", "isPassword": <if true, the variable of type password, else, false>, "isGlobal": <if true, the variable is a global varaible, else false> }
GET - List project variables
Retrieves all project variables that are configured in a project.
- URL
../apis/v2/rest/projects/{projectName}/configurations/variables?type=projectVariable- Parameters
-
- <projectName> - Name of the project.
- Request headers
-
{ Authorization: Basic Auth } - Request body
- None
- Response
-
[ { "key": "<variablekey>", "value": "<value>", "packageName": "<packagename>", "type": "projectVariable", "isPassword": <if true, the variable of type password, else, false>, "isGlobal": <if true, the variable is a global varaible, else false> }, { "key": "<variablekey>", "value": <value>, "packageName": "<packagename>", "type": "projectVariable", "isPassword": <if true, the variable of type password, else, false>, "isGlobal": <if true, the variable is a global varaible, else false> } ]
POST - Sync project variables
Synchronize the project variables.
- URL
../apis/v1/rest/projects/{projectName}/configurations/variables/sync?keys={}&type=projectVariable- Parameters
-
- <projectName> - Name of the project.
- keys - List of keys in the project where it needs to be synced from vault. If the keys list is empty, then sync all the variables in the project with vault.
- Request headers
-
{ Authorization: Basic Auth } - Request body
- None
- Response
-
- If successful, the response code is as follows:
{ "code": 0, } - If an error occurs, the response is as follows:
{ "code": -1, "description": "The list of variables that could not be synced with project <projectname>.", "details": { "projectId": "<projectID>", "projectName": "<projectname>", "VariablesFailedToSync": [ "<Var1>", "<Var2>" ] } } }
- If successful, the response code is as follows:
<MethodName> - <API Name>
<API Description>
- URL
- ../
- Parameters
- None
- Request headers
-
{ Authorization: Basic Auth } - Request body
-
- Response
-