0
votes

I trying to create a new conversation with person or group of persons, so I create a Bearer token for authentication and add it to header as bearer token (in postman).

So on the next step I create a json script that, theoretically, can create a new conversation. I trying to create a conversation with several person or with only one (for it I added a several person to members or one and change flag isGroup to true or false).

This is a example of json for 1 person:

{
    "bot": {
        "id": "<app id>",
        "name": "<bot name>"
    },
    "isGroup": false,
    "members": [
       {
            "id": "<member id>",
            "name": "<member name>"
        }
    ],
    "topicName": "Hello there!"
}

Member id is correct for all members that I trying to add in a new conversation.

And the next response I get always:

{
    "id": "8:live:<skype account name>"
}

For group conversation I get the this live skype name for first person that I added. All requests was send to https://skype.botframework.com/v3/conversations or https://smba.trafficmanager.net/apis/v3/conversations and response always same.

Can someone tell me what I'm doing wrong?

Also if I add Activity in body like:

"activity": 
    { 
        "type": "message", 
        "from": 
        { 
            "id": "<app-id>", 
            "name": "<bot name>" 

        },
        "recipient": 
        { 
            "id": "<member id>", 
            "name": "<member name>" 
        }, 
        "text": "HI" 
    }

I get next response:

{ 
    "error": 
    { 
        "code": "ServiceError", 
        "message": "Unknown" 
    } 
}
1
Please do not post code in comments, even if it's just JSON. Edit the question to include the formatted JSON.Kyle Delaney
Why did you remove information from your question?Kyle Delaney
I moved information into question.Nikita Kovaleov
Look at the edit history. Your last edit was to remove 470 characters: stackoverflow.com/posts/56577717/revisionsKyle Delaney
Yes. I still working on this.Nikita Kovaleov

1 Answers

0
votes

Because Skype only allows one conversation between any two given users, what looks like a simple user ID is actually enough for the Bot Framework to identify the conversation. Some channels, Skype included, allow more than one ID format. In the case of Skype, each conversation can be identified in two ways:

  • < number >:< Skype screen name >
  • < number >:< base64 string >

For example, when I create a conversation in Skype, I get the ID 8:kyle-delaney. I can use that to send a message to the conversation with the following endpoint:

https://smba.trafficmanager.net/apis/v3/conversations/8:kyle-delaney/activities

However, when my bot receives a message from the user, both the conversation ID and the "from" ID will be 29:1CpqzpVMMhfi_2nyS1g2mfHaCxnvGL0sF8LbnGadyR_Y. So I can also send a message to the same conversation using this endpoint:

https://smba.trafficmanager.net/apis/v3/conversations/29:1CpqzpVMMhfi_2nyS1g2mfHaCxnvGL0sF8LbnGadyR_Y/activities