Web messaging Guest API: handling multiple uploads in quick succession

Hello,

We are using the Web Messaging Guest API using the Java bindings to bridge our custom-written live chat UI to Genesys. We need to support the ability for the customer to upload one or more attachments.

We have run into a problem with handing multiple uploads in quick succession, similar to this old thread:

https://developer.genesys.cloud/forum/t/error-doing-file-uploads-too-quickly/19771

The documentation outlines how to upload a file through live chat as follows:

  1. Request a pre-signed URL
  2. Get back the PresignedUrlResponse event containing the URL to PUT the upload to
  3. Upload the file to the presigned URL
  4. Then, send an inbound message with the attachment ID

The problem is that there seems to be no obvious way of correlating (1) and (2) via the Java API: in the Websocket API documentation, there is a tracingId attribute, which is, as of v12.0.0 of the API bindings, exposed in the GenerateUploadRequest DTO but not through the WebMessagingClient.attachment() method.

Even if this tracingId attribute were exposed, the earlier thread I quoted above strongly implies that the Genesys Guest Chat API implementation does not support having multiple uploads in flight. For example, if I request a pre-signed URL, and the client requests a second download before the Guest API issues a presigned API for the first and the file is uploaded, the behaviour appears to be undefined, although this does not appear to be documented.

In short, I'm wondering:

  1. Are we allowed to have multiple upload flows in flight for a given Guest (Websocket connection)? Or do I need some kind of locking mechanism to so that the steps above (1 to 4) are handling a single download at a time?
  2. Is the fact that tracingId is not exposed through WebMessagingClient.attachment() in the Java API indicating that -- no -- we can't have multiple uploads in flight for a given Guest?
  3. If we are supposed to be able to send multiple onAttachment messages and get presigned URLs back for each: are there any kind of order guarantees for the returned PresignedUrlResponse messages to correlate them with the originating request message?

Bonus question:

The presigned URL mechanism for uploading attachments into live chats requires us to double-handle data. I don't see a way to simply pass a link to an attachment to an Agent through the API, to the attachment hosted elsewhere (attachment download URL is also temporary and pre-signed!). Is there a way to do this? I haven't encountered any so far through these forums or the code.

Cheers and thanks in advance!

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