Open Messaging API // Send message with attachment

Our customer is trying to implement Open Messaging using Genesys Cloud API.

In order to send file attachments (inbound flow - from external user to agent) the following API call is used:
https://developer.genesys.cloud/commdigital/digital/openmessaging/inboundMessages#inbound-message-with-attached-photo

The example provided above is an inbound message from an external user. It includes the text, "Inbound message with photo" as well as an attached photo in PNG format.

Below you may find some queries that need to be answered.

Q1) In case it is needed to send a file attachment via Open Message, the following code snippet should be included in the API call.

"content": [{
"contentType": "Attachment",
"attachment": {
"mediaType": "Image",
"url": "https://www.genesys.com/media/4a30f651-ba-genesys-logo-color.png",
"mime": "image/png",
"filename": "4a30f651-ba-genesys-logo-color.png"
}
}]

As you can see URL parameter value is a web URL. But this cannot be the case at all times. Most likely, the file attachment that external user wants to send to agent would be a file locally stored in their PC/laptop. Can this URL filled in with an absolute path where the file is stored (for example [C:\temp_folder\files\sample_photo.png)](file:C:/temp_folder/files/sample_photo.png))? If yes, what is the correct syntax to use?

Q2) Based on the sample request provided in developer site, customer assumed that they should only provide a web URL (hyperlink to file) and not the file itself. In other words, file should be saved somewhere external to Genesys and Genesys has access to this file via the link provided. Genesys Cloud does not store the attachment file internally.

Can you provide some insight on the above? From our tests, it seems that this is totally not true, as Genesys Cloud receives the file itself and stores it internally. Same applies for both inbound and outbound attachments. Moreover, there is the 25MB size limitation for attachments. If this was not the case, there should be no reason to have a size limitation.

Q3) Assuming that they can only provide a valid web URL for the URL parameter, this should mean that they should have a web server where file attachments are stored. Question is how long to be kept there? Has Genesys Cloud any restriction regarding this?

Customer's feedback:
I understand that we need to put our own location for the file.
I suppose that Genesys retrieves and copies the file elsewhere and then alters the message shown to the agent with a Genesys URL based on the test you made. That part is indeed not of our concern.
However the location of the file originally is our concern and my understanding is that we need to store the file somewhere so that Genesys can retrieve it in the first place. Therefore the question of when do we remove it remains I suppose.

Thank you in advance.

@odimitr i think you walked through most of the answers there already. It's important to note the the media message flow inbound for open messages from your service vs. outbound (agent sending) can be a little different. For instance the agent can use a file on their system, and upload it to Genesys Cloud, then send the message. For inbound messages from your open messaging backend service, that is not possible and the media must be stored in a publicly accessible url.
As you suggested in your post, Genesys Cloud will use that inbound media url to download the media and store it in Genesys Cloud for the duration of the Conversation. You only need to allow access to it for as long as it takes Genesys Cloud to persist the message (most likely a few minutes at most). You can be sure by checking the status of the message on the Conversation, if you need to poll for when you can be sure to remove the media on your external hosted server or not.

Thank you Greg.

Indeed, i made a test to verify it. I uploaded an image to a free sharing site. I set up image deletion after 5 minutes. Image URL was included in the open messaging API request to Genesys Cloud. Agent could properly see the image even though image had been deleted from the original location.

Thank you for the confirmation.

Hello,

In addition, can we use an ftp link instead of a Web URL for the "url" parameter?

Best regards,
Orestis.

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