Hello Team - We are trying to update the queue parameters for the email section and want to update the auto-answer for email to "True", below is the python code, the code runs without an error, but still is not updating the auto-answer for email to true:-
import PureCloudPlatformClientV2
import logging
from PureCloudPlatformClientV2 import Script, QueueRequest
from PureCloudPlatformClientV2.rest import ApiException
from PureCloudPlatformClientV2.apis import routing_api, conversations_api
from PureCloudPlatformClientV2.models import Queue, MediaTranscription , predictor_models
from PureCloudPlatformClientV2.configuration import Configuration
from pprint import pprint
import openpyxl
region = PureCloudPlatformClientV2.PureCloudRegionHosts.us_east_2
PureCloudPlatformClientV2.configuration.host = region.get_api_host()
apiclient = PureCloudPlatformClientV2.api_client.ApiClient().get_client_credentials_token("80bc5d03","T8C_")
authApi = PureCloudPlatformClientV2.AuthorizationApi(apiclient)
Create an instance of the API class
api_instance = PureCloudPlatformClientV2.RoutingApi(apiclient)
Define the queue ID
queue_id = 'b543ed0b'
body = PureCloudPlatformClientV2.QueueRequest()
body.name = "Test_Email"
body.media_settings = PureCloudPlatformClientV2.MediaSettings()
body.media_settings.email = PureCloudPlatformClientV2.EmailMediaPolicy()
body.media_settings.email.enable_auto_answer = True
Create reference to flow
#queue_flow = PureCloudPlatformClientV2.DomainEntityRef()
#queue_flow.id = b04c"
#body.queue_flow = queue_flow
Create reference to prompt
#whisper_prompt = PureCloudPlatformClientV2.DomainEntityRef()
#whisper_prompt.id = "6ce3"
#body.whisper_prompt = whisper_prompt
#Update the Division
#division=PureCloudPlatformClientV2.Division()
#division.id="0a097f0c"
#body.division=division
Create scripts
#script1 = Script()
Set script properties (name, etc.) based on the library
#script1.name = "abcd"
#script1.id="c7bf"
Update queue with default script
#body.default_scripts = {
"CALL": script1 # Assuming "EMAIL" is the communication type for the script
#}
logging.debug("Request body: %s", body.to_dict()) # Log the request body
try:
# Update the queue
api_response = api_instance.put_routing_queue(queue_id, body)
print("Queue updated successfully!")
print(api_response)
except ApiException as e:
print("Exception when calling RoutingApi->put_routing_queue: %s\n" % e)
and here is a snippet of the output:-
Queue updated successfully!
{'acw_settings': {'timeout_ms': None, 'wrapup_prompt': 'OPTIONAL'},
'agent_owned_routing': None,
'auto_answer_only': False,
'bullseye': None,
'calling_party_name': None,
'calling_party_number': None,
'conditional_group_routing': None,
'created_by': 'ed352',
'date_created': datetime.datetime(2023, 10, 26, 15, 15, 6, 114000, tzinfo=tzutc()),
'date_modified': datetime.datetime(2024, 10, 4, 21, 46, 19, 655000, tzinfo=tzutc()),
'default_scripts': {},
'description': None,
'direct_routing': None,
'division': {'id': 'fc0c-02a64f',
'name': 'EFG',
'self_uri': '/api/v2/authorization/divisions/fc0c-02a64f'},
'email_in_queue_flow': None,
'enable_audio_monitoring': None,
'enable_manual_assignment': None,
'enable_transcription': None,
'id': 'b543ed0b',
'joined_member_count': 0,
'media_settings': {'call': {'alerting_timeout_seconds': 8,
'auto_answer_alert_tone_seconds': None,
'enable_auto_answer': None,
'manual_answer_alert_tone_seconds': None,
'service_level': {'duration_ms': 20000,
'percentage': 0.8},
'sub_type_settings': None},
'callback': {'alerting_timeout_seconds': 30,
'auto_answer_alert_tone_seconds': None,
'auto_dial_delay_seconds': 300,
'auto_end_delay_seconds': 300,
'enable_auto_answer': None,
'enable_auto_dial_and_end': False,
'manual_answer_alert_tone_seconds': None,
'service_level': {'duration_ms': 20000,
'percentage': 0.8},
'sub_type_settings': None},
'chat': {'alerting_timeout_seconds': 30,
'auto_answer_alert_tone_seconds': None,
'enable_auto_answer': None,
'manual_answer_alert_tone_seconds': None,
'service_level': {'duration_ms': 20000,
'percentage': 0.8},
'sub_type_settings': None},
'email': {'alerting_timeout_seconds': 300,
'auto_answer_alert_tone_seconds': None,
'enable_auto_answer': None,
'manual_answer_alert_tone_seconds': None,
'service_level': {'duration_ms': 86400000,
'percentage': 0.8},
'sub_type_settings': None},
'message': {'alerting_timeout_seconds': 30,
'auto_answer_alert_tone_seconds': None,
'enable_auto_answer': None,
'manual_answer_alert_tone_seconds': None,
'service_level': {'duration_ms': 20000,
'percentage': 0.8},
'sub_type_settings': None}},
'member_count': 0,
'member_groups': None,
'message_in_queue_flow': None,
'modified_by': 'b9bc',
'name': 'ACS_Dom_Claim_Email',
'on_hold_prompt': None,
'outbound_email_address': None,
'outbound_messaging_addresses': None,
'peer_id': None,
'queue_flow': None,
'routing_rules': None,
'scoring_method': 'TimestampAndPriority',
'self_uri': '/api/v2/routing/queues/b543',
'skill_evaluation_method': 'ALL',
'suppress_in_queue_call_recording': False,
'user_member_count': 0,
'whisper_prompt': None}