Callback Services API Guide
Callback Services API Guide
2/24/2022
Callback Services API
Getting Started
When you add a callback service, you define a Service Name, which is referred to as {callback-
execution-name} in this API documentation. Each time that you perform a callback query, you must
specify the {callback-execution-name} in the URI parameters.
http://<host>:<port>/genesys/1/service/callback/{callback-execution-name}
For instance, if you create a callback service named callback-for-mobile, then {callback-
execution-name} is callback-for-mobile, its configuration in GMS is located in the
service.callback-for-mobile section, and you can access the callback service at the following
URL:
http://<host>:<port>/genesys/1/service/callback/callback-for-mobile
Important
This list can include the _ors and _target options only.
_overwritable_options = _ors,_target
Then, you can pass _ors and _target in your REST query:
POST /1/service/callback/callback-for-mobile
{
"_ors": "http://myors:4421",
"_target": Billing@Stat_Server1.GA
}
To create a token variable, create a new service parameter and configure its value with a string
matching the following format: $<any-token-name>$
my_token_name = $my_token$
Then, you can use the body parameter my_token=<anyvalue> in your REST queries. As a result, the
occurrences of $my_token$ in this service configuration will be replaced with the query's provided
value.
For example, if you wish to create a callback request for the CLBCK-terminated-preview service
using the Stat_Server1 server target, use the following query:
POST /genesys/1/service/callback/CLBCK-terminated-preview
HTTP/1.1
Host: 127.0.0.1:8080
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
_customer_number=01822256&my_token=Stat_Server1
When GMS receives my_token=Stat_Server1 in the query information, it replaces the $my_token$
placeholder with Stat_Server1 everywhere that it is used in the configuration of CLBCK-terminated-
preview. Using our example, the result would be:
_target = Billing@Stat_Server1.GA
Tip
Use this feature to avoid duplicating configuration for multiple services that handle
the same functionality, but use different queues or servers.
Important
The _callback_state parameter is incompatible with the _new_desired_time
property.
You can get the following reasons in the _callback_reason parameter when receiving the COMPLETED
state.
ABANDONED_IN_QUEUE
The Callback interaction was deleted prior to routing the interaction to the agent because the customer abandoned.
AGENT_CONNECTED
Callback Service successfully routed the interaction to the agent.
AGENT_PREVIEW_CANCEL
The agent canceled the callback preview request. To get this state reason, create an Agent First Preview service and configure the
following options with the following values, for example: _agent_preview=true, _agent_preview_allow_reject=3,
_agent_preview_set_notready_reason='Coffee Break',
_agent_preview_set_notready_reason_attribute=false,_agent_preview_set_notready_reason_key='ReasonCode',
_agent_preview_timeout_set_notready=true, _agent_preview_via_rp=false
AGENT_PREVIEW_CANCEL_AFTER_<n>REJECTS
The agent rejected the request '<n>' times.
AM_CONNECTED
Callback Service successfully routed the interaction to the answering machine.
CANCELLED
Callback Service received a cancel request for this callback.
CANCELLED_BY_ADMIN
Callback Service received a cancel request from the Service Management UI for this callback.
FAIL_AGENT_CONNECT
The Callback interaction could not be connected to the agent. This error may happen when the value of
_max_time_to_wait_for_agent_on_the_call is too short.
FAIL_CALL_TO_CUSTOMER
Replaces FAIL_USER_UNREACHABLE since GMS 8.5.102.14. Callback Service could not connect the customer.
FAIL_ERROR
Callback Service failed due to an unknown error.
FAIL_FAX_REACHED
Callback Service could not connect the customer. The provided number was answered by a fax machine.
FAIL_INBOUND_TIMEOUT
The customer did not make the call within the expected _booking_expiration_timeout period defined for User-Originated scenarios.
FAIL_INCORRECT_CONFIG_MEDIA_TYPE
The _media_type option is set to an incorrect value. Callback Service only processes voice and chat interactions.
FAIL_INTERACTION_DELETED
The callback interaction was deleted prior to routing the interaction to the agent. This error may happen when
_wait_for_agent=true and the agent hung up the call.
FAIL_IXN_UNKNOWN_MEDIA_TYPE
The media type of the interaction is not supported by Callback Service. Callback Service only processes voice and chat
interactions.
FAIL_LOAD_MESSAGE_FILE
Callback Service cannot load the strings resource file specified in the _notification_message_file option.
FAIL_NO_CUSTOMER_NUMBER
Customer number is missing.
FAIL_QUEUEING
The Callback request could not be queued. This error may happen when an error occurs while requesting the route delay to URS.
FAIL_TARGET_NOT_FOUND
Callback Service cannot reserve the requested target to handle the request. This error may happen when the value of
_urs_queued_ttl is too short.
FAIL_TIMEOUT_TTL
Callback Service did not manage to handle the request in the specified time (_ttl).
FAIL_USER_NO_CONFIRM
The user confirmation was not received although it was required; this issue can occur if _on_user_confirm_timeout is not set to
CONNECT-ANYWAY.
FAIL_USER_UNREACHABLE
Reported as FAIL_CALL_TO_CUSTOMER prior to GMS 8.5.102.14.
NOT_AVAILABLE
Callback Service exited with no specified reason.
SUBMIT_ERROR
GMS did not manage to submit the Callback service request to Orchestration Server for processing.
Important
The documentation for "Query-EWT for Virtual Queues" was moved to the Stat Service
API page.
• If valid:
• Creates a unique ID for the request.
• Sends a reporting event to the GMS data manager indicating that the callback request has been
accepted and started.
This event also indicates the state of the request (immediate or scheduled).
• If the request needs to be scheduled for a later date/time, the request and its associated data
will be stored in the module persistent data storage.
• If the request can be started now, an ORS session is initiated using the associated SCXML-based
service with this particular callback request.
Note: the provisioned data for the execution service to be started will be used as input
along with the input parameters from the request itself.
Starting in 8.5.2, you can redial a COMPLETED callback by submitting the callback ID to create a copy
of this callback. The properties and user data of the copied callback are merged with the parameters
of the new callback submitted in the POST query.
• The parameters specified in the POST query override the copied properties.
• Internal retry flags and properties such as _callback_state, _ors_session_id, _desired_time will be
ignored when creating the callback copy.
Tip
You can include any of the _xxx callback option parameters in your start query if they
are not configured in the service; for example _target, _wait_for_agent,
_paused_services_list, _paused_services_id, or any other _xxx parameter listed
in the Callback Service Options Reference Guide. If the option is already configured in
the service, the query parameter's value is ignored and the service option value is
used. See Overwriting Configuration in queries to learn about overwriting
configuration in queries.
POST /genesys/1/service/callback/{callback-execution-name}
Initiates a callback request.
Header
application/json
multipart/form-data
Content-type
application/x-www-form-urlencoded
URI Parameters
Name Type Description
ID of a Callback in COMPLETED
state. The properties and user
data of this completed callback
_copy_from_id are copied in the new callback
Introduced in 8.5.2 string and use for redial.
• _desired_time is in 1h,
_request_execution_time_b
uffer=300 (5min), statistic
set is "EstimatedWaitTime"
returning, for example, 10min
_desired_time string then the Callback is not
immediate and will be
submitted later for
execution because
immediate = today
16h > today 15h + 5
min + 10 min =
false
• _desired_time is in 5min,
_request_execution_time_b
uffer=120 (2min), statistic
set is "EstimatedWaitTime"
returning, for example, 5min
Responses
Name Description
200 OK
Response Body (JSON content)
_id The service id for which a successful callback
required request was registered.
ID
only for immediate callback Dialog Event ID
Action
only for immediate callback Dialog Action.
Text
only for immediate callback Text to display
Name Description
OkTitle
only for immediate callback Label for the OK button.
Name Value
code 50006
phrase ORS_MAX_SUBMIT_RETRIES
exception com.genesyslab.gsg.services.callback.CallbackExceptionMaxORSSubmitAttempts
Name Value
code 40001
phrase NUMBER_ALREADY_BOOKED
exception com.genesyslab.gsg.services.callback.CallbackExceptionAlreadyBooked
Name Value
code 40002
phrase THROTTLE_SERVICE_LIMIT
exception com.genesyslab.gsg.services.callback.CallbackExceptionThrottled
Name Value
code 40003
phrase THROTTLE_SERVICE_INTERVAL_LIMIT
exception com.genesyslab.gsg.services.callback.CallbackExceptionThrottled
Name Value
code 40004
phrase THROTTLE_SERVICE_PARAMETER_LIMIT
exception com.genesyslab.gsg.services.callback.CallbackExceptionThrottled
Name Value
code 40020
phrase INVALID_OPERATION
exception com.genesyslab.gsg.services.callback.CallbackExceptionInvalidOperation
Name Value
"message": <ORS server's message>,
Name Value
code 40030
phrase CALLBACK_NOT_FOUND
exception com.genesyslab.gsg.services.callback.CallbackExceptionNotFound
Name Value
• SLOT_UNAVAILABLE (40050)
phrase
• SLOT_UNAVAILABLE_PROPOSAL(40051)
Name Value
exception com.genesyslab.gsg.services.callback.CallbackExceptionAvailability
Name Value
code 50020
phrase BAD_CONFIGURATION
Name Value
exception com.genesyslab.gsg.services.callback.CallbackExceptionConfiguration
Name Value
code 50005
phrase CALENDAR_ERROR
exception com.genesyslab.gsg.services.callback.CallbackExceptionCalendarError
properties
Name Value
code 50004
phrase CAPACITY_ERROR
exception com.genesyslab.gsg.services.callback.CallbackExceptionCapacityError
properties
Name Value
code 50030
phrase ORS_ERROR
exception com.genesyslab.gsg.services.callback.CallbackExceptionFromORS
properties
Name Value
code 50040
Name Value
phrase SERVICE_REDIRECT_FAILED
exception com.genesyslab.gsg.services.callback.CallbackExceptionServiceRedirect
properties
Name Value
code 40040
phrase NUMBER_REJECTED
exception com.genesyslab.gsg.services.callback.CallbackExceptionNumber
properties
Name Value
Name Value
code 50050
phrase UNKNOWN_ERROR
exception com.genesyslab.gsg.services.callback.CallbackExceptionUnknown
Example
POST http://localhost:8080/genesys/1/service/callback/request-callback
{
"_customer_number": "5115",
"usr_customer_name": "Bob Markel",
"usr_reason": "billing question",
"_device_notification_id":
"b16416334828b1d26ef14f329628b55b5a8c631d8928a371a5584722dd7fb673",
"_device_os": "comet",
"_desired_time":"2013-06-17T10:25:00.000Z"
}
Result
200 OK
{
"_id":"a550a12e-ca77-4146-98d0-58960e0939f7"
}
The result of this operation is different if the callback is immediate or schedule. If immediate, some
information may be returned in response along with service_id.
200 OK
{
"ID": "0",
"Action": "ConfirmationDialog",
"Text": "You will receive the call shortly",
"OkTitle": "Ok",
"_id": "361-58ce803e-362c-477f-8ac8-5bbc93f9acc7"
}
Cancel-Callback
The Cancel-Callback API cancels a Callback request, by doing the following:
DELETE /genesys/1/service/callback/{callback-execution-
name}/{service_id}
Cancels a Callback request
URI Parameters
Name Type Description
Responses
200 OK
No JSON Body
Name Value
code 40010
phrase BAD_PARAMETER
Name Value
exception com.genesyslab.gsg.services.callback.CallbackExceptionBadParameter
Name Value
code 40020
phrase INVALID_OPERATION
Name Value
exception com.genesyslab.gsg.services.callback.CallbackExceptionInvalidOperation
Name Value
code 40030
phrase CALLBACK_NOT_FOUND
exception com.genesyslab.gsg.services.callback.CallbackExceptionNotFound
Name Value
code 50030
phrase ORS_ERROR
exception com.genesyslab.gsg.services.callback.CallbackExceptionFromORS
properties
Name Value
code 50050
phrase UNKNOWN_ERROR
exception com.genesyslab.gsg.services.callback.CallbackExceptionUnknown
Examples
DELETE http://localhost:8080/genesys/1/service/callback/BasicCallback/a550a12e-
ca77-4146-98d0-58960e0939f7
Result 200 OK
DELETE http://localhost:8080/genesys/1/service/callback/BasicCallback/a550a12e-
ca77-4146-98d0-58960e0939f7
DELETE http://localhost:8080/genesys/1/service/callback/callback-test/361-cf088d4e-88ab-452c-
ac1f-39086cc96cbe
Result 400 Bad Request
{
"message": "Request already cancelled or completed : [361-cf088d4e-88ab-452c-
ac1f-39086cc96cbe]",
"exception":
"com.genesyslab.gsg.services.callback.exceptions.CallbackExceptionInvalidOperation"
}
If you set discard_ors_failure=true, the previous query will get a 200 OK response, though the
error will be logged as an error in ORS.
DELETE http://localhost:8080/genesys/1/service/callback/callback-test/61-cf088d4e-88ab-452c-
ac1f-39086cc96cbe?discard_ors_failure=true
Result 200 OK
Reschedule-Callback
The Reschedule-Callback API changes various input parameters associated with a given callback
service. This request will have the Callback request id that is to be updated. This API does the
following:
Note: The Reschedule operation is available only for requests where _callback_state=SCHEDULED.
PUT /genesys/1/service/callback/{callback-execution-name}/{service_id}
Reschedules a Callback request
Header
application/json
multipart/form-data
Content-type
application/x-www-form-urlencoded
URI Parameters
Name Type Description
Properties to be updated in
<other properties> any
request.
Responses
200 OK
No JSON Body
Name Value
code 40010
phrase BAD_PARAMETER
Name Value
epoch %ds"
• "Cannot create service, missing mandatory
callback option {option}"
• "Cannot create service, empty mandatory
callback option {option}"
• Generic parser exception message: Typically, a
bad date parsing may fall there as a bad
parameter error with the appropriate
statement.
• Generic missing parameter exception message
(case of controller level detection).
exception com.genesyslab.gsg.services.callback.CallbackExceptionBadParameter
Name Value
code 40020
phrase INVALID_OPERATION
Name Value
exception com.genesyslab.gsg.services.callback.CallbackExceptionInvalidOperation
Name Value
code 40030
phrase CALLBACK_NOT_FOUND
exception com.genesyslab.gsg.services.callback.CallbackExceptionNotFound
Name Value
• SLOT_UNAVAILABLE (40050)
phrase
• SLOT_UNAVAILABLE_PROPOSAL(40051)
exception com.genesyslab.gsg.services.callback.CallbackExceptionAvailability
Name Value
code 50020
phrase BAD_CONFIGURATION
Name Value
exception com.genesyslab.gsg.services.callback.CallbackExceptionConfiguration
Name Value
code 50005
Name Value
phrase CALENDAR_ERROR
exception com.genesyslab.gsg.services.callback.CallbackExceptionCalendarError
properties
Name Value
code 50004
phrase CAPACITY_ERROR
exception com.genesyslab.gsg.services.callback.CallbackExceptionCapacityError
properties
Name Value
code 50030
phrase ORS_ERROR
exception com.genesyslab.gsg.services.callback.CallbackExceptionFromORS
Name Value
properties
Name Value
code 40040
phrase NUMBER_REJECTED
exception com.genesyslab.gsg.services.callback.CallbackExceptionNumber
properties
Name Value
code 50050
phrase UNKNOWN_ERROR
Name Value
exception com.genesyslab.gsg.services.callback.CallbackExceptionUnknown
Examples
Successful Rescheduling
PUT http://localhost:8080/genesys/1/service/callback/
BasicCallback/a550a12e-ca77-4146-98d0-58960e0939f7
{
"_new_desired_time":"2013-05-27T15:05:00.000Z"
}
Result
200 OK
Failed Rescheduling
PUT http://localhost:8080/genesys/1/service/callback
/callback-test/361-d61e636da-3109-436c-877e-8d7174277bb9
{
"_new_desired_time":"2014-07-22T10:00:00.000Z"
}
Result
400 Bad Request
{
"message": "Callback '361-738dadcb-9d20-4557-8e24-fddb82f9c1b8'
is no longer scheduled. State=PROCESSING",
"exception": "com.genesyslab.gsg.services.callback.exceptions
.CallbackExceptionInvalidOperation"
}
No availability
PUT http://localhost:8080/genesys/1/service
/callback/BasicCallback/a550a12e-ca77-4146-98d0-58960e0939f7
{
"_new_desired_time":"2013-05-27T16:45:00.000Z"
}
Result
400 Bad Request
{
"message": "Too many requests at desired time
[2013-05-27T16:45:00.000Z, 2013-05-27T16:50:00.000Z].
Proposing time slots.",
"exception": "com.genesyslab.gsg.services.callback
.CallbackExceptionAvailability",
"availability":
{
"2013-05-27T16:50:00.000Z": 5,
"2013-05-27T16:35:00.000Z": 5,
"2013-05-27T16:40:00.000Z": 5,
"2013-05-27T16:55:00.000Z": 3,
"2013-05-27T16:25:00.000Z": 5,
"2013-05-27T16:30:00.000Z": 5
}
}
PUT http://localhost:8080/genesys/1/service/callback
/callback-test/361-738dadcb-9d20-4557-8e24-fddb82f9c1b8
{
"_callback_state":"PROCESSING",
"_reason":""
}
Result
200 OK
{}
Introduced in 8.5.201
Deletes one or more Callback Service instance(s) by passing service IDs or Customer Numbers. You
can delete a Callback only if it is in SCHEDULED or COMPLETED status. This API enables you to support
General Data Protection Regulation and enables you to "forget" customers.
To use this query, you need Basic Authentication. Therefore, you must provide the authentication
credentials in the auth parameter of the operation. There are two ways to provide credentials in an
auth object:
• In an open form containing the username and password fields of a user defined in the Configuration
Server.
• In an encoded form using encoded fields, similar to the Basic Authentication header, which is a
Base64-encoded composite string of "username:password".
POST /genesys/1/admin/callback/ops/delete
Deletes one or more callback request(s).
Header
application/json
Content-type
Responses
Name Description
200 OK
Response Body (JSON content)
Array of service IDs and
Customer Numbers that were
deleted or were considered as
successful with a reason.
success
[{ "_id": "68542134" },
required Array
{ "reason": "no
callback(s) to delete",
"_customer_number":
"132456" } ]
Name Value
code 50020
phrase BAD_CONFIGURATION
Name Value
exception com.genesyslab.gsg.services.callback.CallbackExceptionConfiguration
Name Value
code 40010
phrase BAD_PARAMETER
Name Value
exception com.genesyslab.gsg.services.callback.CallbackExceptionBadParameter
Name Value
code 40020
phrase INVALID_OPERATION
exception com.genesyslab.gsg.services.callback.CallbackExceptionInvalidOperation
Name Value
"state": <callback state>,
Name Value
code 50050
phrase UNKNOWN_ERROR
exception com.genesyslab.gsg.services.callback.CallbackExceptionUnknown
Example
POST http://localhost:8080/genesys/1/admin/callback/ops/delete
{
"_id": ["118-576b21b4-a235-4ba5-92d4-102cbbb54bca"],
"_customer_number": [
"132456",
"1111",
"3333"
]
}
Result
Response: 200 OK
{
"success": [
{
"reason": "no callback(s) to delete",
"_customer_number": "132456"
},
{
"_id": "118-27f3bed5-6e3a-4c89-903f-dae562b30481"
},
{
"_id": "118-c2ce7a84-d33a-4d8d-88a0-b76a563f2324"
}
],
"errors": [
{
"code": 40020,
"phrase": "INVALID_OPERATION",
"_id": "118-576b21b4-a235-4ba5-92d4-102cbbb54bca",
"message": "Callback 118-576b21b4-a235-4ba5-92d4-102cbbb54bca cannot
be deleted - _callback_state=PROCESSING"
}
]
}
Query Callback By ID
Introduced in 8.5.207
Retrieves a callback request by its ID.
GET /genesys/2/service/callback/{callback-execution-name}/{id}
Queries the outstanding callback associated with a given ID.
URI Parameters
Name Type Description
Responses
Name Description
200 OK
Response Body (JSON content)
Name Description
Name Value
code 40010
phrase BAD_PARAMETER
exception com.genesyslab.gsg.services.callback.CallbackExceptionBadParameter
Name Value
code 40020
phrase INVALID_OPERATION
exception com.genesyslab.gsg.services.callback.CallbackExceptionInvalidOperation
Name Value
code 50050
phrase UNKNOWN_ERROR
exception com.genesyslab.gsg.services.callback.CallbackExceptionUnknown
Example
GET http://localhost:8080/genesys/1/service/callback/BasicCallback/120-07f85068-650d-4cce-
a5e7-396dfa22455b
Result
200 OK
{
"_callback_state": "SCHEDULED",
"_expiration_time": "2020-05-11T11:59:59.000Z",
"_service_name": "BasicCallback",
"_id": "124-07f85068-650d-4cce-a5e7-396dfa22455f",
"_customer_number": "12345",
"_url": "/genesys/1/service/callback/BasicCallback/120-07f85068-650d-4cce-
a5e7-396dfa22455b",
"_time_scheduled": "2020-04-16T12:52:31.521Z",
"_desired_time": "2020-04-27T12:00:00.000Z"
}
The Query-Callback API queries the current set of outstanding Callback services associated with a given property.
Notes:
• Outstanding Callback services are requests where _callback_state is one of the following values: SCHEDULED, QUEUED, ROUTING, PROCESSING,
COMPLETED.
• Properties allowing the Callback request trackback are defined as comma-separated keys with the service option _customer_lookup_keys.
• The API returns each callback for which the looked-up property is or was equal to the value specified in the requested property.
• Starting in 8.5.111, you can configure the list of values to be retrieved when calling this query by setting the returned-keys option at the GMS application
level.
• To use the _customer_number lookup property regardless of whether you specify a callback service name or not in the API URL, the
_fix_plus_on_int_phone_numbers option must be identical in the callback section and in each service-specific section.
• This is the expected behavior if you stick to defaults.
• If a callback service has a distinct value for _fix_plus_on_int_phone_numbers, you can only use the _customer_number lookup property by specifying
the service name in the API URL.
GET /genesys/1/service/callback/{callback-execution-name}?{property=value}
GET /genesys/1/service/callback?{property=value}
Queries the current set of outstanding Callback services associated with a given property.
URI Parameters
Name Type Description
string Name of the callback execution service of 'ors'
callback-execution-name path type provisioned in GMS.
• _callback_state='COMPLETED' filters
callbacks and returns only callbacks in
COMPLETED state.
Important
The character "!" is used to negate a case.
Responses
200 OK
Response Body (JSON content)
{
"_id": <callback id>,
"desired_time": <ISO UTC time>,
"_callback_state": <callback
state>,
<none> "_expiration_time":<ISO UTC time>,
"_customer_number": <customer
number>,
"url": <service URL>
},
...
Name Value
code 40010
phrase BAD_PARAMETER
message • Generic parser exception message: Typically, a bad date parsing may
result in a bad parameter error with the appropriate statement.
• Generic missing parameter exception message (case of controller level
detection).
exception com.genesyslab.gsg.services.callback.CallbackExceptionBadParameter
Name Value
code 40020
phrase INVALID_OPERATION
exception com.genesyslab.gsg.services.callback.CallbackExceptionInvalidOperation
Name Value
code 50050
phrase UNKNOWN_ERROR
exception com.genesyslab.gsg.services.callback.CallbackExceptionUnknown
Example
GET http://localhost:8080/genesys/1/service/callback
/BasicCallback?_customer_number=555-5461206
Result
200 OK
[
{
"_id": "a550a12e-ca77-4146-98d0-58960e0939f7",
"desired_time": "2013-05-27T15:05:00.000Z",
"_callback_state": "QUEUED",
"_expiration_time": "2014-11-03T18:36:45.000Z",
"_customer_number": "555-5461206",
"url": "/1/service/callback/BasicCallback/a550a12e-ca77-4146-98d0-58960e0939f7"
},
{
"_id": "4a1ea889-1ef7-432d-a543-cff96b4a2daf",
"desired_time": "2013-05-27T15:10:00.000Z",
"_callback_state": "SCHEDULED",
"_expiration_time": "2014-11-03T18:36:45.000Z",
"_customer_number": "555-5461206",
"url": "/1/service/callback/BasicCallback/4a1ea889-1ef7-432d-a543-cff96b4a2daf"
}
]
Query-Availability
v1
Query-Availability v1
This query returns a simple map of slots in which the office capacity is not full.
GET /genesys/1/service/callback/{callback-execution-name}/availability
Returns a simple map of slots in which the office capacity is not full.
URI Parameters
Name Type Description
Important
If neither of the parameters number-of-days and end parameters are specified, the
default time range matches 1 bucket only (as configured in the _request_time_bucket
service option).
Request example:
GET http://localhost:8080/genesys/1/service/callback/Callback_VQ/
availability?start=2014-12-03T15:00:00.000Z
Response
The Callback controller provides a facet to the availability service, which uses the calendar service
underneath. Just as the calendar service takes three non-mandatory input parameters (start, number-
of-days, end), the availability service should accept the same parameters and pass them on to the
calendar service.
200 OK
{
// All periods are ordered in ascending time order
"2014-10-17T13:00:00.000Z":"5",
"2014-10-17T13:10:00.000Z":"4",
// there were no agents available between 13:20 and 13:30 UTC
//hence the time slot is not reported
"2014-10-17T13:30:00.000Z":"5"
}
v2
Query-Availability v2
This query includes more query options than v1 and returns an array of ordered slots that include
detailed capacity information and timezone information.
GET /genesys/2/service/callback/{callback-execution-name}/availability
Returns an array of ordered slots that include detailed capacity information and timezone
information.
URI Parameters
Important
If neither of the parameters number-of-days, end, and end-ms parameters are
specified, the default time range matches 1 bucket only (as configured in the
_request_time_bucket service option).
Responses
If successful, the response returns multiple values that describe the slots, availability, and capacity
for a given slot.
200 OK
Response Body (JSON content)
{
"slots": [
{
"utcTime": <UTC time>,
"localTime": <UTC
time>,
"capacity": <capacity>,
"total": <total>
},
(...) ]
"durationMin": <duration
in minutes>,
"timezone": <timezone>
}
Name Value
code 40010
Name Value
phrase BAD_PARAMETER
exception com.genesyslab.gsg.services.callback.CallbackExceptionBadParameter
Name Value
• SLOT_UNAVAILABLE (40050)
phrase
• SLOT_UNAVAILABLE_PROPOSAL(40051)
Name Value
exception com.genesyslab.gsg.services.callback.CallbackExceptionAvailability
Name Value
code 50020
phrase BAD_CONFIGURATION
• "Option service.{service} /
_business_hours_service not configured."
• "Option _business_hours_service is invalid:
{message}"
• "Service undefined: {service}"
message
• "Service {service} has unknown value for
option _type"
• "Service {service} has option _type != ors"
• "Service {service} has option _service !=
callback"
exception com.genesyslab.gsg.services.callback.CallbackExceptionConfiguration
{
properties
"service": <service name>
Name Value
}
Name Value
code 50005
phrase CALENDAR_ERROR
exception com.genesyslab.gsg.services.callback.CallbackExceptionCalendarError
properties
Name Value
code 50004
phrase CAPACITY_ERROR
exception com.genesyslab.gsg.services.callback.CallbackExceptionCapacityError
properties
Name Value
code 50050
phrase UNKNOWN_ERROR
exception com.genesyslab.gsg.services.callback.CallbackExceptionUnknown
Examples
Request example:
http://localhost:8010/genesys/2/service/callback/callback-PST
/availability?start=2016-04-13T09:00:00.000&end=2016-04-13T16:00:00.000
&timezone=America/Toronto
{
"slots": [
{
"utcTime": "2016-04-13T13:00:00.000Z",
"localTime": "2016-04-13T09:00:00.000",
"capacity": 42,
"total": 100
},
{
"utcTime": "2016-04-13T13:05:00.000Z",
"localTime": "2016-04-13T09:05:00.000",
"capacity": 67,
"total": 100
},
{
"utcTime": "2016-04-13T13:10:00.000Z",
"localTime": "2016-04-13T09:10:00.000",
"capacity": 91,
"total": 100
}
...
],
"durationMin": 5,
"timezone": "Eastern Standard Time"
}
Important
Existing calendar configurations must be updated for the time zone definition. Instead
of EST or PST time zones that were configured using Configuration Manager, you must
use time zones as allowed in Java (http://en.wikipedia.org/wiki/
List_of_tz_database_time_zones), such as America/Toronto, or Europe/Paris. You
must also change the service option _type from ors to builtin.
Query-Callback by Queue(s)
Modified in 8.5.111
The Query-Callback API queries the current set of outstanding Callback services in the given
queue(s).
Starting in 8.5.111, you can filter and configure the list of values to be passed and retrieved when
calling this query through the following options at the GMS application level: returned-keys and filter-
keys.
Important
Outstanding Callback services are requested if their _callback_state is one of the
following values: SCHEDULED, QUEUED, ROUTING, PROCESSING, COMPLETED.
To use this query, you need Basic Authentication. Therefore, you must provide the authentication
credentials in the auth parameter of the operation. There are two ways to provide credentials in an
auth object:
• In an open form containing the username and password fields of a user defined in the Configuration
Server.
• In an encoded form using encoded fields, similar to the Basic Authentication header, which is a
Base64-encoded composite string of "username:password".
GET /genesys/1/admin/callback/queues?target={callback-execution-
name}☆t_time={iso_start_time}&end_time={iso_end_time}
Queries the current set of outstanding Callback services in given queue(s).
URI Parameters
Name Type Description
{iso_start_time} string This is the minimum time for
For example:
"2013-05-27T15:30:00.000Z"
For example:
"2013-05-28T15:30:00.000Z"
Responses
200 OK
Response Body (JSON content)
<Queue name>: {
"_customer_number":
<customer number>,
"_desired_time": <callback
UTC desired time>,
"url": <request>
Name Value
code 40020
phrase INVALID_OPERATION
"Query range spans too wide time range (%d / %d). Adjust
message query parameters for time range."
exception com.genesyslab.gsg.services.callback.CallbackExceptionInvalidOperation
Name Value
code 50050
phrase UNKNOWN_ERROR
exception com.genesyslab.gsg.services.callback.CallbackExceptionUnknown
Example
GET http://localhost:8080/genesys/1/admin/callback/queues
Result
200 OK
{
"BasicCallback":
[
{
"_customer_number": "654321",
"_callback_state": "PROCESSING",
"_desired_time": "2013-06-07T16:25:00.000Z",
"_id": "fd30abb97bd04885b544893276fb534b",
"url": "/1/service/callback/BasicCallback/fd30abb97bd04885b544893276fb534b"
}
],
"AdvancedCallback":
[
{
"_customer_number": "654321",
"_callback_state": "QUEUED",
"_desired_time": "2013-06-07T16:35:00.000Z",
"_id": "07d2ddd506f04b4ba91aba59c4fa8871",
"url": "/1/service/callback/AdvancedCallback/07d2ddd506f04b4ba91aba59c4fa8871"
},
{
"_customer_number": "654321",
"_callback_state": "SCHEDULED",
"_desired_time": "2013-06-07T16:45:00.000Z",
"_id": "8f68d4969d904d039ccf0101fac39283",
"url": "/1/service/callback/AdvancedCallback/8f68d4969d904d039ccf0101fac39283"
}
]
}
To use this query, you need Basic Authentication. Therefore, you must provide the authentication
credentials in the auth parameter of the operation. There are two ways to provide credentials in an
auth object:
• In an open form containing the username and password fields of a user defined in the Configuration
Server.
• In an encoded form using encoded fields, similar to the Basic Authentication header, which is a
Base64-encoded composite string of "username:password".
Important
You can use this API to ensure that you do not book more Callbacks than you have
licenses for.
GET /genesys/1/admin/callback/watermarks?service_name={callback-
execution-name}
GET /genesys/1/admin/callback/watermarks
Counts the current set of executed callback instances per queues or for a given queue.
URI Parameters
Name Type Description
Name of a callback execution
service. If you set this parameter,
the response will return the
{callback-execution-name} string
watermarks for the specified
service only. If the service name
is not set, the response returns
GET /genesys/1/admin/
callback/
watermarks?service_name=service1&service_nam
Responses
Name Value
code 50050
phrase UNKNOWN_ERROR
exception com.genesyslab.gsg.services.callback.CallbackExceptionUnknown
Example
Operation
GET http://localhost:8080/genesys/1/admin/callback/watermarks
Result
200 OK
{
"total": 1,
"services": {
"callback-immediate": 0,
"callback-test": 1
}
}
GET http://localhost:8080/genesys/1/admin/callback/watermarks?service_name=callback-immediate
Result
200 OK
{
"total": 0,
"services": {
"callback-immediate": 0
}
}
POST /genesys/1/service/{callback-service-id}/check-queue-position
BODY Parameters
{callback-service-id} ID of the callback execution
required string service. For example,
445-f4fa53ec-8e93-4836-ba35-f0bd74a025a8.
Important
The GET method is also supported for this feature.
Response
Errors
Name Value
code 50050
phrase UNKNOWN_ERROR
exception com.genesyslab.gsg.services.callback.CallbackExceptionUnknown
Example
Operation
Response:
200 OK
{
"app_version":"v2.41",
"wt":26,
"connid":"006e02aea54bc008",
"ewt":0,
"positioninqueue":0,
"_position":1,
"_eta":0,
"_total_waiting":1,
"priority":500,
"agents_logged_in":3,
"ors_session_id":"00ACLU5N00CV19601K015B5AES000003",
"ewt_at_offer":0,
"pos_at_offer":0,
"callback_type":"WAIT_FOR_AGENT",
"time_callback_accepted":1508959666,
"channel":"WEB",
"skill_expression":"GMSCallbackAgents@stat.GA",
"ewt_at_first_dial":"100.0",
"pos_at_first_dial":"1",
"time_at_first_dial":1508959684,
"dial_attempt":1,
"is_snoozed":false,
"dial_result":"PERSON",
"time_customer_connected":1508959690
}
By default, the CSV report includes the following default properties: _desired_time, _service_name,
_customer_number, urs_virtual_queue, _vq_for_outbound_calls, and target.
To use this query, you need Basic Authentication. Therefore, you must provide the authentication
credentials in the auth parameter of the operation. There are two ways to provide credentials in an
auth object:
• In an open form containing the username and password fields of a user defined in the Configuration
Server.
• In an encoded form using encoded fields, similar to the Basic Authentication header, which is a
Base64-encoded composite string of "username:password".
POST /genesys/1/admin/callback/reportcancelled
BODY Parameters
callback_reason The reason for the cancellation.
required' string For example,
CANCELLED_BY_ADMIN.
exported_properties string List of properties to export for
Response
<record-1-property1>,<record-1-property2>,...,<record-1-pro
Response Body (JSON content)
...
<record-n-property1>,<record-n-
property2>,...,<record-n-propertyn>
Errors
Name Value
code 50050
phrase UNKNOWN_ERROR
exception com.genesyslab.gsg.services.callback.CallbackExceptionUnknown
Name Value
Example
Operation
POST /genesys/1/admin/callback/reportcancelled
{
"callback_reason": "CANCELLED_BY_ADMIN",
"exported_properties": []
}'
Response:
Access-Control-Allow-Credentials →true
Access-Control-Allow-Origin →chrome-extension://aicmkgpgakddgnaphhhpliifpcfhicfo
Access-Control-Expose-Headers →
Content-Disposition →attachment; filename="report.csv"
_desired_time,_service_name,_customer_number,_target,_vq_for_outbound_calls,_urs_virtual_queue
2017-07-04T22:00:00.000Z,callback-
gms,5115,Billing@Stat_Server.GA,GMS_Callback_VQ_OUT,GMS_Callback_VQ
Operation
POST /genesys/1/admin/callback/reportcancelled
HTTP/1.1
Connection: keep-alive
Content-Type: application/json
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/
50.0.2661.102 Safari/537.36
Cookie: JSESSIONID=1ff4o2zwehsbx6fzdfwb66jsa
Authentication: Basic=....
{
"callback_reason": "CANCELLED_BY_ADMIN",
"exported_properties": ["_service_id,_desired_time"]
}
Response
desired_time,customer_number,exported_properties1,exported_properties2
2017-05-11T12:22:00+00:00,3329284556,exported_value1,exported_value2
2017-05-11T12:21:00+00:00,3329284576,exported_value1,exported_value2
2017-05-10T07:21:00+00:00,3329284577,exported_value1,exported_value2
to your Callback application, you need to configure Preview and Disposition options in your Callback
service. After you do this, your Custom Agent Application will receive the following UserEvent events
from Orchestration Server:
• CallbackInvitationEvent—The Callback invitation that contains the attached data for the preview.
The invitation includes the list of actions that the agent can perform–accept, reject, or cancel. Your
Agent application displays the actions and the attached data for the preview to the agent, then submits
a Preview Response to your Callback service.
• CallbackDispositionEvent—The Callback disposition event that provides the URL to which you submit
the disposition selected by the agent. Your Agent application then submits a Disposition Response to
your Callback service through this URL.