cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
319
Views
0
Helpful
2
Replies

JSON ANC Policy Apply

paul
Level 10
Level 10

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.

1 Accepted Solution

Accepted Solutions

hslai
Cisco Employee
Cisco Employee

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"

      }

    ]

  }

}

Screen Shot 2018-01-25 at 6.23.21 PM.png

View solution in original post

2 Replies 2

hslai
Cisco Employee
Cisco Employee

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"

      }

    ]

  }

}

Screen Shot 2018-01-25 at 6.23.21 PM.png

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