Hi,
I am trying to write code to update attributes of a Queue using the "put_routing_queue" API. I am applying the below settings
- Queue Name
- Service Level
- Skill Evaluation Method
- ACW Settings
- On Hold Prompt (BETA enabled on this Org)
- Calling Party Number
When I use the API Explorer and manually feed in the Queue ID and the above settings, the API executes correctly and the Queue is updated. But when I use the SDK, I am getting an error in the invocation itself.
What I have done in the code as a summary
- Read all the Queue settings above from an input Excel sheet using Pandas and entered this into variables
- Obtained Client Credentials and instantiated the Routing API
- Instantiated the component objects to hold the settings - WritableDivision, AcwSettings, ServiceLevel, MediaSettings, OnHoldPrompt
- Instantiated a QueueMediaSettings Object and assigned the MediaSettings object to the attribute "call".
- Instantiated a QueueRequest object and assigned it the settings from variables (queue name, Skill Evaluation Method, calling party number) and objects (WritableDivision, AcwSettings, OnHoldPrompt, QueueMediaSettings)
- Wrote the below code to push the settings to the Queue object
try:
routing_api_response = routing_api_instance.put_routing_queue(queue_id, queue_update_request_body)
print("Queue name " + req_body_queue_name + " settings updated successfully")
except ApiException as e:
print("Queue update to " + req_body_queue_name + " failed due to API Exception" % e)
I am getting the below error
Traceback (most recent call last):
File "c:\Soumik Work\Code\update_Queue_Settings_Bulk.py", line 92, in <module>
routing_api_response = routing_api_instance.put_routing_queue(queue_id, queue_update_request_body)
File "C:\Users\609049066\AppData\Local\Programs\Python\Python310\lib\site-packages\PureCloudPlatformClientV2\apis\routing_api.py", line 10379, in put_routing_queue
response = self.api_client.call_api(resource_path, 'PUT',
File "C:\Users\609049066\AppData\Local\Programs\Python\Python310\lib\site-packages\PureCloudPlatformClientV2\api_client.py", line 530, in call_api
return self.__call_api(resource_path, method,
File "C:\Users\609049066\AppData\Local\Programs\Python\Python310\lib\site-packages\PureCloudPlatformClientV2\api_client.py", line 324, in __call_api
body = self.sanitize_for_serialization(body)
File "C:\Users\609049066\AppData\Local\Programs\Python\Python310\lib\site-packages\PureCloudPlatformClientV2\api_client.py", line 426, in sanitize_for_serialization
return {key: self.sanitize_for_serialization(val)
File "C:\Users\609049066\AppData\Local\Programs\Python\Python310\lib\site-packages\PureCloudPlatformClientV2\api_client.py", line 426, in <dictcomp>
return {key: self.sanitize_for_serialization(val)
File "C:\Users\609049066\AppData\Local\Programs\Python\Python310\lib\site-packages\PureCloudPlatformClientV2\api_client.py", line 426, in sanitize_for_serialization
return {key: self.sanitize_for_serialization(val)
File "C:\Users\609049066\AppData\Local\Programs\Python\Python310\lib\site-packages\PureCloudPlatformClientV2\api_client.py", line 426, in <dictcomp>
return {key: self.sanitize_for_serialization(val)
File "C:\Users\609049066\AppData\Local\Programs\Python\Python310\lib\site-packages\PureCloudPlatformClientV2\api_client.py", line 426, in sanitize_for_serialization
return {key: self.sanitize_for_serialization(val)
File "C:\Users\609049066\AppData\Local\Programs\Python\Python310\lib\site-packages\PureCloudPlatformClientV2\api_client.py", line 426, in <dictcomp>
return {key: self.sanitize_for_serialization(val)
File "C:\Users\609049066\AppData\Local\Programs\Python\Python310\lib\site-packages\PureCloudPlatformClientV2\api_client.py", line 423, in sanitize_for_serialization
for attr, _ in iteritems(obj.swagger_types)
AttributeError: 'numpy.int64' object has no attribute 'swagger_types'
What am I doing wrong? I've checked the Sample Code in the API Explorer as well as in SDK Documentation pages, and the invocation is exactly as it should be.