cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4414
Views
25
Helpful
4
Replies

JSON Examples for Configuration API

Ryan Thomas986
Level 1
Level 1

The documentation around using JSON payloads for most of the Configuration API is almost non existent, and to add to that mess, the documentation feedback email mentioned in all the guides is invalid (go figure!)

 

So, has anyone ever had any luck POSTing JSON  to the following endpoint?

https://uccx-server/adminapi/csq/{id}/resources

 

Here's some sample JSON

{
    "resources": {
        "resource": {
            "id": "myUserId"
        }
    }
}

Which I believe corresponds to the example XML given on Devnet

<resources>
    <resource id="myUserId">
        </resource>
</resources>

But I just get the following error back:

<errorMessage>cvc-complex-type.2.4.b: The content of element 'resources' is not complete. One of '{resource}' is expected.</errorMessage>

Any help greatly appreciated!

4 Replies 4

dekwan
Cisco Employee
Cisco Employee

Hi,

 

Thank you for letting us know that the email alias for the documentation feedback is not working. I will let the doc team know about this. Can you send me a private message with your doc feedback. I will pass that on to the doc team as well.

 

I don't know the answer to your question, but when I get a chance sometime next week, I will try to look into it. In the meantime, I would suggest looking at the CCX logs (I think it is in the MADM logs) to see if there is additional information on what is wrong. Also, did you confirm that with that XML, that the API is working correctly?

 

Thanx,

Denise

Thanks for the quick reply Denise, Will get a PM over to you shortly with that feedback!

 

API was responding OK to an XML request so I'm pretty sure this is just a schema / formatting thing, which is why it would be super useful for the docs to include examples for both formats if the schema isn't as straightforward as one would expect

 

Cheers

Ryan

 

Hey ryan.

 

I have had the same problem when posting JSON, so i have actually made a middelware component on a IIS server with Json.NET - Newtonsoft, that transform my JSON to XML and then post it. (Not the nicest way - but it works)

 

 

Please rate helpful posts and if applicable mark "Accept as a Solution".
Thanks, Thomas G. J.

Thanks Thomas, I'll definitely check this out! I managed to make a little bit of progress, you can submit a single resource like this:

 

{"resource":{"@id":"$agent_id"}}

But couldn't find any way to submit more than one in the same request, as is suggested in the XML schema.

 

Cheers

Ryan