Skip to main content
Skip table of contents

InternalApiPublicService

Name

InternalApiPublicService

Class Path

io.trustbuilder.andromeda.internalapi.InternalApiPublicService

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: A NativeObject representing the API request payload.

  • userName: A String representing the user making the request.

Returns

  • ApiResponse: The response of the executed API call. Possible responses include:

    • A successful API response.

    • ApiResponse.NOT_FOUND if no matching API call was found.

    • An error response with HttpStatus.BAD_REQUEST if 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: A NativeObject representing the API request payload.

Returns

  • ApiResponse: The response of the executed API call. Possible responses include:

    • A successful API response.

    • ApiResponse.NOT_FOUND if no matching API call was found.

    • An error response with HttpStatus.BAD_REQUEST if 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_REQUEST and a validation result.

  • If no matching API call is found, ApiResponse.NOT_FOUND is 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.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.