InternalApiPublicService
Name | InternalApiPublicService |
Class Path |
|
Versions | 10 11 |
Overview
The InternalApiPublicService provides an interface to interact with the internal API system. This service processes incoming API requests, validates them, and forwards them to the appropriate internal API handlers. It ensures that only valid API calls are executed and provides structured responses.
Available Functions
callInternalApi(NativeObject nativeObject, String userName)
Description
This method processes an internal API call with an associated username. It deserializes the API request, validates it, and executes the corresponding internal API call.
Parameters
nativeObject: ANativeObjectrepresenting the API request payload.userName: AStringrepresenting the user making the request.
Returns
ApiResponse: The response of the executed API call. Possible responses include:A successful API response.
ApiResponse.NOT_FOUNDif no matching API call was found.An error response with
HttpStatus.BAD_REQUESTif the request is invalid.
Usage
This function should be used when an API call needs to be made with a user identity.
callInternalApi(NativeObject nativeObject)
Description
Processes an internal API call without a specified user. It follows the same validation and execution steps as the previous method but does not associate the request with a user.
Parameters
nativeObject: ANativeObjectrepresenting the API request payload.
Returns
ApiResponse: The response of the executed API call. Possible responses include:A successful API response.
ApiResponse.NOT_FOUNDif no matching API call was found.An error response with
HttpStatus.BAD_REQUESTif the request is invalid.
Usage
This function should be used when an API call is made without user context.
Error Handling
If the request is invalid, an error response is returned with
HttpStatus.BAD_REQUESTand a validation result.If no matching API call is found,
ApiResponse.NOT_FOUNDis returned.
Summary
The InternalApiPublicService allows external components to interact with the internal API system in a structured and secure manner. It ensures that only valid API requests are executed and returns standardized responses.