Search code examples
javabotframeworkskypeskype-botsmicrosoft-skype-bot

Skype conversation uri doesn`t work in card button


Well, in the beginning I have to describe that kind of case I want implement:

I implementing a skype bot that will be create and send conversation link to users as basic card with button. I need to create invitation link into a conversation for users. The bot does not have to be a participant in the conversation.

What I write for it:

BasicCard basicCard = new BasicCard()
        .withTitle("Title")
        .withButtons(Collections.singletonList(new CardAction()
                .withType(ActionTypes.OPEN_URL)
                .withTitle("Button text")
                .withValue("skype:28:long-id-separated-hyphen-bot;29:long-id-separated-hyphen-user1;29:long-id-separated-hyphen-user2?chat&topic=Conv%20Name")
        ));

Attachment attachment = new Attachment()
        .withContentType("application/vnd.microsoft.card.hero")
        .withContent(basicCard);

Activity activity = new Activity()
        .withType(ActivityTypes.MESSAGE)
        .withFrom(botAccount)
        .withRecipient(account1)
        .withAttachments(Collections.singletonList(attachment));

connector.get().conversations().sendToConversation("29:long-id-separated-hyphen-user1", activity);

And send it to the user1, but link doesn`t work.

I use https://learn.microsoft.com/en-us/skype-sdk/skypeuris/skypeuriapireference and in this documentation, was written what I need just create link like this skype:28:long-id-separated-hyphen-bot;29:long-id-separated-hyphen-user1;29:long-id-separated-hyphen-user2?chat&topic=Conv%20Name, but it doesn`t work..

May be I don`t understand what the link should look like for creating and adding users to the conversation.

If I can`t create link for invitation users into conversation, how can I create group conversation and invite some peoples to that conversation? (All users has conversation with bot and I know theirs ids(29:long-id-separated-hyphen-user) and live ids(8:user-id))

Can anyone explain?


Solution

  • After some more testing, I've found that Skype URI's do not support multi chats. Even if they did, you're trying to use ID's from the Bot Framework, which would be incompatible. Skype hides a user's real ID from the bot, so there's no way to exchange the ID's you have for usable ID's. Furthermore, Skype bots are becoming deprecated. I feel like what you're trying to do just isn't possible.

    You can create a link to join a group conversation manually using the UI, but that seems to be the only way. Skype has been heavily limiting its API so many things cannot be automated.

    This documentation seems to be outdated. However, you can see in the caveats that the problem always existed on Android:

    Android recognizes the initial participant only; multi chats are not supported.

    The Android behavior now appears to be true for all platforms. You can test this yourself by entering Skype URI's into your browser bar. skype:asdf?chat and skype:asdf;qwer?chat will both open a conversation only with asdf. Multi chats from a URI are apparently not supported on any platform.