/
uContact Window Proxy API

uContact Window Proxy API

This documentation outlines the methods of the Window Proxy API for the uContact portal, which enables the portal to be embedded into any site via an iframe. This allows the host site to receive and send events to perform specific actions, such as being notified of incoming calls or making calls.

For uContact v6 instances, the URL will be https://<instance_domain>/uphone

Creating the iframe

<iframe src="url" scrolling="no" allow="camera;microphone"> </iframe>

allow attribute is required for calls and video calls

Event notifications

Messages will be sent to the parent page when these events occur:

For subscribing uPhone events, window proxy API will have to be used.

This is an example of how to subscribe to events from the page that has the iframe.

window.addEventListener('message', e =>{ console.log(e.data.action); console.log(e.data.params.number); });

Event

Triggered when

Event

Triggered when

makeCall

Initiated when an agent starts an outbound call.

gettingCall

Triggered when an inbound call is ringing at the agent's uPhone.

finishedCall

Occurs when a call interaction is completed.

finishedSms

Fired when an SMS conversation is closed.

sentDispositions

Submitted when disposition data was sent.

agentLogin

Triggered at agent authentication.

Make call

{ "action":"makeCall", "params":{ "number":1234 "campaign":"campaign->" } }

Receiving a call

Finished call

Finished sms

Sent dispositions

The directions in the “SMS” channel are “I” (incoming) or “O” (outgoing)


Agent Login

Execute actions

Event

Triggered when

Event

Triggered when

makeCall

initiates an outbound call.

makeSms

initiates an SMS interaction.

Make sms

Make call

 

You can execute actions on uPhone by using the window proxy API.

Here is an example of how to obtain the iframe window and sending to the uPhone.