How to correctly set up a call initialization API request ( communications/calls endpoint )

Bennse 1 Reputation point
2022-05-17T11:53:40.127+00:00

Hello,

I am trying to build a Microsoft Teams Bot/App which can initiate Calls to someone via Chatcommand (so basically using the Graph API) (in Python) .
Since the documentation on the topic quite complex and confusing (because it doesn't say what it needs and what it doesn't need) I am kinda lost on that.
When I try to call the API endpoint, the response contains: “error”:{“code”:“BadRequest”,“message”:“Resource not found for the segment ‘communications’.}

Sadly I am unable to find any information about that on the net nor does the documentation contain information about possible errors and how to fix them.

My API call is a POST request to: "https://graph.microsoft.com/v1.0/communication/calls" with the accesstoken as authentication (which works, tried on other endpoint).

I most likely have the error in the data I give since it's only (with variable "call" being the Useridentity I want to call in that request. For testingpurpose how to even get the call working):
data = {
"targets": [{"identity": call}]
}

Would be awesome if someone could help me.

Cheers, Bennse

Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Shivam Dhiman 6,081 Reputation points
    2022-06-03T15:22:54.36+00:00

    Hi @Bennse

    As per the issue description mention the endpoint which you are using is missing character 's' in communication as per the Graph documentation. Please refer to this documentation.

    Use this Graph API endpoint
    POST https://graph.microsoft.com/v1.0/communications/calls

    Hope this helps,

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have further questions about this answer, please click "Comment".

    0 comments No comments

  2. Mariano Paludi 1 Reputation point
    2022-07-18T18:11:42.487+00:00

    Hello everybody! Is possible initiate a call between two users?
    For example:

    Using this Graph API endpoint: POST https://graph.microsoft.com/v1.0/communications/calls

    and in the request body put as a source an user.

    {  
      "@odata.type": "#microsoft.graph.call",  
      "callbackUri": "link",  
      "source": {  
            "@odata.type": "#microsoft.graph.participantInfo",  
            "identity": {  
                "@odata.type": "#microsoft.graph.identitySet",  
                "user": {  
                    "@odata.type": "#microsoft.graph.identity",  
                    "displayName": "User1",  
                    "id": "asd-asd-asd-asd  
                }  
            }  
        },  
      "targets": [  
        {  
          "identity": {  
            "user": {  
              "displayName": "User2",  
              "id": "123-123-123-123"  
            }  
          }  
        }  
      ],  
      "requestedModalities": [  
        "audio"  
      ],  
     "mediaConfig": {  
        "@odata.type": "#microsoft.graph.serviceHostedMediaConfig"  
      },  
      "tenantId": "asd"  
    }  
    

    I am trying this but, I get an error:

    {  
        "error": {  
            "code": "7507",  
            "message": "Call source identity invalid.",  
            "innerError": {  
                "date": "2022-07-18T16:59:56",  
                "request-id": "asd",  
                "client-request-id": "asd"  
            }  
        }  
    }  
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.