...
Add the project dependency below:
Code Block language xml <!-- Add apibuilder_api dependency --> <dependency> <groupId>org.joget.api</groupId> <artifactId>apibuilder_api</artifactId> <version>${project.version}</version> <scope>provided</scope> </dependency>
Info You can get the apibuilder_api.jar at https://download.joget.org/addons/for_plugin_developer/
Abstract Class
org.joget.api.model.ApiPluginAbstract
- Under apibuilder_api module
- Extended org.joget.plugin.base.ExtDefaultPlugin. Please refer to Plugin Base Abstract Class and Interface.
- Implemented org.joget.api.model.ApiPlugin.
- A base abstract class to develop a custom API Element Plugin.
Abstract Methods
authenticate
public boolean authenticate(HttpServletRequest request, HttpServletResponse response);
Used to authenticate API calls on an existing API document.
Parameters:
request - the http request information
...
API Methods
Panel | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
To generate JSON APIs from your implementation, see the available Java annotations with samples below: @Operation
@ResponsesConsists of @Response annotation(s). Information in table here:
@Param
For detailed examples, do check out the Sample Plugins attached in this page. Here is a sample code snippet from the sample Basic Current User API plugin:
|
Abstract Methods
getIcon
public String getIcon()
Return the icon to show for this API Element in the API Builder palette.
getTag
public String getTag()
Return a unique tag for the API Document.
Overridable Methods
getTagDesc
public String getTagDesc();
...
Return a tag description for
...
API
...
Document.
Default will return the value found in getLabel() method in your custom plugin.
getResourceBundlePath
public String getResourceBundlePath();
...
Return a resource bundle path for API document generation.
Default value is NULL.
getExternalDocsDesc
public String getExternalDocsDesc();
Return a short description for external document for API document.
Default value is NULL.
getExternalDocsURL
public String getExternalDocsURL();
Return a link for external document for API document generation.
Default value is NULL.
getDefinitions
public Map<String, ApiDefinition> getDefinitions();
Return a key & JSON Definition map for API document generation.
Default value is NULL.
isAPIEnabled
public Boolean isAPIEnabled(String method, String path);
Check if an API path is enabled for the API Key.
Default behavior will check if method exist in the specified path, in the property string "ENABLED_PATHS".
getOperationOptions
public Map<String, String> getOperationOptions();
Return a map of available operations (GET, POST, PUT, DELETE) to populate in builder.
usingSimpleConfig
public boolean usingSimpleConfig();
A flag to indicate using simplified plugin configuration method
...
.
Default value is
...
TRUE.
Plugin Properties Options
Please refer to Plugin Properties Options for more information.
Anchor | ||||
---|---|---|---|---|
|
Sample Plugins
Basic Current User API
...
Sample API with property options
...