CUC Forums

« Back to CUPI Questions

415 - Unsupported Media Type Error on Pin Reset

Combination View Flat View Tree View
Threads [ Previous | Next ]
Showing 1 - 20 of 30 results.
of 2
I am new to REST and I am running into a problem when trying to PUT a request for a pin reset. If I use the same code I have developed with a GET the XML is returned. It seems that I am missing something with the formatting of my PUT request. Any assistance would be greatly appreciated.
 
<%
 dim XmlHttp
 dim PostURL
 dim ResponseXml
 dim sXML
 sXml="<?xml version=""1.0"" encoding=""UTF-8"" standalone=""yes""?>"
 sXml=sXml & "<Credential>"
 sXml=sXml & " <Credentials>44444</Credentials>"
 sXml=sXml & "</Credential>"
 PostURL="http://xx.xxx.xx.xx/vmrest/users/edb8da2b-74b4-43d4-9380-ef208f950dbd/credential/pin"
 
 Set XmlHttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
 XmlHttp.Open "PUT", PostUrl, false,  "cupiuser", "*******"
 XmlHttp.SetRequestHeader "Content-Type", "application/xml"
 XmlHttp.SetRequestHeader "Accept", "application/xml"
 XmlHttp.setOption(2) = 13056
 XmlHttp.send sXML
 ResponseXml = XmlHttp.ResponseText
 Response.ContentType = "application/xml"
 response.write responseXML
%>

I am no expert but mine is working with a CredentialType of 4, not 5. Haven't found in doc exactly what each means yet.

Ash

Ryan,

What do you mean by CredentialType? Did you pass this as a RequestHeader?

-Andy

This is what i meant. update your PUT xml payload.

sXml=sXml & "<Credential>"
sXml=sXml & " <Credentials>44444</Credentials>"
sXml=sXml & " <CredentialType>4</CredentialType>"
sXml=sXml & "</Credential>"

Hi ¿ this is what the credentialtype values mean:



3=Password

4=Pin



The XML is actually documented on the server itself. This URL will give you a list of the XML schema files:



https://<server>/vmrest/schema <https://%3cserver%3e/vmrest/schema>



Just go there and click on the one you are interested in, say Credential in this case, and you will get the XML Schema for it that includes comments describing the content.



~ Matt





From: Cisco Developer Community Forums [mailto:cdicuser@developer.cisco.com]
Sent: Wednesday, November 09, 2011 6:21 AM
To: cdicuser@developer.cisco.com
Subject: New Message from Ryan Ash in Cisco Unity Connection Provisioning Interface (CUPI) - CUPI Questions: RE: 415 - Unsupported Media Type Error on Pin Reset



Ryan Ash has created a new message in the forum "CUPI Questions":

--------------------------------------------------------------
I am no expert but mine is working with a CredentialType of 4, not 5. Haven't found in doc exactly what each means yet.

Ash
--
To respond to this post, please click the following link:

<http://developer.cisco.com/web/cupi/forums/-/message_boards/view_message/4728792>

or simply reply to this email.

The issue I am running into is Unsupported Media Type. I am wondering if I am missing something in the XML to post the PUT request?

I have tried this several different ways.

objXML.send "<Credential>" & _
"<UserObjectId>" & sUserObjectId & "</UserObjectId>" & _
"<CredentialType>4</CredentialType>" & _
"<Credentials>" & sPassword & "</Credentials>" & _
"<Locked>0</Locked>" & _
"</Credential>"

I use to get that, but have managed to fix it. I am without Laptop
until Friday, but can try and post something then.

Thanks



On 9 Nov 2011, at 07:16, "Cisco Developer Community Forums" <cdicuser@developer.cisco.com
> wrote:

> Andy Melick has created a new message in the forum "CUPI Questions":
>
> --------------------------------------------------------------
> The issue I am running into is Unsupported Media Type. I am
> wondering if I am missing something in the XML to post the PUT
> request?
>
> I have tried this several different ways.
>
> objXML.send "<Credential>" & _
> "<UserObjectId>" & sUserObjectId & "</UserObjectId>" & _
> "<CredentialType>4</CredentialType>" & _
> "<Credentials>" & sPassword & "</Credentials>" & _
> "<Locked>0</Locked>" & _
> "</Credential>"
> --
> To respond to this post, please click the following link:
>
> <http://developer.cisco.com/web/cupi/forums/-/message_boards/view_message/4728943
> >
>
> or simply reply to this email.

Registered No. 755780 England
Registered Office: FM Insurance Company Limited
1 Windsor Dials, Windsor,
Berkshire, UK, SL4 1RS
Regulated by the Financial Services Authority.
VAT No. G.B.: 792 4276 02

