Digital Media Suite API Forums

« Back to Digital Signs API Forum

Add asset from url thorws error.

Combination View Flat View Tree View
Threads [ Previous | Next ]
I am trying to add an asset from url using the DMP API tester. Since that does not support the call. We use the html code to post the XML sample data given. But I am getting a bad request error as below.
<ns2:result>
<status>failure</status>
<code>Bad Request</code>
¿
<description>
Error while downloading content: http:%2F%2Fwww.yahoo.com%3B No route to host
</description>
</ns2:result>
 
Our use case is to publish url from which DMP will display.
 
Any help appreciated.
 
Thanks
- Sathish
=========html source==========
<pre id="line1"><html>
<body>
<form action="http://<DMM_HOST>:8080/xTAS-core/services/content/assets/" enctype="multipart/form-data" method="POST">
File to upload:
<input type="file" name="upload_file"/>
<br/>
data:
<textarea cols="40" rows="20" name="data"></textarea>
<br/>
<input type="submit" value="Upload"/>
</form>
</body>
</html></pre>
 
=========FORM DATA==========
<n1:asset xmlns:n1="http://www.cisco.com/dms/xml/ns/dsm/contentManagement">
<title>upload_by_url</title>
<fileName>http://www.yahoo.com</fileName>
<description>String</description>
<fileType>HTML</fileType>
<estimatedDuration>
<Hours>10</Hours>
<Minutes>2</Minutes>
<Seconds>2</Seconds>
</estimatedDuration>
<categoryIdList>
<id>14</id>
</categoryIdList>
<assetOwner>rosa</assetOwner>
<storageType>url</storageType>
<downloadurl>true</downloadurl>
</n1:asset>
 
 

RE: Add asset from url thorws error.
api signage signs dms api
Answer
12/21/10 3:25 PM as a reply to Sathish K S.

Error while downloading content: http:%2F%2Fwww.yahoo.com%3B No route to host

It seems like your form data has been url-encoded and then "//" and "/" were not recognized as URL parts.
Try setting "enctype" to "text/xml".

Or even better - try submitting your XML request with HTTPXMLRequest JavaScript object.
 

Our use case is to publish url from which DMP will display.
 

You should use
            <n1:dmpConfigure xmlns:n1="http://www.cisco.com/dms/xml/ns/dsm/dmpManagement">
                <dmpGroupIdList><id>28</id></dmpGroupIdList>
                <parameters><nvp><name>init.BROWSER_CMD</name><value>http://dmmxp.mskshow.cisco.com/expo/intro/Slide1.jpg</value></nvp>
                </parameters>
            </n1:dmpConfigure>
for DMP group to go to URL, or
"Go to application" call from our API.
 
What you almost achieved at your example, is for DMM to go to yahoo.com and try to download and save yahoo's frontpage as an asset for later use. This is not what you want to do with yahoo ;-)




Error while downloading content: http:%2F%2Fwww.yahoo.com%3B No route to host



It seems like your form data has been url-encoded and then "//" and "/" were not recognized as URL parts.
Try setting "enctype" to "text/xml".

Or even better - try submitting your XML request with HTTPXMLRequest JavaScript object.



Our use case is to publish url from which DMP will display.
 


You should use
            <n1:dmpConfigure xmlns:n1="http://www.cisco.com/dms/xml/ns/dsm/dmpManagement">
                <dmpGroupIdList><id>28</id></dmpGroupIdList>
                <parameters><nvp><name>init.BROWSER_CMD</name><value>http://dmmxp.mskshow.cisco.com/expo/intro/Slide1.jpg</value></nvp>
                </parameters>
            </n1:dmpConfigure>
for DMP group to go to URL, or
"Go to application" call from our API.
 
What you almost achieved at your example, is for DMM to go to yahoo.com and try to download and save yahoo's frontpage as an asset for later use. This is not what you want to do with yahoo ;-)

 
Hi Thanks for your reply. The add asset from url was the closest to getting my usecase to work. Hence was trying that. From the DMP API doc I would have never guessed I have to use the dmp configuration call to realize this.
Also could we download the xsd files governing the request response of the API. The guide has them in parts.
 
Thanks
- Sathish
 

The BEST way to point DMP to an URL is:
1 - Create "Go to URL" application in "Advanced tasks"
2 - use /xTAS-core/services/app/apps/ to know your application ID
3 - use /xTAS-core/services/dmpgroup/dmps/dmpgroup/{id}  to get your DMP ID
4 - use /xTAS-core/api/rest/application/{app_id}/dmp/{dmp_id}  to exec your application on your DMP
Please ensure that you pass the ¿<application/>¿ tag, if you do not pass it you will get a 404 Not Found exception.
 
There are no published xsd files currently.

The BEST way to point DMP to an URL is:
1 - Create "Go to URL" application in "Advanced tasks"
2 - use /xTAS-core/services/app/apps/ to know your application ID
3 - use /xTAS-core/services/dmpgroup/dmps/dmpgroup/{id}  to get your DMP ID
4 - use /xTAS-core/api/rest/application/{app_id}/dmp/{dmp_id}  to exec your application on your DMP
Please ensure that you pass the ¿<application/>¿ tag, if you do not pass it you will get a 404 Not Found exception.
 
There are no published xsd files currently.

 
Thank you Mikhail.