Cisco Catalyst SD-WAN Cloud Guide

PDF

Cisco Catalyst SD-WAN Cloud Guide

Examples of authenticated API requests with cURL

Want to summarize with AI?

Log in

Provides practical examples of executing authenticated API calls using API keys, gateway URLs, and CSRF/XSRF tokens with cURL commands for GET, PUT, and POST requests.


This section demonstrates how to use API keys, gateway URLs, and CSRF/XSRF tokens to execute authenticated API requests with cURL.

GET API request example using cURL

You can retrieve the resource specified by the location parameter using cURL and the required headers for authentication:

curl --location apigw1clouduswest2-1024.viptela.info/dataservice/settings/configuration/banner'
--header 'X-XSRF-Token: AB0E71CAE...'
--header 'Authorization: Bearer eyJ0eXAiOiJqd3QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJ2bGluZ2FtcEBjaXNjby5jb20iLCJpc3MiOiJiOGVkYW
...
a_fcNoeAlVYvrXzDXA'

PUT or POST API request example using cURL

You can send data to the resource specified by the location parameter using a PUT request with cURL, including the necessary headers and data payload:

curl --location --request PUT apigw1clouduswest2-1024.viptela.info/dataservice/settings/configuration/banner'
--header 'X-XSRF-Token: AB0E71CAE72C6D...'
--header 'Content-Type: application/json'
--header 'Authorization: Bearer eyJ0eXAiOiJqd3QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJ2bGluZ2FtcEBjaXNjby5jb20iLCJpc3MiOiJiOGVkYW
...
a_fcNoeAlVYvrXzDXA'
--data '{"mode":"on","bannerDetail":"check"}'

These examples show how to include authentication headers and data payloads to interact securely with the API endpoints.