Jump to: navigation, search

Custom settings

This is part of the Settings API section of the Web Services API.

Overview

The Web Services API provides two types of settings you can access and manipulate:

  • System settings — System settings groups and settings are defined by Web Services and can be adjusted by clients through the API.
  • Custom settings — Custom settings groups and settings are defined by you to suit the needs of your client application.

You can use custom settings for any purpose in your client application — storing user preferences is a common example. The key used in the setting group can be defined when you create the group, and the structure of the setting property values themselves (beyond the key property) can have any structure as long as it's valid JSON.

Attributes

The attributes for each setting group vary. There is no limitation to the number of attributes defined or the values they contain, beyond that the values must contain valid JSON. One important thing to note is that if you have an attribute which holds a JSON object, you will not be able to modify the individual fields in the object. To modify a specific field, the whole object must be passed via PUT, overwriting the existing value.

Storage

The custom settings groups you create using the Settings API are only stored in Cassandra and not synchronized to Configuration Server. Settings groups you define in Configuration Server continue to be imported as before.

Get available settings groups

Request

GET http://198.51.100.3:8090/api/v2/settings

Response

{  
   "settings":[  
      {  
         "displayName":"interaction-workspace",
         "key":"name",
         "uri":"http://198.51.100.3:8090/api/v2/settings/interaction-workspace"
      },
      {  
         "displayName":"Voice",
         "key":"name",
         "uri":"http://198.51.100.3:8090/api/v2/settings/voice"
      },
      {  
         "displayName":"Voice Operations",
         "key":"operationName",
         "uri":"http://198.51.100.3:8090/api/v2/settings/voice-operations"
      },
      {  
         "displayName":"dispositions",
         "name":"dispositions",
         "uri":"http://198.51.100.3:8090/api/v2/settings/dispositions"
      },
      {  
         "displayName":"General Settings",
         "name":"general-settings",
         "uri":"http://198.51.100.3:8090/api/v2/settings/general-settings"
      },
      {  
         "displayName":"Agent States",
         "name":"agent-states",
         "uri":"http://198.51.100.3:8090/api/v2/settings/agent-states"
      }
   ],
   "statusCode":0
}

Create a new settings group

Request

POST /api/v2/settings
{
   "name": "client-settings",
   "displayName": "Client Settings",
   "key": "name"
}

Response

{  
   "statusCode":0,
   "id":"client-settings",
   "path":"/settings/client-settings",
   "uri":"http://dev-ip9-187.gws.genesys.com:8090/api/v2/settings/client-settings"
}

Create a new setting

Request

POST /api/v2/settings/client-settings
{
    "name": "Zone",
    "value": "North"
}

Response

{  
   "statusCode":0
}

Update a setting

Request

PUT /api/v2/settings/client-settings
{
    "name": "Zone",
    "value": "South"
}

Response

{  
   "statusCode":0
}

Create a setting with a complex property value

Request

POST /api/v2/settings/client-settings
{  
   "name":"department",
   "displayName":"Department",
   "possibleValues":[  
      {  
         "name":"tech_support",
         "displayName":"Tech Support",
         "possibleValues":[  
            {  
               "displayName":"Computers",
               "name":"computers"
            },
            {  
               "displayName":"Network",
               "name":"network"
            }
         ]
      },
      {  
         "displayName":"Sales",
         "name":"sales"
      }
   ]
}

Response

{  
   "statusCode":0
}

Update a setting with a complex property value

Request

PUT /api/v2/settings/client-settings
{  
   "name":"department",
   "possibleValues":[  
      {  
         "name":"tech_support",
         "displayName":"Tech Support",
         "possibleValues":[  
            {  
               "displayName":"Computers!!!",
               "name":"computers"
            },
            {  
               "displayName":"Network",
               "name":"network"
            }
         ]
      },
      {  
         "displayName":"Sales",
         "name":"sales"
      }
   ]
}

Response

{  
   "statusCode":0
}

Get settings in the group

Request

GET /api/v2/settings/client-settings

Response

{  
   "statusCode":0,
   "settings":[  
      {  
         "possibleValues":[  
            {  
               "name":"tech_support",
               "displayName":"Tech Support",
               "possibleValues":[  
                  {  
                     "displayName":"Computers!!!",
                     "name":"computers"
                  },
                  {  
                     "displayName":"Network",
                     "name":"network"
                  }
               ]
            },
            {  
               "displayName":"Sales",
               "name":"sales"
            }
         ],
         "name":"department",
         "displayName":"Department"
      },
      {  
         "name":"Zone",
         "value":"South"
      }
   ],
   "key":"name"
}

Delete a setting

Request

DELETE /api/v2/settings/client-settings
{
    "name": "Zone"
}

Response

{  
   "statusCode":0
}

Delete a settings group

Request

DELETE /api/v2/settings/client-settings

Response

{  
   "statusCode":0
}

Feedback

Comment on this article:

blog comments powered by Disqus
This page was last modified on March 25, 2016, at 10:23.