Interaction has no call start time when connect action is triggered

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.

what causes this problem, please help :tired_face:?

1 Like

Hi Sunny,

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?

Junji

1 Like

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.

Sunny,

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.

For example, the full conversation data returned from the following Conversation API endpoint should include startTime: GET /api/v2/conversations/{conversationId}. The conversation data should also include outbound campaign information such as a contact list ID and a contact ID, which you can use to obtain contact column data from the following Outbound API endpoint: GET /api/v2/outbound/contactlists/{contactListId}/contacts/{contactId}.

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.

Junji

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.