Jump to content

What is better for plugin development when requesting information from the server using JS


chef

Recommended Posts

chef

If this was .net standalone app, I would create an ApiClient Object, authenticate it, and use it to get all the information I need to build an application.

 

Plugin development is different. I'm embedding Javascript, and the Api calls I have used so far is to update the configuration xml.

 

I noticed, in the plugin repository, specifically the Notify plugins, that the Api is returning User Info.

 

Is it possible to use the "ApiClient" object, that the plugin has built, to return such information? or will I now have to learn AJAX and make HTTP requests (examples from the  Swagger-ui)?, or should that sort of stuff be handled in the ".net code-bind"?

 

My final question is, does the plugin have to do any authentication in order to request Session and user Data, if I do indeed have to request information from the server via HTTP/JSON returns.

 

 

 

Trying to ask relevant question, with out giving away the fact that I am an amateur.

Edited by chef
Link to comment
Share on other sites

Within javascript - which should just be your configuration page - you can, and should, use the ApiClient instance to interact with the API.

 

However, this is just your configuration page.  Your actual plug-in should be within the server environment with access to all the services available there via your ServerEntryPoint constructor.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...