Your App can interact with Frotcom through Frotcom API V2. There is also a simple messaging system that allows "in browser" communication so that your App can, for example, get the API V2 token from the currently logged in user, and interact with Frotcom API V2 using that token.
Your App lives inside an iframe in Frotcom user interface. Communication between parent window (Frotcom) and the iframe (your App) is possible using the Window.postMessage() interface. You can find more information here: https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage.
The exchanged message follows this structure:
{ event: 'string', data: [{ key: 'string', value: any }] } |
Frotcom sends the message LOGIN to provide your App the current Frotcom API V2 token:
{ event: 'login', data: [{ key: 'token', value: 'the-current-frotcom-user-token' }] } |
Frotcom is listening to the following messages.
EXPIRED TOKEN
{ event: 'expiredToken', data: [] } |
ECHO
{ event: 'echo', data: [{ key: 'echo', value: 'your echo message' }] } |
Comments