cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
696
Views
4
Helpful
2
Replies

Cisco ISE API JSON response

DanieloUno
Level 1
Level 1

Hello there, I am using ISE API to get or post requests to it and I know that ISE's default response body is in XML format, I just wonder if I can just change that to JSON, (I know that I can set Accept header to application/json to accomplish that but I am in a situation I cant set the header parameters)... if there is a way please tell me.

1 Accepted Solution

Accepted Solutions

thomas
Cisco Employee
Cisco Employee

https://duckduckgo.com/?t=ffab&q=Cisco+ISE+API+JSON+response

The #1 hit is ISE ERS API Examples which shows how to get JSON out of ISE. Headers are how you request content of a specific format (XML|JSON) however the ISE MNT APIs are XML only still.

You could try to pipe XML output through a tool like yq but it's not pretty :

curl   --insecure  --location \
  --header 'Accept: application/xml' \
  --user $ISE_REST_USERNAME:$ISE_REST_PASSWORD  \
  --request GET https://$ISE_HOSTNAME/ers/config/endpoint \
  | yq -p xml

The ISE REST APIs are documented @ https://cs.co/ise-api and in the ISE PAN node for ISE 3.1+ via the built-in Swagger UI utility.
ISE ERS API Examples
ISE Postman Collections
Webinars:
▷ Cloud Load Balancing with ISE 2023/06/15▷ Cloud Load Balancing with ISE 2023/06/15
▷ Introduction to the Cisco Platform Exchange Grid (pxGrid) in ISE 2023/04/06
▷ Working with ISE pxGrid APIs 2023/02/02
▷ ISE in a Hybrid Cloud Environment 2022/12/06
▷ Automated ISE Provisioning and Patching 2022/11/03
▷ Practical ISE Automation with Ansible 2022/10/06
▷ ISE REST APIs Introduction 2022/10/04
▷ ISE 3.1 APIs, Ansible, and Automation 2021/07/06
▷ ISE REST APIs 2021/04/06

 

View solution in original post

2 Replies 2

ammahend
VIP
VIP

The only API response format is XML - JSON is not supported! Any conversion from XML to JSON or other format must be done by you.

Source

-hope this helps-

thomas
Cisco Employee
Cisco Employee

https://duckduckgo.com/?t=ffab&q=Cisco+ISE+API+JSON+response

The #1 hit is ISE ERS API Examples which shows how to get JSON out of ISE. Headers are how you request content of a specific format (XML|JSON) however the ISE MNT APIs are XML only still.

You could try to pipe XML output through a tool like yq but it's not pretty :

curl   --insecure  --location \
  --header 'Accept: application/xml' \
  --user $ISE_REST_USERNAME:$ISE_REST_PASSWORD  \
  --request GET https://$ISE_HOSTNAME/ers/config/endpoint \
  | yq -p xml

The ISE REST APIs are documented @ https://cs.co/ise-api and in the ISE PAN node for ISE 3.1+ via the built-in Swagger UI utility.
ISE ERS API Examples
ISE Postman Collections
Webinars:
▷ Cloud Load Balancing with ISE 2023/06/15▷ Cloud Load Balancing with ISE 2023/06/15
▷ Introduction to the Cisco Platform Exchange Grid (pxGrid) in ISE 2023/04/06
▷ Working with ISE pxGrid APIs 2023/02/02
▷ ISE in a Hybrid Cloud Environment 2022/12/06
▷ Automated ISE Provisioning and Patching 2022/11/03
▷ Practical ISE Automation with Ansible 2022/10/06
▷ ISE REST APIs Introduction 2022/10/04
▷ ISE 3.1 APIs, Ansible, and Automation 2021/07/06
▷ ISE REST APIs 2021/04/06