Simon,

That would be great because I still am getting a 415 Unsupported Media error.

Thanks,

Andy

Hi Andy ¿ the FAQ has an entry on 415 errors:



http://docwiki.cisco.com/wiki/Cisco_Unity_Connection_REST_API_FAQ



Try the suggestion there to see if that helps.



~ Matt



From: Cisco Developer Community Forums [mailto:cdicuser@developer.cisco.com]
Sent: Thursday, November 10, 2011 9:20 AM
To: cdicuser@developer.cisco.com
Subject: New Message from Andy Melick in Cisco Unity Connection Provisioning Interface (CUPI) - CUPI Questions: RE: 415 - Unsupported Media Type Error on Pin Reset



Andy Melick has created a new message in the forum "CUPI Questions":

--------------------------------------------------------------
Simon,

That would be great because I still am getting a 415 Unsupported Media error.

Thanks,

Andy
--
To respond to this post, please click the following link:

<http://developer.cisco.com/web/cupi/forums/-/message_boards/view_message/4733260>

or simply reply to this email.

Matt,

I read the wiki document:

What can cause a 415 error?
415 errors are generally caused by not specifying the requested content type. Try setting the "Content-Type" header to "application/xml".

If you look at my code from my orginial post I am using the correct formatting I believe. By all means if someone can tell me hwat is wrong with my code to generate the 415 error HELP!


XmlHttp.SetRequestHeader "Content-Type", "application/xml"

I have set my header to include utf-8, not sure if it helps;
application/xml;charset=utf-8

I have tried that. Do you use ASP or VBScript if so can you share your working code?



From: Cisco Developer Community Forums [mailto:cdicuser@developer.cisco.com]
Sent: Thursday, November 10, 2011 3:01 PM
To: cdicuser@developer.cisco.com
Subject: New Message from Sascha Monteiro in Cisco Unity Connection Provisioning Interface (CUPI) - CUPI Questions: Re: New Message from Andy Melick in Cisco Unity Connection Provisioning Int



Sascha Monteiro has created a new message in the forum "CUPI Questions":
--------------------------------------------------------------
I have set my header to include utf-8, not sure if it helps;
application/xml;charset=utf-8
--
To respond to this post, please click the following link:
<http://developer.cisco.com/web/cupi/forums/-/message_boards/view_message/4734807>
or simply reply to this email.



__________ Information from ESET NOD32 Antivirus, version of virus signature database 6619 (20111110) __________



The message was checked by ESET NOD32 Antivirus.



http://www.eset.com

no sorry, my code is in Java

have you tried using https ?
I recall having problems with http

I have tried it in HTTP and HTTPS and get the same error 415 unsupported media.



From: Cisco Developer Community Forums [mailto:cdicuser@developer.cisco.com]
Sent: Thursday, November 10, 2011 3:11 PM
To: cdicuser@developer.cisco.com
Subject: New Message from Sascha Monteiro in Cisco Unity Connection Provisioning Interface (CUPI) - CUPI Questions: Re: New Message from Andy Melick in Cisco Unity Connection Provisioning Int



Sascha Monteiro has created a new message in the forum "CUPI Questions":
--------------------------------------------------------------
no sorry, my code is in Java

have you tried using https ?
I recall having problems with http
--
To respond to this post, please click the following link:
<http://developer.cisco.com/web/cupi/forums/-/message_boards/view_message/4734831>
or simply reply to this email.



__________ Information from ESET NOD32 Antivirus, version of virus signature database 6619 (20111110) __________



The message was checked by ESET NOD32 Antivirus.



http://www.eset.com

You can poke through my CUPI wrapper library for C# folks (it has more to do with providing a strongly typed object based set of functions than anything else but you can poach from there anyway). The subversion source has the library, test projects, a couple example apps using the library and there some thrilling training videos as well:

http://www.ciscounitytools.com/CodeSamples/Connection/CUPI/CUPI.html

