Update an instance of variables

patch

/services/rest/connect/latest/variables/{id}

Request

Path Parameters
Body ()
A variable is a predefined shortcut for entering information instead of a long string of text.
Root Schema : variables
Type: object
A variable is a predefined shortcut for entering information instead of a long string of text.
Show Source
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
Nested Schema : variables-interfaceValues
Type: object
The interface-specific value of a variable.
Show Source
  • siteInterfaces
    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.
  • Maximum Length: 1333
    The text that will be used on this 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
Nested Schema : siteInterfaces
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.
Show Source
Nested Schema : namedIDs-siteInterfaces-language
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

Response

Default Response

Examples

Use the PATCH operation with the following syntax to partially update a variable:

https://your_site_interface/services/rest/connect/version/variables/variable_id

Include the data to be updated in the request body. Only the fields present in the request JSON data are updated. All other fields remain the same.

Request URI example

For example, you want to add a value for another interface. Use PATCH with the following URI:

https://mysite.example.com/services/rest/connect/v1.4/variables/6

Request body example

{
"interfaceValues": [
    {
    "interface":
        {
        "id": 2
        },
    "value": "Oracle Service Cloud"
    }
    ]
}

Response example

The status 200 OK is returned. Then using GET with the following request:

https://mysite.example.com/services/rest/connect/v1.4/variables/6/interfaceValues/2

returns the following data:

{
  "interface": {
    "links": [
      {
        "rel": "self",
        "href": "https://mysite.example.com/services/rest/connect/v1.4/siteInterfaces/2"
      },
      {
        "rel": "canonical",
        "href": "https://mysite.example.com/services/rest/connect/v1.4/siteInterfaces/2"
      },
      {
        "rel": "describedby",
        "href": "https://mysite.example.com/services/rest/connect/v1.4/metadata-catalog/siteInterfaces",
        "mediaType": "application/schema+json"
      }
    ]
  },
  "value": "Oracle Service Cloud",
  "links": [
    {
      "rel": "self",
      "href": "https://mysite.example.com/services/rest/connect/v1.4/variables/6/interfaceValues/2"
    },
    {
      "rel": "canonical",
      "href": "https://mysite.example.com/services/rest/connect/v1.4/variables/6/interfaceValues/2"
    },
    {
      "rel": "describedby",
      "href": "https://mysite.example.com/services/rest/connect/v1.4/metadata-catalog/variables/
       interfaceValues",
      "mediaType": "application/schema+json"
    }
  ]
}

Note:

The variable Product now has a value for its second interface.