Jump to: navigation, search

Open Media API

GMS supports OpenMedia API starting with 8.5.110. This API enables you to manage an Open Media interaction: you can create, retrieve, update, or stop an Open Media interaction by submitting one of the REST queries detailed below.


Create an Open Media Interaction

Creates an Open Media interaction. In your service configuration, you can define the default Interaction Type, Subtype, and Media Type to assign to created interactions. You can overwrite these defaults in your REST queries if you enable the allow_overwrite option in your configuration. See Open Media Service Options for further details.

Operation

POST /genesys/2/openmedia/{serviceName}
HTTP Header Value
Content-Type application/x-www-form-urlencoded
Parameter Name Type Mandatory Description
URI Parameters
serviceName string Yes Service to use to create the Open Media interaction.
Body Parameters
externalId string No External ID to link to the new interaction; for example: "xy932". This ID is passed to Interaction Server in the UserData with the key "ExternalId".
interactionType string No Interaction Type to assign to the new interaction, for example Inbound. The Interaction Type must match one of the values listed in the Business Attributes >Interaction Type section of your configuration.

By default, the Interaction Type used to create the interaction is defined in the interaction_type option of your Open Media service configuration. The system considers the interactionType parameter only if the allow_overwrite option is set to true in your service configuration. See the options section for more information.

interactionSubType string No Interaction Subtype to assign to the new interaction, for example InboundNew. The Interaction Subtype must match one of the values listed in the Business Attributes >Interaction Subtype section of your configuration.

By default, the Interaction Subtype used to create the interaction is defined in the interaction_subtype option of your Open Media service configuration. The system considers the interactionSubtype parameter only if the allow_overwrite option is set to true in your service configuration. See the options section for more information.

mediaType string No Media Type to assign to the new interaction, for example workitem. The Media Type must match one of the values listed in the Business Attributes > Media Type section of your configuration.

By default, the Media Type used to create the interaction is defined in the media_type option of your Open Media service configuration. The system considers the mediaType parameter only if the allow_overwrite option is set to true in your service configuration. See the options section for more information.

userData[<key-name>] string No User data to attach to the interaction. You can submit multiple user data. For example: userData[OrderNumber]=uABC123456789&userData[AnotherData]=MyOtherValue&userData[TestKey2]=Test

Examples

The following request includes the following encoded parameters:

externalId=xy932&userData[OrderNumber]=ABC123456789&userData[TestKey2]=Test value&userData[KeyToDelete]=value to delete
POST /genesys/2/openmedia/customer-support 
HTTP/1.1
Host: localhost:8080
Content-Type: application/x-www-form-urlencoded
Cache-Control: no-cache

externalId=xy932&userData%5BOrderNumber%5D=ABC123456789&userData%5BTestKey2%5D=Test+value&userData%5BKeyToDelete%5D=value+to+delete

Response

HTTP 200 - success
{
  "statusCode": 0,
  "interactionId":"01QG0Q2S5S50G000"
}
HTTP 200 - failure (server down, network failure, etc. Try again)
{
  "statusCode": 1
}

Get an Open Media Interaction

Retrieves an Open Media Interaction by its interactionId (default) or by its externalId.


Operation

POST /genesys/2/openmedia/{serviceName}/{id}/get
HTTP Header Value
Content-Type application/x-www-form-urlencoded
Parameter Name Type Mandatory Description
URI Parameters
serviceName string Yes Service to use to create the Open Media interaction.
id string Yes ID to search. By default, the interactionId is used for search. For example: "xy932".
Body Parameters
searchByExternalId true, false No true to search by externalId. By default, if you omit this option's value, this option is false and an interaction ID is used for search.

Examples

Request

POST /genesys/2/openmedia/customer-support/01QG0Q2S5S50G000/get HTTP/1.1
Host: localhost:8080
Content-Type: application/x-www-form-urlencoded
Cache-Control: no-cache

Response

