cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2292
Views
50
Helpful
32
Replies

Modify Resource through company website (http://<server>/adminapi/resources/{id})

RarJacobsen
Level 1
Level 1

Hi everybody,

I have a question regarding changing agent skills automatically every night.

I've been told that it's possible to change agent skills back to "default" by using :

(found in Cisco-uccx-developer-guide-902.pdf)

Modify Resource



URI

http://<server>/adminapi/resources/{id}

Example URI

http://<server>/adminapi/resources/{id}

HTTP Method

PUT

Content Type

Application/XML, Application/JSON

HTTP Success Code

200

HTTP Failure Codes

401, 402, 405

Failure Response

-

Error Codes

-

But when I try I keep getting error 405 (Method not allowed) when using this script :

        Try

            Dim strHTTP = Request.ServerVariables("HTTP_HOST")

            Dim strServerFile As String = strHTTP & "/Webpage/Cisco_files/XML_masterfile.xml"

            Dim wc As WebClient = New WebClient

            wc.Credentials = New System.Net.NetworkCredential(usernameGoesHere, passwordGoesHer)

            wc.UploadString("http://10.146.102.13:8080/adminapi/resource/", "PUT", strServerFile)

        Catch ex As Exception

            Response.Write(ex)

        End Try

Can anybody tell me what I'm doing wrong?

See attached XML file for file details

32 Replies 32

Hi G

Got it working now, all I needed to do was changing from :

myWebClient.UploadString(strRequestURL, "PUT", strServerFile)

to

myWebClient.UploadFile(strRequestURL, "PUT", strServerFile)

So thanks ypou many times for you patients and help - and I hope you have time for one last question.

Do my XML docoment need to have everything included or can I simplify the content somehow from

    http://10.146.102.12:8080/adminapi/resource/rarja

    rarja

    Rütger

    Ask Jacobsen

    7020

   

       

            1

           

                http://10.146.102.12:8080/adminapi/Skill/2

           

       

       

            1

           

                http://10.146.102.12:8080/adminapi/Skill/3

           

       

       

            1

           

                http://10.146.102.12:8080/adminapi/Skill/4

           

       

       

            1

           

                http://10.146.102.12:8080/adminapi/Skill/6

           

       

       

            1

           

                http://10.146.102.12:8080/adminapi/Skill/7

           

       

   

    true

    2

   

        http://10.146.102.12:8080/adminapi/team/6

   

   

   

to just containing skills like this :

    http://10.146.102.12:8080/adminapi/resource/rarja

    rarja

    Rütger

    Ask Jacobsen

    7020

   

       

            1

           

                http://10.146.102.12:8080/adminapi/Skill/2

           

       

       

            1

           

                http://10.146.102.12:8080/adminapi/Skill/3

           

       

       

            1

           

                http://10.146.102.12:8080/adminapi/Skill/4

           

       

       

            1

           

                http://10.146.102.12:8080/adminapi/Skill/6

           

       

       

            1

           

                http://10.146.102.12:8080/adminapi/Skill/7

           

       

   

    true

    2

   

        http://10.146.102.12:8080/adminapi/team/6

   

   

   

The  reason for this is that teamnames in out webapplication are different  from them in Cisco and same goes for some of the names

Hi,

actually, I have no idea. Unfortunately, I can't even test it right now because I don't have a version 9 UCCX in my lab :-(

G.

Great work Gergely - have given you some ratings for it

BTW I find that Poster (an add-on to Firefox) is a great tool for testing the UCCX REST API

https://addons.mozilla.org/en-US/firefox/addon/poster/