Message replies and action cards

I’m currently trying to use the CloudLink API to interact with the MOWA chat client and am facing multiple issues:

  • If I try to get replies to messages which were created with the MOWA chat client, I always get a response with a count of 0.
    Is it possible that replies created in the MOWA chat client aren’t seen as replies by the CloudLink API?
  • If I send messages with action cards they are displayed correctly in the MOWA chat client but not in the Mitel One Android or Apple App. Is this a known issue?
  • If I send messages with action cards where the buttons disableOnClick behavior is set to “true”, the Button can still be pressed/activated several times. How can I set the behavior to disable the button after clicking it?
  • If I create a chat or stream where the client is a participant the “display name” is a random string. Is it possible to set the “display name” of a client in a chat or stream?

If I try to get replies to messages which were created with the MOWA chat client, I always get a response with a count of 0.

Can you provide the details around the API call you’re making and what the scenario is (User A does this, User B does this, make the following API call as User A, etc). Keep in mind that ‘replies’ in the Chat API refer specifically to messages that are direct replies to a specifically referenced message. Two users just chatting back and forth are considered standard messages and not replies.

Is it possible that replies created in the MOWA chat client aren’t seen as replies by the CloudLink API?

No, but there are scenarios where a particular user won’t see certain information. I don’t suspect that’s your issue here, though.

If I send messages with action cards they are displayed correctly in the MOWA chat client but not in the Mitel One Android or Apple App. Is this a known issue?

When it comes to message types, including action cards, it’s up to the client you’re using to interpret it, display it, etc. If the Mitel One client isn’t displaying it properly, send me a PM with more information about what’s going on and I’ll run it by the team responsible.

If I send messages with action cards where the buttons disableOnClick behavior is set to “true”, the Button can still be pressed/activated several times. How can I set the behavior to disable the button after clicking it?

That’s a case of the client misbehaving again. Is it a timing issue where you need to wait several seconds, or does it actually require multiple clicks? And is this the web client or the mobile version?

If I create a chat or stream where the client is a participant the “display name” is a random string. Is it possible to set the “display name” of a client in a chat or stream?

That could be a case where the app isn’t using the /entities route to lookup names so it’s not finding the client. A workaround for this which could help is to create a Contact using the Admin API with contactType = GUEST and set the contactId to the same value as your clientId. The client should then use whatever you set as namefor the Contact.

Scenario:
I’m using a client A to create a direct chat between the client A and a user B.
Once the message C is sent, I use the reply button in the MOWA chat client to reply to the message C the client A sent.
Then I try to get the replies for the message C the client A sent.

Steps:

  • POST to https://chat.eu.api.mitel.io/2017-09-01/conversations to create a direct chat between the client A and the user B.

  • POST to https://chat.eu.api.mitel.io/2017-09-01/conversations/{conversationId}/messages to send a message C from the client A into the direct chat between the client A and the user B.

  • In the MOWA chat client use the reply button to reply to the message C from client A as user B.
    grafik

  • GET https://chat.eu.api.mitel.io/2017-09-01/conversations/{conversationId}/messages/{messageId}/replies to get the replies to the previously sent message.

The result is always the same:

{
  "resourcePath": "/2017-09-01/conversations/{conversationId}/messages/{messageId}/replies",
  "count": 0,
  "_links": {
    "self": "/2017-09-01/conversations/{conversationId}/messages/{messageId}/replies"
  }
}

However if I send a message D as a reply, using the parentMessageId, I see message D as a reply using the steps outlined above.


I can wait for as long as I want the button can still be pressed even if the buttons disableOnClick behavior is set to “true” and the button was already pressed once. So the button can be pressed several times regardless of the disableOnClick behavior. I could only try this in the MOWA chat web client because the action cards weren’t displayed properly in the mobile client.

If I try your suggestion of creating a contact for the client, the name is still only correctly displayed within the chat of the Mitel One Web App. The Chat’s heading displays an “Unkown User”. In the mobile App, the client ID is displayed instead of the name:
grafik