HTTP 200 - success
{
  "statusCode": 0,
  "interactionProperties": {
    "interactionType": "Inbound",
    "interactionId": "01QG0Q2S5S50G000",
    "interactionReceivedAt": "2017-05-31T04:43:52Z",
    "interactionIsHeld": false,
    "interactionSubmittedBy": "GMS-DC-API:gms1:1",
    "interactionMediatype": "promotion",
    "interactionTenantId": 1,
    "interactionQueue": "ATS Inbound Queue",
    "interactionSubmitSeq": "1049036",
    "interactionMovedToQueueAt": "2017-05-31T04:43:52Z",
    "interactionState": "Queued",
    "interactionSubmittedAt": "2017-05-31T04:43:52Z",
    "interactionPlacedInQueueAt": "2017-05-31T04:51:39Z",
    "interactionUserData": [
      {
        "key": "KeyToDelete",
        "type": "str",
        "value": "value to delete"
      },
      {
        "key": "OrderNumber",
        "type": "str",
        "value": "ABC123456789"
      },
      {
        "key": "TestKey2",
        "type": "str",
        "value": "Test value"
      },
		...
    ],
    "interactionSubtype": "InboundNew",
    "interactionIsLocked": false,
    "interactionIsOnline": false,
    "interactionPlaceInQueueSeq": "1050198"
  }
}

Response

HTTP 200 - Failure
{
  "statusCode": 2,
  "errors": [
    {
      "code": 248,
      "advice": "Specified interaction Id[01QG0Q2S5S50G000] was not found"
    }
  ]
}

Update an Open Media Interaction

Enables you to update values and/or delete key-value pairs. You need to provide at least one key to update or delete.

Operation

POST /genesys/2/openmedia/{serviceName}/{id}/update
HTTP Header Value
Content-Type application/x-www-form-urlencoded
Parameter Name Type Mandatory Description
URI Parameters
serviceName string Yes Service that manages the Open Media interaction.
id string Yes ID of the updated interaction. By default, the interactionId is used. For example: "xy932".
Body Parameters
change[<key-1>] string No Adds or modifies the value for the given user data key. For example:
change[OrderNumber]=uABC123456789

You must provide at least one key to change or delete.

change[<key-n>] string No Adds or modifies the value for the given user data key. For example:
change[TestKey]=myValue

You must provide at least one key to change or delete.

delete[<key-1>] empty No Key of the user data to delete. You do not need to provide a value; You can leave it empty. If you provide a value, it will be ignored.
delete[<key-n>] empty No Key of the user data to delete. You do not need to provide a value; You can leave it empty. If you provide a value, it will be ignored.

Examples

In this example, the requested update to be encoded is: change[OrderNumber]=uABC123456789&change[TestKey2]=uTest+value&delete[KeyToDelete]=

POST genesys/2/openmedia/test/0000KaA0C8XH003Y/stop
POST /genesys/2/openmedia/customer-support/01QG0Q2S5S50G000/update HTTP/1.1
Host: localhost:8080
Content-Type: application/x-www-form-urlencoded
Cache-Control: no-cache

change%5BOrderNumber%5D=uABC123456789&change%5BTestKey2%5D=uTest+value&delete%5BKeyToDelete%5D=

Response

HTTP 200 - success
{
  "statusCode": 0
}
HTTP 200 - failure
{
  "statusCode": 2,
  "errors": [
    {
      "code": 248,
      "advice": "Interaction with specified id[01QG0Q2S5S50G000] was not found"
    }
  ]
}

Stop an Open Media Interaction

Operation

POST /genesys/2/openmedia/{serviceName}/{id}/stop
HTTP Header Value
Content-Type application/x-www-form-urlencoded
Parameter Name Type Mandatory Description
URI Parameters
serviceName string Yes Service that created the Open Media interaction.
id string Yes ID of the interaction to stop. By default, the interactionId is used. For example: "xy932".
Body Parameters
reasonSystemName string No Reason for stopping the interaction. This reason will be attached to the event sent by Interaction Server; for example: "Cancel"
reasonDescription string no Reason description for stopping the interaction. This description will be attached to the event sent by Interaction Server; for example: "Not needed"

Example

The following operation stops the interaction with the following encoded reason and description: reason=RSN-123&description=ORDER+CANCELLED

POST genesys/2/openmedia/test/0000KaA0C8XH003Y/stop
POST /genesys/2/openmedia/customer-support/01QG0Q2S5S50G000/stop HTTP/1.1
Host: localhost:8080
Content-Type: application/x-www-form-urlencoded
Cache-Control: no-cache

reason%3DRSN-123%26description%3DORDER%2BCANCELLED

Response

HTTP 200 - success
{
  "statusCode": 0
}
HTTP 200 - failure
{
  "statusCode": 2,
  "errors": [
    {
      "code": 248,
      "advice": "Interaction with specified id[01QG0Q2S5S50G0001] was not found"
    }
  ]
}
This page was last edited on October 21, 2019, at 09:06.
Comments or questions about this documentation? Contact us for support!