01-25-2018 12:15 PM
I am having trouble with the formatting of the JSON PUT to apply an ANC policy. I have it working with XML:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:operationAdditionalData xmlns:ns0="ers.ise.cisco.com" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<requestAdditionalAttributes>
<additionalAttribute name="macAddress" value="11:11:11:11:11:11"/>
<additionalAttribute name="policyName" value="Quarantine"/>
</requestAdditionalAttributes>
</ns0:operationAdditionalData>
I can't get the formatting right for JSON:
{
"OperationAdditionalData" :
{
"additionalData" : [
{
"macAddress" : "11:11:11:11:11:11",
"policyName" : "Quarantine"
} ]
}
}
I get "Failed to parse AdditionalData to object: Unrecognized field \"macAddress\"". I have tried different variations. The API reference for this API call seems a little odd for JSON format.
I have had no issues with JSON on other APIs but they were single level:
{
"SGMapping": {
"id": "316a0f48-4f0a-4b91-a78d-fce9f5795583",
"name": "2.2.2.2/32",
"sgt": "93ad6890-8c01-11e6-996c-525400b48521",
"deployType": "ALL",
"hostIp": "2.2.2.2/32"
}
}
Any thoughts would be appreciated. I am sure I am missing something obvious.
Solved! Go to Solution.
01-25-2018 06:26 PM
With below as the content of the body works for me,
{
"OperationAdditionalData" : {
"additionalData" : [ {
"name" : "macAddress",
"value" : "11:11:11:11:11:11"
},
{
"name" : "policyName",
"value" : "Quarantine"
}
]
}
}
01-25-2018 06:26 PM
With below as the content of the body works for me,
{
"OperationAdditionalData" : {
"additionalData" : [ {
"name" : "macAddress",
"value" : "11:11:11:11:11:11"
},
{
"name" : "policyName",
"value" : "Quarantine"
}
]
}
}
01-25-2018 07:36 PM
Thanks. I tried something similar but I didn’t quite have the formatting right.
Thanks Hsing!
Paul Haferman
Office- 920.996.3011
Cell- 920.284.9250
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide