Jump to: navigation, search
(Sample #2)
(Notification)
Line 69: Line 69:
 
===Notification===
 
===Notification===
 
<source lang="text">
 
<source lang="text">
{
+
{
   "data": {
+
   "data":{
"notificationType": "StatusChange",
+
      "notificationType":"StatusChange",
"call": {
+
      "call":{
"id": "012PUFMMS0ASNAK48O7GK2LAES000004",
+
        "id":"012PUFMMS0ASNAK48O7GK2LAES000004",
"state": "Dialing",
+
        "state":"Dialing",
"callUuid": "012PUFMMS0ASNAK48O7GK2LAES000004",
+
        "callUuid":"012PUFMMS0ASNAK48O7GK2LAES000004",
"connId": "007102719260b004",
+
        "connId":"007102719260b004",
"deviceUri": "http://hpe-voicevm-70.genesyslab.com:8090/api/v2/devices/631608b3-ceb1-472b-ba05-2ae39555b0d1",
+
        "deviceUri":"http://hpe-voicevm-70.genesyslab.com:8090/api/v2/devices/631608b3-ceb1-472b-ba05-2ae39555b0d1",
"participants": [
+
        "participants":[
{
+
            {
"e164Number": "",
+
              "e164Number":"",
"formattedPhoneNumber": "15002",
+
              "formattedPhoneNumber":"15002",
"phoneNumber": "15002",
+
              "phoneNumber":"15002",
"digits": "15002"
+
              "digits":"15002"
}
+
            }
],
+
        ],
"dnis": "15002",
+
        "dnis":"15002",
"callType": "Internal",
+
        "callType":"Internal",
"capabilities": [
+
        "capabilities":[
"SendDtmf",
+
            "SendDtmf",
"DeleteUserData",
+
            "DeleteUserData",
"AttachUserData",
+
            "AttachUserData",
"DeleteUserDataPair",
+
            "DeleteUserDataPair",
"Hangup",
+
            "Hangup",
"UpdateUserData"
+
            "UpdateUserData"
],
+
        ],
"duration": "0",
+
        "duration":"0",
"mute": "Off",
+
        "mute":"Off",
"supervisorListeningIn": false,
+
        "supervisorListeningIn":false,
"monitoredUserMuted": false,
+
        "monitoredUserMuted":false,
"monitoring": false,
+
        "monitoring":false,
"uri": "http://hpe-voicevm-70.genesyslab.com:8090/api/v2/me/calls/012PUFMMS0ASNAK48O7GK2LAES000004",
+
        "uri":"http://hpe-voicevm-70.genesyslab.com:8090/api/v2/me/calls/012PUFMMS0ASNAK48O7GK2LAES000004",
"path": "/calls/012PUFMMS0ASNAK48O7GK2LAES000004"
+
        "path":"/calls/012PUFMMS0ASNAK48O7GK2LAES000004"
},
+
      },
"phoneNumber": "15000",
+
      "phoneNumber":"15000",
"extensions": {
+
      "extensions":{
"BusinessCall": 0
+
        "BusinessCall":0
},
+
      },
"messageType": "CallStateChangeMessage",
+
      "messageType":"CallStateChangeMessage"
"metrics": {
+
  },
"eventProcessing": {
+
   "channel":"/v2/me/calls"
"nodeProcessingTimeNanos": 4911602,
 
"serverGenerationTimestamp": 1444920326391,
 
"serverProcessingTimeTotalMs": 5
 
}
 
},
 
   "channel": "/v2/me/calls",
 
  }
 
 
}
 
}
 
</source>
 
</source>

Revision as of 15:04, October 15, 2015

Dial

This operation is part of the Voice API section of the Genesys Web Services REST API.

Overview

Initiates a new outbound call to the specified destination.

Request URL /api/v2/me/devices/{id}/calls
HTTP Method POST
Required Features api-voice

Parameters

Parameter Value
operationName Dial
destination A JSON object that includes the number to be dialed:
{ 
  "phoneNumber": "5551212" 
}
location An optional parameter that is used by GWS to set the "location" attribute for the corresponding TServer requests.
userData An optional JSON object that includes key/value data to be included with the call:
{
  "Product": "Guitars"
}

Sample #1

Request

POST api/v2/me/devices/631608b3-ceb1-472b-ba05-2ae39555b0d1/calls
 
{
  "operationName": "Dial",
  "destination": {
    "phoneNumber": "15002"
  }
}

Response

{
  "statusCode": 0
}

Notification

{  
   "data":{  
      "notificationType":"StatusChange",
      "call":{  
         "id":"012PUFMMS0ASNAK48O7GK2LAES000004",
         "state":"Dialing",
         "callUuid":"012PUFMMS0ASNAK48O7GK2LAES000004",
         "connId":"007102719260b004",
         "deviceUri":"http://hpe-voicevm-70.genesyslab.com:8090/api/v2/devices/631608b3-ceb1-472b-ba05-2ae39555b0d1",
         "participants":[  
            {  
               "e164Number":"",
               "formattedPhoneNumber":"15002",
               "phoneNumber":"15002",
               "digits":"15002"
            }
         ],
         "dnis":"15002",
         "callType":"Internal",
         "capabilities":[  
            "SendDtmf",
            "DeleteUserData",
            "AttachUserData",
            "DeleteUserDataPair",
            "Hangup",
            "UpdateUserData"
         ],
         "duration":"0",
         "mute":"Off",
         "supervisorListeningIn":false,
         "monitoredUserMuted":false,
         "monitoring":false,
         "uri":"http://hpe-voicevm-70.genesyslab.com:8090/api/v2/me/calls/012PUFMMS0ASNAK48O7GK2LAES000004",
         "path":"/calls/012PUFMMS0ASNAK48O7GK2LAES000004"
      },
      "phoneNumber":"15000",
      "extensions":{  
         "BusinessCall":0
      },
      "messageType":"CallStateChangeMessage"
   },
   "channel":"/v2/me/calls"
}

Sample #2

This sample includes a key/value pair with the Dial request:

Request

POST api/v2/me/devices/631608b3-ceb1-472b-ba05-2ae39555b0d1/calls
{
  "operationName": "Dial",
  "destination": {
    "phoneNumber": "15002"
  },
  "userData": {
    "CustomerSegment": "Gold"
  }
}

Response

{
  "statusCode": 0
}


Notification

{  
   "data":{  
      "notificationType":"StatusChange",
      "call":{  
         "id":"012PUFMMS0ASNAK48O7GK2LAES000004",
         "state":"Dialing",
         "callUuid":"012PUFMMS0ASNAK48O7GK2LAES000004",
         "connId":"007102719260b004",
         "deviceUri":"http://hpe-voicevm-70.genesyslab.com:8090/api/v2/devices/631608b3-ceb1-472b-ba05-2ae39555b0d1",
         "participants":[  
            {  
               "e164Number":"",
               "formattedPhoneNumber":"15002",
               "phoneNumber":"15002",
               "digits":"15002"
            }
         ],
         "dnis":"15002",
         "callType":"Internal",
         "capabilities":[  
            "SendDtmf",
            "DeleteUserData",
            "AttachUserData",
            "DeleteUserDataPair",
            "Hangup",
            "UpdateUserData"
         ],
         "userData":{  
            "CustomerSegment":"Gold"
         },
         "duration":"0",
         "mute":"Off",
         "supervisorListeningIn":false,
         "monitoredUserMuted":false,
         "monitoring":false,
         "uri":"http://hpe-voicevm-70.genesyslab.com:8090/api/v2/me/calls/012PUFMMS0ASNAK48O7GK2LAES000004",
         "path":"/calls/012PUFMMS0ASNAK48O7GK2LAES000004"
      },
      "phoneNumber":"15000",
      "extensions":{  
         "BusinessCall":0
      },
      "messageType":"CallStateChangeMessage"
   },
   "channel":"/v2/me/calls"
}
Comments or questions about this documentation? Contact us for support!