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

REST API Body Field

kstrussjr
Level 1
Level 1

Hi all,

 

I'm trying to do more with the vManage REST API and have found a lot of great information on GET calls but not much information on POST.  I am trying to work with a call that uses the POST method in order to retrieve a CSV, but I have no clue what I am expected to put in the Body of the POST.  Am I missing something in the documentation that explains what is expected in the Body field of the request?  I assume whatever it is should be formatted in JSON but I'm just not sure what needs to go in there in order to properly make the request.  Any information on PUT / POST methods and what information vManage expects would be really appreciated!

 

Thank you in advance!

2 Replies 2

omz
VIP Alumni
VIP Alumni

Hi


@kstrussjr wrote:

I am trying to work with a call that uses the POST method in order to retrieve a CSV, but I have no clue what I am expected to put in the Body of the POST. 


  • GET—Retrieve or read information.
  • PUT—Update an object.
  • POST—Create an object.
  • DELETE—Remove an object.

To retrieve something .. you would use the GET method.

 

Refer to vManage API documentation - 

https://sdwan-docs.cisco.com/Product_Documentation/Command_Reference/Command_Reference/vManage_REST_APIs/vManage_REST_APIs_Overview/Using_the_vManage_REST_APIs

 

The vManage REST API library and documentation are bundled with and installed on the vManage web application software. To access the API documentation from a web browser, use this URL:

https://ip-address:port/apidocs

 Refer to the apidocs to test what is supported. 

 

If you are referring to getting events using POST .. you need to provide the query parameter for the events. You can look at the query example here - 

https://sdwan-docs.cisco.com/Product_Documentation/Command_Reference/Command_Reference/vManage_REST_APIs/Alarms_Audit_Log_and_Events_APIs/Events

 

Thanks for the prompt reply.  The link you provided to the example does help explain what I should be looking for.  I am still confused on how I would go about creating the body for the below API call in vManage:

image.png

 

Would I just construct a dictionary in Python that includes the template ID and the fields from the CSV that I want to generate and then pass it in as JSON?  How do I know what the server will accept if there isn't an example of it in the /apidocs documentation or the command reference that you provided?