Alibaba Cloud Customer Service provides a JavaScript API to perform operations on the service from within an iframe.
Page Script
Alibaba Cloud Customer Service provides a JavaScript API to perform operations on the service from within an iframe.
Import the container.
<!-- Import the container JS --> <script src="https://os.alipayobjects.com/rmsportal/SiSsCwUBQGRzOEv.js"></script>Start using the API after the window loads.
window.onload = function() { csbridge.modifyTabTitle('Hello'); // Change the title of the current tab };
iframe Container API:
Change the page title:
csbridge.modifyTabTitle('New Title');Specify whether the current tab can be manually closed:
csbridge.canClose(true or false);Close the current tab:
csbridge.closeCurrentTab();Initiate an outbound call:
csbridge.outcall('Phone Number'); // Note: The outbound call fails if the softphone bar on the Alibaba Cloud Customer Service page is not in outbound mode.Perform softphone wrap-up:
csbridge.workRoundUp(); // Note: The wrap-up fails if the softphone bar on the Alibaba Cloud Customer Service page is not in wrap-up mode.