C#, UCCX, Rest API, PUT (update a resource) and not taken media Type supported

Hi, I'm developing an application to update the skills of resources with the REST API.

I can get all the values I want to (GET), but when I try to update a resource using PUT, and then I get a "415 Unsupported Media Type" webException.

I discovered that c# / UCCX works with demand. MediaType (instead of request. ContentType).

I got this error when I tried to GET the data. He now works for the GET.

But to PUT it, I got the error. Method is defined as SAID, MediaType = "application/xml".

I tried to empty, ' text/xml '...

Looked on the internet, Web sites, saying always specify ContentType/MediaType = "application/xml", I have already done.

I also got the same error if I try an application COULD and without sending data.

Thanks for your help!

public string MakeRequest()
{
var request = (HttpWebRequest) WebRequest.Create (EndPoint);
request. Credentials = new System.Net.NetworkCredential (login, password);
request. Method = Method.ToString ();
request. ContentLength = 0;
request. Accept = ContentType;
request. MediaType = ContentType;
            
#region so PUT
If (! string.) IsNullOrEmpty (PostData) & method == HttpVerb.PUT)
{
encoding of var = new UTF8Encoding();
PostData = PostData.Replace ("\n", "");
var bytes = Encoding.UTF8.GetBytes (PostData);
request. ContentLength = bytes. Length;
                
using (var writeStream = request. GetRequestStream())
{
writeStream.Write (bytes, 0, bytes.) (Length);
}
}
#endregion

Try
{
assistance (response var = (HttpWebResponse) request. GetResponse())
{
var responseValue = string. Empty;

If (answer. StatusCode! = HttpStatusCode.OK)
{
var message = String.Format ("request failed. Received HTTP {0}", response. StatusCode);
throw new ApplicationException (message);
}

Enter the answer
using (var responseStream = response. GetResponseStream())
{
If (responseStream! = null)
using (var = new StreamReader (responseStream) Player)
{
responseValue = reader. ReadToEnd();
}
}

Return responseValue;
}
}
catch (WebException wex)
{
error string = wex. Message;
Return ' ';
}

OK you got, in this case, post your request in the Sub forum as well which is sought after by developers and you can you expect a concrete answer/explanation on the same

https://communities.Cisco.com/community/Developer/Express-configuration-API

Concerning

Deepak

Tags: Cisco Support