I tend to assume when I get an error like that it's Connection fussing about the WAV file format (it's very, very fussy about it) but that's normally not a 415 I don't believe. The library above throws in the towel and I just convert EVERY wav file I send up into a format I know it likes (it's an optional flag in the wav file upload method). I got tired of it bombing on the majority of the WAVs I tried to use...

Jeff,



Your videos are very helpful, however I was hoping not to have to learn C#. I am not trying to do anything with media I am just simply trying to build a web interface to have delegated pin resets. I can do all the GET commands without any problem, but when I try to do the PUT command I get the 415 Unsupported Media error.



Thanks,



-Andy



From: Cisco Developer Community Forums [mailto:cdicuser@developer.cisco.com]
Sent: Thursday, November 10, 2011 3:26 PM
To: cdicuser@developer.cisco.com
Subject: New Message from Jeff Lindborg in Cisco Unity Connection Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Sascha Monteiro in Cisco Unity Connection Provisioning



Jeff Lindborg has created a new message in the forum "CUPI Questions":

--------------------------------------------------------------
You can poke through my CUPI wrapper library for C# folks (it has more to do with providing a strongly typed object based set of functions than anything else but you can poach from there anyway). The subversion source has the library, test projects, a couple example apps using the library and there some thrilling training videos as well:

http://www.ciscounitytools.com/CodeSamples/Connection/CUPI/CUPI.html

I tend to assume when I get an error like that it's Connection fussing about the WAV file format (it's very, very fussy about it) but that's normally not a 415 I don't believe. The library above throws in the towel and I just convert EVERY wav file I send up into a format I know it likes (it's an optional flag in the wav file upload method). I got tired of it bombing on the majority of the WAVs I tried to use...
--
To respond to this post, please click the following link:

<http://developer.cisco.com/web/cupi/forums/-/message_boards/view_message/4733711>

or simply reply to this email.



__________ Information from ESET NOD32 Antivirus, version of virus signature database 6619 (20111110) __________



The message was checked by ESET NOD32 Antivirus.



http://www.eset.com

Can you send the request using http and sniff the packet?  The server will respond with a 302 if you send HTTP instead of HTTPS, but it would be helpful to know the content of the HTTP headers for sure.  A 415 pretty specifically means the Content-Type or the Accept header isn't set somehow.  I've seen cases in some languages where the HTTP headers become unmodifiable, so even though they are set in the code, they don't actually get set under the covers.  A packet sniff would tell us a lot.
 
 
-Dave

I think you need to add the Content-Length header with the value of the length of sXml

I will post my vb.net code tomorrow.

Simon



On 10 Nov 2011, at 20:57, "Cisco Developer Community Forums" <cdicuser@developer.cisco.com
> wrote:

> Andy Melick has created a new message in the forum "CUPI Questions":
> --------------------------------------------------------------
> Jeff,
>
>
>
> Your videos are very helpful, however I was hoping not to have to
> learn C#. I am not trying to do anything with media I am just simply
> trying to build a web interface to have delegated pin resets. I can
> do all the GET commands without any problem, but when I try to do
> the PUT command I get the 415 Unsupported Media error.
>
>
>
> Thanks,
>
>
>
> -Andy
>
>
>
> From: Cisco Developer Community Forums
> [mailto:cdicuser@developer.cisco.com]
> Sent: Thursday, November 10, 2011 3:26 PM
> To: cdicuser@developer.cisco.com
> Subject: New Message from Jeff Lindborg in Cisco Unity Connection
> Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from
> Sascha Monteiro in Cisco Unity Connection Provisioning
>
>
>
> Jeff Lindborg has created a new message in the forum "CUPI Questions":
>
> --------------------------------------------------------------
> You can poke through my CUPI wrapper library for C# folks (it has
> more to do with providing a strongly typed object based set of
> functions than anything else but you can poach from there anyway).
> The subversion source has the library, test projects, a couple
> example apps using the library and there some thrilling training
> videos as well:
>
> http://www.ciscounitytools.com/CodeSamples/Connection/CUPI/CUPI.html
>
> I tend to assume when I get an error like that it's Connection
> fussing about the WAV file format (it's very, very fussy about it)
> but that's normally not a 415 I don't believe. The library above
> throws in the towel and I just convert EVERY wav file I send up into
> a format I know it likes (it's an optional flag in the wav file
> upload method). I got tired of it bombing on the majority of the
> WAVs I tried to use...
> --
> To respond to this post, please click the following link:
>
> <http://developer.cisco.com/web/cupi/forums/-/message_boards/view_message/4733711
> >
>
> or simply reply to this email.
>
>
>
> __________ Information from ESET NOD32 Antivirus, version of virus
> signature database 6619 (20111110) __________
>
>
>
> The message was checked by ESET NOD32 Antivirus.
>
>
>
> http://www.eset.com
> --
> To respond to this post, please click the following link:
> <http://developer.cisco.com/web/cupi/forums/-/message_boards/view_message/4733755
> >
> or simply reply to this email.

Registered No. 755780 England
Registered Office: FM Insurance Company Limited
1 Windsor Dials, Windsor,
Berkshire, UK, SL4 1RS
Regulated by the Financial Services Authority.
VAT No. G.B.: 792 4276 02

XmlHttp.setRequestHeader "Content-lenght", len(sXml)

also note the setRequest, I am not sure if it's case sensitive, but if that is the case, your other headers are not set either

Showing 1 - 20 of 30 results.
of 2