So it seems like the name property of a Contact is only partially used in the Web App and not at all in the mobile App.

Thank you for sending over all this information. I went through the steps to reproduce what you’re doing and I’m running into issues getting the Conversation to be visible. The issues are definitely client side, I’ve sent this over to the Mitel One team and I’ll let you know what they find.

@leonardo.lang Thanks for your patience!

The first thing to mention is that support for MOWA ended about 6 months ago, so we can only really issues in the Mitel One clients. That said, here is where we stand with each issue:

  1. Chat Reply Issue - It turns out that our apps do not actually use the ‘replies’ component of the Chat API, but instead create a normal Message with a contentType of ’ quoted-message’ that references the first Message. That schema isn’t exposed to the API docs, which either tells me that you’re not supposed to know it or we thought no one anyone outside Mitel would ever care about it. I’ve requested it and that will tell me if it’s the former or the latter.

  2. Action Cards in Mitel One Mobile App - I will be raising a bug for this issue and will provide updates as I receive them.

  3. Action Card Buttons not Disabling - I will raise a bug for this as well.

  4. Client in Conversation shows Unknown - When looking up the display name, the Mitel One client searches for Users only, so it will never find the Client. Unfortunately there is no workaround for this one, but it’s still being debated in R&D so we may decide to change this behaviour.

Let me know if you think I’ve missed something.

Cheers,

1 Like

Here’s an example where the Mitel One client used the ‘reply’ function which shows the schema:

{
"body": "{\"cite\":{\"messageId\":\"623e1d45-09e1-4a7c-a3d8-540fa9cdb07e\",\"createdBy\":\"9346652d-bbf3-41ba-a374-811e08e18557\",\"createdOn\":\"2023-06-02T19:15:14.249Z\",\"body\":\"Inner message\"},\"content\":{\"body\":\"Quoted msg\",\"contentType\":\"text/plain\"}}",
"contentType": "application/vnd.mitel.quoted-message",
"fallbackText": "\"Inner message\": Quoted msg",
"tag": "{\"sendId\":\"d4f9f953-ca72-4026-8ef9-00b1507de551\"}"
}

Hi @budd.renaud have there been any changes, updates or bugfixes concerning the listed issues?

Hi @leonardo.lang - Thanks for keeping me honest on this one and sorry for the delay in following up. I’ve asked R&D for an update on the two bugs that have been raised. For future reference, they are:

ONE-8962 (Action Cards not displaying on mobile)
ONE-8961 (disableOnClick behaviour issues)

Cheers,

@leonardo.lang - It looks like action cards are not supported in Mitel One, so the fact that they work at all is coincidental. R&D is evaluating the possibility of adding support for them in the near future, I’ll let you know what comes out of that conversation.

@leonardo.lang I’m afraid we will not be introducing support for Action Cards in Mitel One. We will update any documentation that references this functionality.

@budd.renaud Thanks for the follow up. I’ll keep it in mind for future reference.

@leonardo.lang - We’re revisiting the action card issues that you raised. Can you please provide an example of an action card that you’re trying to use that includes the ‘disableOnClick’ property? Please include the full request body that you’re using to create the chat message with POST /conversations/{conversationId}/messages

Hi @budd.renaud as far as I could gather from my old logs the following is an example request I used to test the Action Card behaviour.

{"contentType": "application/vnd.mitel.action-card", "body": "{\"body\": \"Let's Go!!\", 
\"bodyContentType\": \"text/plain\", \"buttons\": [{\"title\": \"Acknowledge\", 
\"action\": \"open-link\", \"targetUrl\": \"https://github.com/\", 
\"behavior\": {\"disableOnClick\": \"true\"}}, {\"title\": \"Reject\", 
\"action\": \"post-quoted-message\", \"behavior\": {\"disableOnClick\": \"true\"}}]}", 
"fallbackText": "Let's Go!!"}

Thank you @leonardo.lang - We had closed this issue but I’ll ask R&D to revisit it now that we have an example from you.