Spring Boot Java Session API
This sample illustrates setting up an API endpoint using Spring Boot to call the Amberflo Session API and return the session token using the JAVA SDK. This session token can be used for all Customer Usage and Billing Portal apps.
Steps:
- Setup Amberflo environment
- Setup configuration for service discovery of Amberflo Customer Usage and Billing Portal Session client
- Create API Endpoint and controller to return Session ID.
Maven dependencies (check for latest versions):
- Setup the environment to configure the Amberflo SDK client settings
- Add the following entries to the application.properties file
- Set up an environment for service discoverable.
Make the Customer Usage and Billing Portal Session client be a discoverable service that can be injected as a dependency by Spring Boot configuration. This will return the client instance as a bean.
In most instances, the user or customer ID is passed in a request header. Set IDENTITY_HEADER to this header.
This is a sample REST controller which returns the session token from Amberflo. This session token can be used for any of the Customer Usage and Billing Portal apps.
The endpoint will be https://yourappdomain/amberflo/session
API Reference Create a session