cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3918
Views
11
Helpful
6
Replies

UCCX Script download from Rest API

I have been facing the issue When I download the script from the rest api

I am doing this "http://uccx-server/adminapi/script/download/mum.aef" and I have been getting this response from the server.

<apiErrors>
<apiError>
<errorData>ServerError</errorData>
<errorMessage>Missing domain: pathname mum.aef</errorMessage>
<errorType/>
</apiError>
</apiErrors>
The file is existed in the root path. Even if I tired to download sub aef file facing the same issues.
6 Replies 6

julien.laffitte
Level 1
Level 1

I have a similar problem: using a PowerShell function, I am able to download prompts from the UCCx server but it does not work when it comes to:

  • Documents,
  • Scripts.

The function is global, e.g. I only pass the download type as a parameter ("prompt" or "script" or "document") so I am sure my URIs comply with the CCX dev guide.

If I try to download a document through a browser:

http://server_IP/adminapi/document/download/fr_FR/Printemps/FILE.xml

I get an HTTP 404 Not Found Error even though I can see the file in this folder.

If I try to download a script through a browser:

http://server_IP/adminapi/script/download/Site/Service.aef

I get an HTTP 500 Internal Server Error even though I can see the script in this folder.

Any idea?


Edit: If I collect a trace of the request / response, I can see that the UCCx server is sending the following error for a script:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<apiErrors>

<apiError>

<errorData>Internal Server Error</errorData>

<errorMessage>The server encountered an unexpected condition which prevented it from fulfilling the request</errorMessage>

<errorType>500</errorType>

</apiError>

</apiErrors>

And for a document:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<apiErrors>

<apiError>

<errorData>Not Found</errorData>

<errorMessage>Specified Resource does not exist</errorMessage>

<errorType>InstanceNotFound</errorType>

</apiError>

</apiErrors>

Ok so after many tests I was able to successfully download a script.

From what I can tell, the URL needs somehow to be different from a prompt download even if the developers guide tells the contrary:

  • The "default" keyword in the developers guide URL MUST be written even though it is not the case for a prompt download.
  • The keyword MUST be preceded by a double slash: "//"
  • The path to the file has to be added after the keyword.

So for example if I want to download the Service.aef script mentioned above, the URL must be:

http://server_IP/adminapi/script/download//default/Site/Service.aef

Instead of:

http://server_IP/adminapi/script/download/Site/Service.aef

I think the developers guide needs to be updated to reflect this.

As for a document download, unfortunately it seems to be unavailable using the REST API.

Any comment appreciated on this!

Thanks very much for your post.  It was the only way I could download script files.
Question did you try downloading document files?  I tried several methods and could download them.

As a matter of fact I tried again a few month ago on a 11.x version, but unfortunately it still did not work.

However now the Configuration API Developer Guide now lists a GET method for Documents:

 

Get Document Files and Folder 

 

So I suppose It can be achieved, but I haven't deployed any CUCM 12.x yet to test this.

unbelievable, but works. Many Thanks.

Thanks Maic, I'm glad the post could help someone.

But from your post I conclude that the documentation has not been updated and is still misleading people, its a shame...