Graph API: I cant create a call peer to peer

Copper Contributor

Hi All! I am trying to create a peer-to-peer call with the /communications/calls api using the following request:

 

{
  "@odata.type": "#microsoft.graph.call",
  "callbackUri": "https://my-endpoint.com/endpoint",
  "source": {
        "@odata.type": "#microsoft.graph.participantInfo",
        "identity": {
            "@odata.type": "#microsoft.graph.identitySet",
            "user": {
                "@odata.type": "#microsoft.graph.identity",
                "displayName": "User0",
                "id": "xxx-xxxx-xxxx-xxxx",
                "tenantId": "asd-asd-asd-asd"
            }
        }
    },
  "targets": [
    {
      "identity": {
        "user": {
          "displayName": "User1",
          "id": "xxx-xxx-xxx-xxx",
          "tenantId": "asd-asd-asd-asd"
        }
      }
    }
  ],
  "requestedModalities": [
    "audio"
  ],
 "mediaConfig": {
    "@odata.type": "#microsoft.graph.serviceHostedMediaConfig"
  },
  "tenantId": "asd-asd-asd-asd"
}

 

 

But I am getting the next error:

 

 

{
    "error": {
        "code": "7507",
        "message": "Call source identity invalid.",
        "innerError": {
            "date": "2022-07-20T11:27:45",
            "request-id": "23e7b220-f593-4fdf-baac-25acd435c92e",
            "client-request-id": "23e7b220-f593-4fdf-baac-25acd435c92e"
        }
    }
}

 

 

The documentation says that peer to peer calls are supported.

 

What could be happening?

 

Thanks in advance.

3 Replies

@mpaludi00 -

Please verify if the ApplicationId in teams app instance has the same ApplicationId from your bot registered in Bot Services:

Using teams powershell module: Get-CSOnlineApplicationInstance

or update it using Set-CsOnlineApplicationInstance -ApplicationId <AppId from bot>

Also, make sure that the applicationInstance.Id in the request body is the applicationInstance.objectId from teams application instance.


Thanks, 

Prasad Das

-----------------------------------------------------------------------

If the response is helpful, please click "**Mark as Best Response**" and like it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate. 




The application id is the same in both places (Bot and My App on azure).
Regarding your last suggestion about the applicationInstance.Id , I am not passing that argument as a source, as I want the source to be a user.

What I need is to generate a peer-to-peer but not have the bot start it, otherwise it creates a conference. Is that possible? @Prasad_Das-MSFT 

Thanks for the quick response, I hope you can continue to help me.