Forum Discussion
Javier
4 years agoNeophyte
Hi again,
I prepared my script to programmatically create the XML file to define new EventSources. I test it successfully from the UI, using "Add" - "From File".
Now I would like to use the API to make such a call. According swagger documentation here, it looks like I need to provide this file as a parameter, but I don't have a clear idea on how to provide that. I tried several methods, but none of them worked so far:
- Adding a parameter named "file" to the URL. Something like: "https://XXXXXX.logicmonitor.com/santaba/rest/setting/eventsources/importxml?file=toimport.xml"
- Adding a JSON payload like: { "file": "toimport.xml" }
- Adding the XML content to the payload: { "file": "<?xml version="1.0" encoding="UTF-8" ?>......" }
Using any of these methods, I always get an error "HTTP 415 Unsupported Media Type".
What am I doing wrong?
Related Content
- 2 years ago
- 2 years agoAnonymous