Exago Logo
Search
Generic filters
Exact matches only

REST — Parameters

Parameters are used throughout the application to store values. The User Identification parameters are used for identifying the current user. Non-hidden parameters can be accessed in reports.

Parameter JSON

Parameters are represented as JSON objects with the following properties. In v2022.1.0+, parameters can have multiple values. When the IsMultiValue property is True, use the Values array for getting and setting the values. When IsMultiValue is False, use the Value property for getting and setting the value.

Name Type Writable Description
Id string required-create The unique Id of this parameter
DataType enum yes (“String”) Parameter Type
Value string yes

The value of this parameter, f IsMultiValue is False. If IsMultiValue is True, a comma-separated list of the values from the Values array.

If IsMultiValue is True, and any strings in the array contain commas, all values are encapsulated in single quotes (e.g. 'a,bc', 'cde', 'efg). Any strings containing single quotes are escaped (e.g. 'it\'s', 'hot', 'out')

PromptText string yes If set, text to prompt the user for a value
IsHidden Boolean yes (true) Whether the parameter is accessible in reports
IsMultiValue v2022.1.0+ Boolean yes (false) Whether this parameter holds a single value (false) or multiple values (true). If false, the parameter value is held in the Value property. If true, the values are held in the Values property.
Values v2022.1.0+ Array of strings yes

If IsMultiValue is True, an array of values for this parameter.

When IsMultiValue is False, the string at index 0 of this array is the same as the Value property.

Example

{
  "Id":         "MyParameter",
  "DataType":   "String",
  "Value":      "",
  "PromptText": "Input a value",
  "IsHidden":   true
}

List All Parameters

List all the parameters in the current configuration. Output is an array of objects, each representing an individual parameter.

GET /rest/Parameters
Name Type Description
Id string The unique Id of this parameter

Using curl

curl http://{webservice}/rest/Parameters?sid={sid} -X GET

Example response

Status: 200 OK

  {
    "Id": "MyParameter"
  },
  {
    "Id": "HelloWorld"
  }

Show an Existing Parameter

Show the properties of the parameter specified by its Id.

GET /rest/Parameters/{Id}

Using curl

curl http://{webservice}/rest/Parameters/{Id}?sid={sid} -X GET

Example response

Status: 200 OK

{
  "Id":         "MyParameter",
  "DataType":   "String",
  "Value":      "",
  "PromptText": "Input a value",
  "IsHidden":   true
}

Create a New Parameter

Parameters are designed to be set in the API. If they do not already exist in config, create them programmatically.

POST /rest/Parameters

Using curl

curl http://{webservice}/rest/Parameters?sid={sid} -X POST ^
	-d "{'Id':'Hello','DataType':'String','Value':'World','IsHidden':false}"

Example response

Status: 201 Created
Location: /{webservice}/rest/Parameters/Hello

{
  "Id":         "Hello",
  "DataType":   "String",
  "Value":      "World",
  "PromptText": "",
  "IsHidden":   false
}

Edit an Existing Parameter

Only supply the properties to be edited.

PATCH /rest/Parameters/{Id}

Using curl

curl http://{webservice}/rest/Parameters/{Id}?sid={sid} -X PATCH ^
	-d "{'IsHidden':true}"

Example response

Status: 204 No Content

Delete Parameter

DELETE /rest/Parameters/{Id}

Using curl

curl http://{webservice}/rest/Parameters/{Id}?sid={sid} -X DELETE

Example response

Status: 204 No Content
Was this article helpful?
0 out of 5 stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.
Tags:
Table of Contents