Skip to main content

PostMessage reference

warning

This specification is a reference for partners that are writing the integration code manually, if you are using the sdk instead reference the sdk api

Message Structure​

Each message from the Melio web application to the host application or vice versa has a json stringified payload with the following structure:

{
"type": "<MessageType>",
"messageId": "<uuid>",
...type based payload
}

The additional payload is based on the message type, a list of different message types and their relevant additional payload can be found in the Resources section.

Messages​

{
"type": "<MessageType>",
"messageId": "<uuid>",
...additional payload
}
TypeOriginDescriptionAdditional payload params
NAVIGATED_TO_TARGETMelioIndicating that the application changed targettarget
CONTENT_SIZE_CHANGEMelioIndicating that the content size of the iframe changedheight, width
SCROLL_TOMelioIndicating that user performed action requiring scrollscrollX, scrollY, preventScroll
EXIT_REQUESTEDMelioIndicating that the user requested to leave the Melio applicationoriginator
AUTHENTICATION_ERRORMelioSent when an error happens during initial authenticationreason message
SESSION_EXPIREDMelioSent when the user's session has expired
USER_ACTIVE_PINGMelioSent periodically while the user is still interacting with the application
NAVIGATE_REQUESTHostRequest from the host to the iframe to change targettarget
USER_SCROLLHostMessage should be sent when user scrolls the host applicationrelativeScrollX, relativeScrollY
DIMENSIONS_CHANGEDHostMessage should be sent when the window resizes, on load, and whenever the iframe element might change position or dimensionswindowHeight, windowWidth, elementDistanceFromTop, elementDistanceFromLeft