cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
999
Views
7
Helpful
7
Replies

Problem Calling SD-WAN API

Fachri Akbar
Level 1
Level 1

Hi, I'm new for calling API in vManage, i wanna ask about the request body for /device/tools/servicepath/{deviceIP}. i can't find the example of request body for Post Operation. In API documentation, it's only like this "{ }". When im using this request body for calling API, i get this 400 response error :

{
    "error": {
        "message""Failed to run service path",
        "details""vpn key not found",
        "code""DEVICE00012"
    }
}

Does someone knows the correct one of request body for this specific API?
Thanks

Documentation Links: https://developer.cisco.com/docs/sdwan/#!sd-wan-vmanage-v20-4
1 Accepted Solution

Accepted Solutions

I did a capture in dev tool chrome and see this when it is ran from the UI

 

Screenshot 2023-05-30 at 11.39.18.png

Screenshot 2023-05-30 at 11.35.38.png

Screenshot 2023-05-30 at 11.42.35.png

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

View solution in original post

7 Replies 7

I did a capture in dev tool chrome and see this when it is ran from the UI

 

Screenshot 2023-05-30 at 11.39.18.png

Screenshot 2023-05-30 at 11.35.38.png

Screenshot 2023-05-30 at 11.42.35.png

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

Hi,

could you give an information, how to find POST body for API calls? What is the trick or method?

Like configuring smth via API call, but how I'll fill and provide body properly?

HTH,
Please rate and mark as an accepted solution if you have found any of the information provided useful.

In the past i used the apidocs within sd-wan - but its easier to use the SDK https://developer.cisco.com/docs/sdwan/#!sastre-sdk-overview - The SDK includes documentation that explains how to use the API, including the different endpoints, parameters, and return values.

Hope this helps.

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

Hi, Thanks for your Answer, im tryin opening the SDK and search for reference for request body but nothing help for this API /device/tools/servicepath/{deviceIP}. How do you find the API payload from chrome dev tools? is it JSON formatted and can i test it on postman? or do i need to change payload to JSON format?
Thanks

To capture JSON payload for REST calls in Chrome Developer Tools, follow these steps:

  1. Open the Chrome Developer Tools by pressing Ctrl+Shift+I or by clicking the three dots in the top right corner of the browser window and selecting "More Tools" > "Developer Tools".
  2. In the Developer Tools window, switch to the "Network" tab.
  3. Make a request in the SD-WAN UI call to the endpoint that you want to capture the JSON payload for.
  4. In the Network tab, find the request for the REST call that you made.
  5. Click the "Headers" tab for the request.
  6. The JSON payload for the request will be displayed in the "Request Payload" section.

You can also copy the JSON payload to the clipboard by clicking the "Copy" button next to the "Request Payload" section.

Here are some additional tips for capturing JSON payloads for REST calls in Chrome Developer Tools:

  • You can use the "Filters" bar at the top of the Network tab to filter the requests that are displayed. This can be helpful if you are making a lot of REST calls and you only want to see the requests for a specific endpoint.
  • You can use the "Recording" button to record all of the requests that are made while the Developer Tools are open. This can be helpful if you want to capture the JSON payloads for a large number of REST calls.
  • You can use the "Replay" button to replay a recorded request. This can be helpful if you want to test the response that you get from a REST call.

Hope this helps!

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

Also if you want to know about the SDK there is a webinar happening here https://www.brighttalk.com/webcast/17628/583537?utm_source=CiscoDeveloper&utm_medium=brighttalk&utm_campaign=583537

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

Thank you for the explanation and the Webinar!