Similar Questions

  • UCCE REST API PUT method always gives the exception changestamp

    Hello

    I UCCE 11 and using Firefox httprequester to test the API REST UCCE to update an attribute of agent (with the idea of writing a Finesse gadget later).

    EEG works well (Basic authentication, application/xml, 10.100.206.5 being my HDS/AW/DDS

    http://10.100.206.5/unifiedconfig/config/agent/5001

    giving details of the agent (checked all values against real the awdb)

    When you attempt a PUT option (to change the value of the attribute of 3 to 4) with


        40
       
           
               
                    / unifiedconfig/config/attribute/5000
                    English
                    4
               

                4
           

       

    the following is returned



       
            changeStamp
            Another user has modified this object.  Cool off, then try to save again.
            invalidInput.changeStamp
       

    What I am doing wrong?

    Concerning

    I think you need to keep the same as the option change number put.

    If the Put option doesn't change anything in the number does not increment.

  • Update Windows resources and their availability

    Sometimes, after completing an update of the system on the MS Update site, I noticed sometimes an antivirus company can release a safety notice to MS informing that a patch #? is available from Microsoft.

    Are there other places looking for these additional updates?

    All Security Bulletins for security updates are listed here: http://www.microsoft.com/technet/security/current.aspx

    All the published updates in 2010 are listed here: 2010 Description of Software Update Services and Windows Server Update Services changes in content for 2010
    For 2009: Description of Software Update Services and Windows Server Update Services changes in content for 2009

    Security advisories Microsoft, which are not necessarily on specific updates, can be found here:Microsoft Security Advisory

    MowGreen Services update - consumer safety

  • El Capitan 10.11.4. is safe to put up-to-date and not having problems with Adobe Creative Suite?

    I read a lot of problems with the update of the system of El Capitan, the thought of updating scares me. I use Adobe Creative Suite to work, so it is crucial for me that they work perfectly together. Resolved bugs in 10.11.4?

    Every single major and the Mac OS update brings out the horror stories. Which most is caused by systems that are stuck with rubbish like AV software applications Or really worthless, damaging as CleanMyMac, MacKeeper and other apps that garbage (haxies).

    The only real issue I've seen in El Capitan, which was specifically a problem known BONES was that placing old types of fonts directly in the folder/Library/Fonts /, or their activation in place with any font manager would not work. They had to be put into the folder of the user account or activated as a collected police policies. Which has been fixed in 10.11.3.

    Otherwise, I use most of the CC apps every day (primarily Photoshop). Everything works as expected.

  • I was download educational resources of the school of a Web site for a while, but recently a notice appears when I try to save the document: Adobe reader cannot open this document because it is not a file type supported or because the file ha

    What can I do to access and save the documents of this educational website?  I'm able to download, but when it comes to saving the document, the above answer is displayed.  This was not always the case.  In the past, I was able to download as well as saving resources, until I had to install a version update of the player.  This is where the problem started.  I am able to save documents on my husband's computer, but not on my MacBook - and this is where I need to save them.

    I hope someone can help

    Chantelle

    It could be that Reader is not used to open it in your browser.

    Have you tried right-clicking on the link for the pdf files, download them and then using the file > open within the drive itself?

  • Pavilion 500-368na: update the BIOS, do not install via HP Support Assistant.

    I tried four times to install a BIOS update (SSID Roma family 2AF7;) Version 80.20Ap1) provided in the Support Wizard, the update only installs on every opportunity. I get no error message. Restart the computer, but the version remains (FRIEND 80,19 (2014-07-18)) previous BIOS installed.

    I tried to stop my antivirus program, but that did not help. I noticed that hangs the command screen with a blinking cursor, but no statement is visible, and then my computer restarts.

    Is it possible that the update is corrupted? Any advice on how I should proceed would be welcome.

    Yes, HP has indeed pulled the update.  Human system is in danger and you can continue to use your computer.  Everyone here is always on my list of contacts as events change.

  • Error code 80070424 during the application update the window and installing the Apple Application Support

    Hi guys,.

    I am running Windows Vista Premium Home 64 bit. This all started when update me my iTune recently and since then it has been a headache after another. Basically, when I try to install iTune, it says that I need to install Apple Application Support first, and when I do that, I get the following message appears:

    "An error occurred during the installation of assembly"Microsoft.VC80, CRT, Version... ". "and it lights up.

    In addition, I also tried to install Vista SP 2 recently but my window update also gives me a pain. I can't get the update because when I try, it says 80070242 error code - Windows Update encountered an unknown error.

    Here are the pictures of the 2 filters:

    Any help at all would be greatly appreciated.

    Thanks for the suggestion of Augustine, but the problem is still present. The order went through, but I always feel error 80070424 and is possibly due to a malfunction of Windows Installer Module.

    Thanks for the attempt. Appreciate it.

    Suggest you check to see if the Windows Modules Installer service is present, has not been disabled and can be started.
    Right click the computer on the desktop or the Start Menu and choose Manage
    The UAC prompt to enter a password if one is used, then click on continue or Yes.
    If no password is used, click on continue.
    Click the arrow next to Services and Applications
    Click Services in the left frame
    Scroll down the list of Services in the context of e right until you come of Windows Modules Installer .
    If it is present, check under Startup Type to see if it has been disabled.
    The default setting is manual.
    At the top left will be a link to start the service
    Click on it and see if the service can be started.

    If the installer of Modules of Windows is disabled, right click on it and choose Properties .
    Set the startup type to Manual , click on apply, OK.
    Close the computer management console.

    If the Windows Modules Installer is not present and of Flavius are too difficult for you to follow, then replace
    Contact MS Support free of charge.
    Start here
    Make a mark next to "I use it for my own personal use.
    Now click on the button continue.
    Click on the I accept"" button.
    Support options will be displayed. The only option I see here is for email support.
    Click on the button continue to access the support request form.
    Fill in the fields and then click on the button continue.

    MowGreen Services consumer safety update

  • I had windows updates only 3 update 11 failed and not update, now I can't open my program files

    After starting to install windows updates failed only 3 including 11 installed has not tried again they now cannot access some programs include research on the windows desktop, Explorer windows, help and support, system information, disk cleanup, defrag the files, microft office, others I right click and click Properties find target then I get a message could not open the windows file install is not properly installed ,

    Your last two responses bring back us to 2 two things you posted yesterday (I had hoped we could avoid).

    In reverse...

    [#1] ... I received an error message when I booted my computer that says "cannot find componate RPS.exe. "AntiFr.dll was not trying to install again.

    Several years ago, before Verizon (or whatever your telephone company was called at the time) gave the suite McAfee customers, she gave another sequel on Proctection of Radialpoint Suite (AKA freedom Internet Security).

    The code snippet above tells me that the Radialpoint suite has been installed on your computer at somepoint in a past distant: files RPS. EXE and ANTIFR. DLL are 'leftovers' from Radialpoint Protection Suite (where letters RPS in the first file name).

    Speaking of the hard personal experience, I can tell you more about Radialpoint is about impossible to remove completely without manual editing of the registry - something you DO NOT want to do!

    And despite what the volunteer moderator McAfee Forums and communities (own KB of Radialpoint article) has to say, you do NOT want to download Microsoft's Windows Installer Cleanup utility now interrupted the quoted source not Microsoft !

    [#2] ... I installed Speedy [PC] Pro last week... every day since then, around 15:00 I get a message that says "cannot find c: Program file commune File\SpeedyPC Software\UUS3\UUS3.dll ' I click on close and she goes until the next day.

    Unfortunately, installation & with the Speedy PC Pro 'scareware' is no worse, Dennis. [It is called "scareware" because you have to buy this disreputable application ($34.95 USD, I heard last) until it 'fixed' anything.] [Of course, it won't fix a 'thing'!]  See this recent discussion, some-online http://answers.microsoft.com/en-us/windows/forum/windows_vista-security/who-are-speedy-pc-pro-and-are-they-safe-to-use/62629332-a670-4166-b418-e2a5a876daa1

    TIP: If you ever think that your registry database must be cleaned, repaired, boosted, point, healed, twisted, fixed, magnified, "swept" or optimized (it isn't), read http://aumha.NET/viewtopic.php?t=28099 and draw your own conclusions. See also http://blogs.technet.com/markrussinovich/archive/2005/10/02/registry-junk-a-windows-fact-of-life.aspx

    If you had not used the Speedy PC Pro crapware, there is a very slim chance that you would be able to install the suite McAfee/Verizon again - at least according to McAfee Tier III Support Tech post on this page. But you don't have so there is nothing we can do about it now. [No, System Restore may not "come to the rescue" here.]

    => Let me level with you here: this set of the problem is due to have not entirely - remove the McAfee free version to test which is preinstalled on your computer, years BEFORE the installation of any antivirus application (for example, the suite of Radialpoint) AND BEFORE installation of Windows updates.

    Now the very bad new: the only way to return your computer to a functional & secure State is backup so your personal data (for example, the contents of the My Documents folder;) Favorites of IE; E-mail Client data) then format the hard drive and do a clean install of Windows XP (or buy a computer brand new Windows 7).

    Follow the instructions (to-the-letter & in order!) in this post of mine in another forum: http://aumha.net/viewtopic.php?f=62&t=44636

    If you need additional help with the new installation, start your own, new topic in this forum: http://answers.microsoft.com/en-us/windows/forum/windows_xp-system

    If these procedures are outside your technique "comfort zone" - and there is no shame in admitting this isn't your cup of tea - take the computer to a local, reputable and a stand-alone computer (that is, not "BigBoxStoreUSA" or Geek Squad), repair shop & let them do the work.

    Note: The computer must NOT be connected to the internet or local networks (i.e. other computers) in its current state. All your personal data (e.g., banking online & passwords credit card) must be considered at risk, if not already compromised.

    I sincerely wish I had better news for you.  Good luck!

    =================================================================
    WARNING: Displayed AS IS without any warranty. MS MVPS represent or work for Microsoft

  • HP Pavilion dv6-1242tx: updated driver required but not available to HP support.

    I noticed that my keyboard returns incorrect symbols as I type. A case occurs when I hit shift-2 poster 'symbol' instead of @. My PC has a QWERTY keyboard, and I am currently using regional (UK) English, the input parameters and the format.

    Also, when I go into my control panel / devices and material, I see the error message that is associated with my PC:

    Status: Driver is not available

    Status: Driver error.

    I have checked with the help of HP but have found that the driver for my model number and the operating system is not available.

    Can then someone suggest a source for a driver or a workaround?

    I noticed the warnings in support of HP related software vendors claiming to be affiliated with HP, so I thought I would ask this forum before you search the web.

    Thank you for your consideration of my problem in advance.

    Hello

    If the @ symbol is SHIFT + 2 key, then you have a style WE keyboard (the ' is on shift + 2 on a UK layout).  For this to work properly, you must select the United States keyboard layout - you can change your keyboard layout, as described at the link below.

    Change of keyboard - Windows 8

    Kind regards

    DP - K

  • Try to attach photos to an email on Hotmail, but when I open the file, they were put in alphabetical order, and not chronological order I want. Can I change this?

    Hello.   I'm trying to attach photos to an email on Hotmail.  When I open the folder where I want to download the pictures, they are all placed alphabetically.  I want to arrange them in the order, they were taken, which I can do by going in "My pictures", but when I pull the file upwards again in Hotmail, they are given in alphabetical order.  Any ideas?

    Hello Oilfan,

    Thank you for your message.  Since there are two ways to attach photos in Hotmail, I assume you are using the 'Attach' > 'File' version instead of "attach" > version "Photo".  To sort the folder to your liking, you can click right in the pane where you see your files > Highlight ' rearrange icons by "> select" Photos taken we.
    Please let us know if this or help to solve your problem.
    See you soon

    Engineer Jason Microsoft Support answers visit our Microsoft answers feedback Forum and let us know what you think.

  • I want that my users who log on to the virtual remote desktop to use the one I put in this image and not their local keyboard

    Original title: the remote keyboard language

    Hello

    I connect to a remote virtual desktop. My local computer uses a different keyboard language than the remote.

    I want that my users who connect to the virtual remote control to use the one I have set myself in this picture and not their local since keyboard only supports us that we provide in the virtual, not on their local machine.

    I've tried the "Reg" IgnoreRemoteKeyboardLayout key, but I've been the opposite. Who closes?

    Is their a way to force the RDP to use the remote keyboard and not local?

    Thank you

    Hello

    Thanks for posting your query in Microsoft Community.

    I understand you have questions using the remote keyboard on the Windows computer. So, please follow the link below to post your query in the Technet forums, because they have more expertise on this issue.

    TechNet forums

    http://social.technet.Microsoft.com/forums/Windows/en-us/home?Forum=w7itpronetworking

    I hope this helps.

    Thank you

  • [Bug] Extra large leak of great resources and crash Windows Media Player (WMP) and music collections.

    The installation program:

    Windows 8 Pro x 64.

    WMP 12.0.9200.16420

    Question:

    In the trial of an extra-large music collection (~ 148 000 songs, mostly VBR *.wma) default WMP x 32 app will cause a memory leak upward to 1.5 GB in the Task Manager and then "hang" corrupt the database as it attempts to interview and initially to build the database.  The application itself will lose its bmp controls (they're going black when you place the cursor or spend on them with a mouse) when he hung.

    This is not a regression, happened to Win7 x64as well.

    Previously, it was necessary to create two scheduled tasks that would launch WMP every 5 minutes. and that would kill the process every 40 minutes. If the program would be terminated before fleeing corrupt the database.

    We had hoped that MSFT would do some better load/stress for large media libraries test to see the availability of retail.

    Please try to repro and fix, thank you.

    I also noticed that there is a serious memory leak in WMP 12 on Windows 7/8. Specifically, WMP loses memory each time he reads album art that is incorporated into a music file. Could be the leak even like what you feel?

    After finding the exact cause of the leak, I was able to lead to a workaround that I have included in my plugin WMP Tag Plus . This work around has not been officially published yet, but if you are interested, I can send you a version of the plug-in for you to try. You can contact me via the email address on my site.

  • REST API - subscriptions Contact

    Hello

    I'm updating subscriptions contact using the REST API, but the documentation at http://topliners.eloqua.com/docs/DOC-3526 seems to be updated. The current lead for/data/contact / {contactId} / groups/email/subscription is different than the result of the documentation.

    Can someone explain to me how I should manage subscriptions? I use https://secure.eloqua.com/API/REST/2.0 as the API endpoint.

    Thank you

    Ronald

    Hi Ronald,.

    The current stable version of the REST API is 1.0. Please note that 2.0 is public, but it is subject to change, and so we do not recommend that the community uses this.

    About the management of subscriptions, we will add a post shortly to describe how to subscribe and unsubscribe Contacts using the Rest API.

    Hope this helps and please let us know if you need more information.

    Thank you

    Fred

  • The REST api is supported by Eloqua?

    Hi guys,.

    I know that this seems to be an odd question at first, but bear with me.

    Recently, I created a few features to read certain Eloqua components.

    Then I came across some problems with th! api e REST and contacted support, at one point, they reported that the REST api was not officially taken in charge, is this true?

    Because using SOAP is no option for our programming environment and the major PART is just for the massif of the small amount of calls, we have to do.

    Hope you can give me a permission in this respect, because we do not want to create stuff on top of the api REST when we can never support on it.

    Through the REST API, you can do many things, not all supported.  This page lists the supported operations: management of Eloqua API use cases

  • VRA 6.2 REST API: CatalogItemRequest - number of machines?

    I started looking in the REST API vRA for 6.2 and can't seem to properly configure a machine using the CatalogRequestItem type.  However, I can only ask a machine at a time.  Is there a setting (or the value of the property) that can be added to the query to specify the number of machines to ask?  Or is there a different API call to do this?  Thank you.

    Take a loot at the next post. Add this to your JSON blob (where the value is the number of instances that you want to deploy).

      {
        "key": "supplier - Cafe.Shim.VirtualMachine.NumberOfInstances."
        'value': {}
          "type': 'integer."
          'value': 2
        }
      }

    Grant

Maybe you are looking for