04-16-2019 04:52 AM
Hello,
I would like to use the following API
https://api.cisco.com/security/advisories/product?product=
specifically for a the product name : Cisco Email Security Appliance (ESA)
I do a lot of test but I don't find the good way to fill the awaited paramater.
Could you please enlight me ?
Many thanks in advance
Chris
Solved! Go to Solution.
04-16-2019 07:24 AM
I don't have a curl CLI to experiment on, but have you tried encoding the spaces in the URL?
curl -X GET -s -k -H "Accept: application/json" -H "Authorization: Bearer <My_Token>" https://api.cisco.com/security/advisories/product/?product=Cisco%20Email%20Security%20Appliance%20(ESA)
...I don't believe you need to escape the brackets.
cheers,
Seb.
04-16-2019 05:06 AM
Hi there,
You are missing a forward slash.
The correct structure is:
https://api.cisco.com/security/advisories/product/?product=Cisco Email Security Appliance (ESA)
cheers,
Seb.
04-16-2019 06:29 AM
Hello Seb,
I have tried your solution and it is quite good.
Unfortunately, I would like to have only the product
Cisco Email Security Appliance (ESA)
in that case, the api replies the following message : <html><body><b>Http/1.1 Bad Request</b></body> </html>
My exact syntax is :
curl -X GET -s -k -H "Accept: application/json" -H "Authorization: Bearer <My_Token>" https://api.cisco.com/security/advisories/product/?product='Cisco Email Security Appliance \(ESA\)'
What should I write in order to have only the requested product name and not all the Cisco devices ?
(because it seems that there is a blank between Cisco and Email ... this is not well interpreted by the Api)
Many thanks in advance
Christian
@Seb Rupik wrote:Hi there,
You are missing a forward slash.
The correct structure is:
https://api.cisco.com/security/advisories/product/?product=Cisco Email Security Appliance (ESA)cheers,
Seb.
04-16-2019 07:24 AM
I don't have a curl CLI to experiment on, but have you tried encoding the spaces in the URL?
curl -X GET -s -k -H "Accept: application/json" -H "Authorization: Bearer <My_Token>" https://api.cisco.com/security/advisories/product/?product=Cisco%20Email%20Security%20Appliance%20(ESA)
...I don't believe you need to escape the brackets.
cheers,
Seb.
04-16-2019 07:32 AM
In fact, the escape of the bracket is necessary
The final request is :
curl -X GET -s -k -H "Accept: application/json" -H "Authorization: Bearer <Mys_Token>" https://api.cisco.com/security/advisories/product/?product=Cisco%20Email%20Security%20Appliance%20\(ESA\)
Thanks a lot for your support
Regards
Christian
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