Create a variable
post
/services/rest/connect/v1.4/variables
Request
A shortcut defined for a larger string that can be inserted in the body of an answer or inserted inline during a chat session. When the variable is inserted in the body of the answer or in a chat response, it is replaced with the value specified in the variable.
Root Schema : variables
Type:
object
A shortcut defined for a larger string that can be inserted in the body of an answer or inserted inline during a chat session. When the variable is inserted in the body of the answer or in a chat response, it is replaced with the value specified in the variable.
Show Source
-
createdTime:
string
The date and time when the variable was created. This attribute is read-only.
-
displayOrder:
integer
Minimum Value:
1
Maximum Value:2147483647
The position of the variable in the variable list. -
folder:
object variables-folder
An ID which has an associated name string. These IDs can be set by either value or name. If the name cannot uniquely determine the value, an error is generated.
-
id:
integer
Minimum Value:
1
Maximum Value:9223372036854776000
The unique identifier of the variable. -
interfaceValues:
object variables-interfaceValues
The interface-specific value of a variable.
-
lookupName:
string
Maximum Length:
255
The name used to look up the variable. -
name:
string
Maximum Length:
40
Pattern:^[a-zA-Z][a-zA-Z0-9_]*$
The name of the variable. -
searchIndexable:
boolean
Indicates whether the text is indexed for searching the customer portal. The default value is false.
-
updatedTime:
string
The date and time when the variable was last updated. This attribute is read-only.
Nested Schema : variables-folder
Type:
object
An ID which has an associated name string. These IDs can be set by either value or name. If the name cannot uniquely determine the value, an error is generated.
Show Source
-
id:
integer
Minimum Value:
1
ID value -
lookupName:
string
Maximum Length:
255
Name used to lookup this object -
parents:
object variables-folder-parents
NamedID in which the ID is read-only. Used for hierarchies, where caller can specify the parents by name, but cannot specify the parent IDs.
Nested Schema : variables-interfaceValues
Type:
object
The interface-specific value of a variable.
Show Source
-
interface:
object interface
The console, windows, and pages used by staff members and customers to access the application and interact with a single knowledge base. The interface name determines the URL for the web site, the name of the system executables, and the .cfg directory name. It is the reference to a resource in 'siteInterfaces' collection. Only ID or lookupName can be provided to specify the resource.
-
value:
string
Maximum Length:
1333
The description of the interface.
Nested Schema : variables-folder-parents
Type:
object
NamedID in which the ID is read-only. Used for hierarchies, where caller can specify the parents by name, but cannot specify the parent IDs.
Show Source
-
id:
integer
Minimum Value:
1
ID value. Read-only -
lookupName:
string
Maximum Length:
255
Name used to lookup this object
Nested Schema : interface
Type:
object
The console, windows, and pages used by staff members and customers to access the application and interact with a single knowledge base. The interface name determines the URL for the web site, the name of the system executables, and the .cfg directory name. It is the reference to a resource in 'siteInterfaces' collection. Only ID or lookupName can be provided to specify the resource.
Response
Default Response
Root Schema : variables
Type:
object
A shortcut defined for a larger string that can be inserted in the body of an answer or inserted inline during a chat session. When the variable is inserted in the body of the answer or in a chat response, it is replaced with the value specified in the variable.
Show Source
-
createdTime:
string
The date and time when the variable was created. This attribute is read-only.
-
displayOrder:
integer
Minimum Value:
1
Maximum Value:2147483647
The position of the variable in the variable list. -
folder:
object variables-folder
An ID which has an associated name string. These IDs can be set by either value or name. If the name cannot uniquely determine the value, an error is generated.
-
id:
integer
Minimum Value:
1
Maximum Value:9223372036854776000
The unique identifier of the variable. -
interfaceValues:
object variables-interfaceValues
The interface-specific value of a variable.
-
lookupName:
string
Maximum Length:
255
The name used to look up the variable. -
name:
string
Maximum Length:
40
Pattern:^[a-zA-Z][a-zA-Z0-9_]*$
The name of the variable. -
searchIndexable:
boolean
Indicates whether the text is indexed for searching the customer portal. The default value is false.
-
updatedTime:
string
The date and time when the variable was last updated. This attribute is read-only.
Nested Schema : variables-folder
Type:
object
An ID which has an associated name string. These IDs can be set by either value or name. If the name cannot uniquely determine the value, an error is generated.
Show Source
-
id:
integer
Minimum Value:
1
ID value -
lookupName:
string
Maximum Length:
255
Name used to lookup this object -
parents:
object variables-folder-parents
NamedID in which the ID is read-only. Used for hierarchies, where caller can specify the parents by name, but cannot specify the parent IDs.
Nested Schema : variables-interfaceValues
Type:
object
The interface-specific value of a variable.
Show Source
-
interface:
object interface
The console, windows, and pages used by staff members and customers to access the application and interact with a single knowledge base. The interface name determines the URL for the web site, the name of the system executables, and the .cfg directory name. It is the reference to a resource in 'siteInterfaces' collection. Only ID or lookupName can be provided to specify the resource.
-
value:
string
Maximum Length:
1333
The description of the interface.
Nested Schema : variables-folder-parents
Type:
object
NamedID in which the ID is read-only. Used for hierarchies, where caller can specify the parents by name, but cannot specify the parent IDs.
Show Source
-
id:
integer
Minimum Value:
1
ID value. Read-only -
lookupName:
string
Maximum Length:
255
Name used to lookup this object
Nested Schema : interface
Type:
object
The console, windows, and pages used by staff members and customers to access the application and interact with a single knowledge base. The interface name determines the URL for the web site, the name of the system executables, and the .cfg directory name. It is the reference to a resource in 'siteInterfaces' collection. Only ID or lookupName can be provided to specify the resource.
Examples
Use POST with the following syntax to create a new variable:
https://your_site_interface/services/rest/connect/version/variables
Note:
While creating variable objects using the APIs, ensure that the number of variable objects multiplied by the number of interfaces on your site does not exceed the maximum limit 80000.Request URI example
https://mysite.example.com/services/rest/connect/v1.4/variables
Request body example
{
"name": "Product",
"interfaceValues": [
{
"interface":
{
"id": 1
},
"value": "Oracle Service Cloud"
}
]
}
Note:
Thename
field
is required for variables.
Response body example
{
"id": 6,
"lookupName": "Product",
"displayOrder": 3,
"folder": null,
"interfaceValues": {
"links": [
{
"rel": "self",
"href": "https://mysite.example.com/services/rest/connect/v1.4/variables/6/interfaceValues"
}
]
},
"name": "Product",
"searchIndexable": false,
"links": [
{
"rel": "self",
"href": "https://mysite.example.com/services/rest/connect/v1.4/variables/6"
},
{
"rel": "canonical",
"href": "https://mysite.example.com/services/rest/connect/v1.4/variables/6"
},
{
"rel": "describedby",
"href": "https://mysite.example.com/services/rest/connect/v1.4/metadata-catalog/variables",
"mediaType": "application/schema+json"
}
]
}