How do I properly set up a REST endpoint for passing data back!? I followed the example in the Map plugin on the graylog github. I thought I had everything setup correctly (see first post). But when I try to do a PUT it says that the path does not exist. So I must be missing something.
You’re not using the correct URI to access your JAX-RS resource.
The plugin resources are prefixed by the fully qualified package name of the class implementing Plugin, e. g. org.graylog.plugins.map in case of the Map Widget plugin.
You’re not sending any authentication information to the resource but annotated it with @RequiresAuthentication.
Additionally, you’re not sending any content type which isn’t strictly required but recommended.
Adding a content type and removing @RequiresAuthentication still resolves in a POST http://localhost:8080/plugins/org.graylog.plugins.logo/uploadLogo 404 (Not Found)
Did you properly register your resource?
Did you try using the correct content type? It says application/json in the JAX-RS resource but plain/text (did you mean text/plain?) in the JavaScript code.
Anyway, I will stop guessing here without having access to the full code.
I have registered my resource in the module by using addRestResource(LogoReplacerResource.class). Here is a link to my source code graylog-plugin-logo-replacer
Awesome!!! So I was using the wrong URL to post to in my frontend component. I was hitting the standard web interface (port 8080) and not the API route (port 9000). Thanks so much for your help!