Parameters are used throughout the application to store values. The UserId and CompanyId parameters are used for identifying the current user. Non-hidden parameters can be accessed in reports.
Note. All requests require Session Id URL parameter and basic request headers. In the following examples, headers are omitted for clarity.
Parameters are represented as JSON objects with the following properties:
Name | Type | Writeable | 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 |
PromptText | string | yes | If set, text to prompt the user for a value |
IsHidden | boolean | yes (true) | Whether the parameter is accessible in reports |
{ "Id": "MyParameter", "DataType": "String", "Value": "", "PromptText": "Input a value", "IsHidden": true }
GET /rest/parameters
List all the parameters in the current configuration. Output is an array of objects, each representing an individual parameter.
Name | Type | Description |
Id | string | The unique Id of this parameter |
curl http://{webservice}/rest/parameters?sid={sid} -X GET
Status: 200 OK [ { "Id": "MyParameter" }, { "Id": "HelloWorld" } ]
GET /rest/parameters/{Id}
Show the properties of the parameter specified by its Id.
curl http://{webservice}/rest/parameters/{Id}?sid={sid} -X GET
Status: 200 OK
{ "Id": "MyParameter", "DataType": "String", "Value": "", "PromptText": "Input a value", "IsHidden": true }
POST /rest/parameters
Parameters are designed to be set in the API. If they do not already exist in config, create them programmatically.
curl http://{webservice}/rest/parameters?sid={sid} -X POST ^ -d "{'Id':'Hello','DataType':'String','Value':'World','IsHidden':false}"
Status: 201 Created
Location: /{webservice}/rest/Parameters/Hello
{ "Id": "Hello", "DataType": "String", "Value": "World", "PromptText": "", "IsHidden": false }
PATCH /rest/parameters/{Id}
Only supply the properties to be edited.
curl http://{webservice}/rest/parameters/{Id}?sid={sid} -X PATCH ^ -d "{'IsHidden':true}"
Status: 204 No Content
DELETE /rest/parameters/{Id}
curl http://{webservice}/rest/parameters/{Id}?sid={sid} -X DELETE
Status: 204 No Content