cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1178
Views
10
Helpful
10
Replies

Cisco UCCX - API Refresh document after upload

JeromeA_23
Level 1
Level 1

Hello,
I'm facing an issue by trying to fully automate our XML Document updates and I hope I can find help here.

 

I'm giving the ability to our CSC Managers to update all data related to call center activity (store hours for example) thanks to homemade Excel API tool.

XML files are manipulated and upload using Excel VBA and API Calls. However, after each XML Document upload, we need to manually click on the refresh button to get those information up to date / usable within our scripts.

 

I know there were some bugs in refreshing scripts with UCCX, that seem to be solved in our version (CSCvj83336).

I tried an API Call on the document but it says  (screenshot attached)

Refresh operation is allowed only for script

I also have a refresh parameter in the API Call to move the document from Temp to final Folder (code example attached)

 

Any solution or workaround to achieve a refresh automatically without manually going through the admin page.

 

Thanks for your help,

10 Replies 10

Graham Old
Level 7
Level 7

I have uploaded documents to CCX using the API and no refresh was required.

It looks like I had to use a 3 step process

Step 1 upload files to a temporary folder for document as a multipart

Step 2 delete the original document

Step 3 store files in database from a temporary folder for Document.

 

What CCX version are you using and what API calls are you using?

Graham

Hello Graham

Thanks for your reply. Our current version is 11.6.2.10000-38

What you describe is exactly the steps my API Script follows:

1. Delete the existing file

2. Upload the file to temp folder

3. Move the file from temp to target folder (this is where Cisco offers the refresh parameter)

 

Once uploaded, if I click on the script from the admin web page I see the new file, but in the application itself it keeps using the old file since the last refresh (same when you replace an XML file => you need to hit refresh to have ccx engine considering this new version).

 

In your case, do you do the API Calls from UCCX script using REST Call, or out of the box ?

I am doing the upload from a Visual Studio project using the CCX API.

If you are deleting the file and uploading then your new XML file must be in the repository.

If you upload a new Document using the web page you don't need to refresh the script to pick up that new Document.

How are you loading the XML in your script?

Capture.PNG

Graham

As a matter of fact, the file is in the repository and show correct values (can be seen updated from appadmin webpage for example)

The updates on XML File are not taken into account by the script in production as it requires the document to be refreshed. Same way if I was uploading manually an XML file directly from appadmin page, I always had to do a refresh of the document (not the script) to have ccx engine to take it into account.

 

In the script I do the same way to load my XML File, attached for example.

 

Anthony Holloway
Cisco Employee
Cisco Employee
Have you considered not pushing the file into UCCX? I mean, if it already exists in location 1, why copy it to location 2? Just have UCCX access the file at location 1. Then, no API, no refresh, and always current.

E.g.,
Set my_xml_file = URL[https://someserverinmyorg/somepathonmyserver/somefileineed.xml]
xml = Create XML Document (my_xml_file)

Unfortunately, the file doesn't exist anywhere. We execute an Excel macro file who pull the XML file into an excel table then we push it back from excel table translated to a XML format and uploaded to UCCX. Everything is performed by the excel VBA code.
It would still be a workaround possibility though, but we tend to avoid any external system for operational reasons (costs, complexity to maintain and troubleshoot, documentation etc).
I'm still surprised that the API request doesn't include document refresh. Either i'm doing it wrong, or this UCCX version is hitting a bug on this request.
Thanks for your help

Something hit my mind after what you said.

I have another script to manage call center status (open/close basically), the script update an XML File by itself and I dont need to refresh the XML Doc in this case.

 

I'll think about something to use an HTTP Application/script instead of API Call to update the XML File and see if it works with no refresh.

If you have other thoughts I'm still interested

When you upload via the web or the API it puts your document in the db_cra_repository, it copies it across to the other server using DB replication and then it copies the file from the database to the hard disk file system for the script to use.

We had an issue and I think it was 11.6.2 in we uploaded the new XML file to the CCX Pub using the API but it did not copy it down to the hard disk. If you looked at the web interface it was correct as that looked at the database, I looked in the database and the file was correct but when I looked on the hard drive the file was the previous version.

A reboot fixed the problem.

Graham

Thanks to you both, I checked again and again by doing manual tests with POSTMAN and there the refresh worked perfectly fine.

 

It make me review my entire VBA Code and I found the tiny mistake on the path name. I was setting en_us instead of en_US and the "refresh" appears to be case sensitive

image.png

The XML update works fine end to end now and fully managed from my VBA code.

 

I never thought about this particular API Call as it is the same one to move the document and refresh it.

The move was perfectly executed so not case sensitive but the refresh action was (and only this one)

 

Good to know, I'm a bit frustrated to have missed that but i'm glad now to have it functional

Thanks again, I really appreciate your help

 

Nicely done!
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: