Jump to: navigation, search

Settings API

Interaction Recording Web Services includes the Settings API, which you can use to create custom settings groups and settings to suit the needs of your client application. You'll typically only need this API if you plan to enable recording privacy settings in the Genesys Interaction Recording API.

If you query for settings groups (GET /api/v2/settings or GET /api/v2/settings?subresources=*., for example), Interaction Recording Web Services returns the Settings resource, which includes URIs that correspond to your available settings groups.

Settings resource

The settings resource includes properties that describe the settings group, which are returned from GET requests to /api/v2/settings or GET requests to /api/v2/settings?subresources=*.

Sample data

{  
   "settings":[  
      {  
         "name":"metadata.privacy.agent_fields",
         "value":"callerPhoneNumber, dialedPhoneNumber, dnis, ani, agentId, username, phoneNumber, userName, firstName, lastName, GSIP_RECORD"
      },
      {  
         "name":"metadata.privacy.customer_fields",
         "value":"callerPhoneNumber, dialedPhoneNumber, dnis, ani, agentId, username, phoneNumber, userName, firstName, lastName, GSIP_RECORD"
      }
   ]
}

Resource details

Field Description
name A URI-compatible name for the settings group. This name is used as part of the URI to access the group: (for example, GET /settings/my-settings-group)
displayName Name that describes the settings group.
key The name of the key attribute for this group's settings. Whenever an individual setting needs to be modified, this key attribute is used to identify the setting. The value of the key attribute must be unique for every setting and is read-only after the setting has been created. A setting may not be created without this attribute. If the key attribute is missing, then Interaction Recording Web Services uses "name" as the default identifying attribute.
uri The URI to the settings group.
path The path to the settings resource.

Custom settings

You can use custom settings for any purpose in your client application — storing user preferences is a common example. If you want to enable recording privacy settings in the Genesys Interaction Recording API, you'll need to use the Settings API to create settings that tell Interaction Recording Web Services which fields to mask in the data it returns for GetRecordings requests.

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 the Genesys configuration continue to be imported as before.

Check out the examples below to see how to work with custom settings:

Get available settings groups

Request

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

Response

{  
   "settings":[  
      {  
         "displayName":"metadata.privacy.agent_fields",
         "key":"name",
         "uri":"http://198.51.100.3:8090/api/v2/settings/metadata.privacy.agent_fields"
      },
      {  
         "displayName":"metadata.privacy.customer_fields",
         "key":"name",
         "uri":"http://198.51.100.3:8090/api/v2/settings/metadata.privacy.customer_fields"
      }
   ],
   "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
}
This page was last edited on September 27, 2017, at 23:48.
Comments or questions about this documentation? Contact us for support!