there is one big question when we use embeddable framework:
Background:
we subscribe the interaction event, receive the "add/change/connect/disconnect/acw/deallocate" categories data. also set the customInteractionAttributes.
What we desire:
before the connect category data push to my iframe, or when the connect category data push to my iframe, we could get the call start time and custom attributes.
Questions:
Sometimes it works as expected,but sometimes we do not get call start time or custom attributes util the disconnect category data push to my iframe.
The startTime value represents when the first participant (which could be any participant and may or may not be the current agent) joined the conversation, and we get this information in a separate request that is asynchronous, so this may or may not finish by the time the connect event is received.
There is another property called connectedTime, which represents the time the current agent is connected to the interaction, and this property should always be there on the connect event.
As for the custom attributes, when and where do you set those attributes? Do you set those attributes during IVR flow or dynamically through Embeddable Framework API (Interaction.addCustomAttributes) at the beginning of the interaction? If you're setting them dynamically using the Embeddable Framework API, do those attributes appear on the change event?
Hi, Junji Sawada. thanks for your reply !
for the custom attributes, not setting dynamically using the Embeddable Framework API, just as the contact list column properties. the attributes would appear in the change event, but the time may be after the connect event trigger. and the start time has the same problem.
If you know that more data is coming on additional interaction events such as “change” event, you could cache, or store, the information locally until you receive those events. This allows you to have data from multiple contexts/events for your processing.
Another option that you might consider is to obtain additional data by yourself by sending AJAX requests to the Platform API endpoints using an access token (User.getAuthToken). You can use an access token in a request header (e.g., { "Authorization": "bearer <access_token>" }) and send a request to an API endpoint to get resource/data.
When you send requests by yourself using an access token, you have to wait for asynchronous requests to complete, but at least you have the data as soon as those requests are completed.