Home

Calling a bot endpoint and answer

%3CLINGO-SUB%20id%3D%22lingo-sub-905483%22%20slang%3D%22en-US%22%3ECalling%20a%20bot%20endpoint%20and%20answer%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-905483%22%20slang%3D%22en-US%22%3E%3CP%3EI%20built%20a%20bot%20in%20Teams%20which%20have%20the%20following%20Calling%20endpoint.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20585px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F136638i3E4454BAEC35E937%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Capture.JPG%22%20title%3D%22Capture.JPG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3Ewhen%20the%20bot%20is%20called%2C%20i%20receive%20the%20following%20message%20at%20my%20Api%20endpoint%20via%20the%20%22AnswerCall%22%20method%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%7B%0A%20%20%22id%22%3A%20%221adecac7-2911-4335-8253-362c59694c56%22%2C%0A%20%20%22participants%22%3A%20%5B%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%22identity%22%3A%20%2229%3A1IwDeUzZgQ07weRUHF187SDIUrN-pe6Q95bQMHq-uDoPHHA_RjxFHIy-Qa0BeTUDyLfpKNVQp6TmETTF6MqB3Rw%22%2C%0A%20%20%20%20%20%20%22participantId%22%3A%20%22948a3788-0318-48ef-bd38-14d825f41d45%22%2C%0A%20%20%20%20%20%20%22endpointId%22%3A%20%22da4303d8-e86b-44dc-9e1d-120db8a7b60e%22%2C%0A%20%20%20%20%20%20%22languageId%22%3A%20%22en-US%22%2C%0A%20%20%20%20%20%20%22tenantId%22%3A%20%22664f8a72-63a7-4e25-b660-c4dd7c962773%22%2C%0A%20%20%20%20%20%20%22region%22%3A%20%22emea%22%2C%0A%20%20%20%20%20%20%22originator%22%3A%20true%2C%0A%20%20%20%20%20%20%22isHidden%22%3A%20false%2C%0A%20%20%20%20%20%20%22endPointType%22%3A%20%22default%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%22identity%22%3A%20%2228%3Aa368f612-e639-42eb-b63e-1c7199f1433f%22%2C%0A%20%20%20%20%20%20%22participantId%22%3A%20%221adecac7-2911-4335-8253-362c59694c56%22%2C%0A%20%20%20%20%20%20%22endpointId%22%3A%20%2200000000-0000-0000-0000-000000000000%22%2C%0A%20%20%20%20%20%20%22originator%22%3A%20false%2C%0A%20%20%20%20%20%20%22isHidden%22%3A%20false%2C%0A%20%20%20%20%20%20%22endPointType%22%3A%20%22default%22%0A%20%20%20%20%7D%0A%20%20%5D%2C%0A%20%20%22isMultiparty%22%3A%20false%2C%0A%20%20%22presentedModalityTypes%22%3A%20%5B%0A%20%20%20%20%22audio%22%0A%20%20%5D%2C%0A%20%20%22callState%22%3A%20%22incoming%22%2C%0A%20%20%22tenantId%22%3A%20%22664f8a72-63a7-4e25-b660-c4dd7c962773%22%0A%7D%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eaccording%20to%20this%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Fcall-get%3Fview%3Dgraph-rest-beta%26amp%3Btabs%3Dhttp%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Edocumentation%3C%2FA%3E%26nbsp%3Bi%20should%20be%20able%20to%20answer%20or%20get%20the%20call%20by%20calling%20Graph%20API.%3C%2FP%3E%3CP%3EGET%20%2Fapp%2Fcalls%2F%7Bid%7D%3C%2FP%3E%3CP%3EGET%20%3CA%20href%3D%22https%3A%2F%2Fgraph.microsoft.com%2Fbeta%2Fapp%2Fcalls%2F%7Bid%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fbeta%2Fapp%2Fcalls%2F%7Bid%3C%2FA%3E%7D%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ebut%20i%20always%20receive%20the%20following%20error%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%7B%0A%20%20%22error%22%3A%20%7B%0A%20%20%20%20%22code%22%3A%20%22BadRequest%22%2C%0A%20%20%20%20%22message%22%3A%20%22Resource%20not%20found%20for%20the%20segment%20'calls'.%22%2C%0A%20%20%20%20%22innerError%22%3A%20%7B%0A%20%20%20%20%20%20%22request-id%22%3A%20%22886f8e9b-522f-40e0-a10f-ced9a054708e%22%2C%0A%20%20%20%20%20%20%22date%22%3A%20%222019-10-10T14%3A08%3A10%22%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20Question%20is%3A%3C%2FP%3E%3CP%3Eam%20i%20using%20the%20correct%20call%20Id%20from%20the%20message%3F%3C%2FP%3E%3CP%3E%22id%22%3A%20%221adecac7-2911-4335-8253-362c59694c56%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EP.S%3A%20I%20can%20call%20other%20Graph%20API%20(Beta%20version)%20Methods%20like%20Get%20Users%20and%20it%20works.%20so%20i%20don't%20have%20any%20authentication%20problem.%20and%20also%20i%20set%20all%20the%20permission%20which%20is%20required%20for%20my%20app%20in%20AAD.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20%2C%3C%2FP%3E%3CP%3EE.A%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-905483%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ECalling%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-964925%22%20slang%3D%22en-US%22%3ERe%3A%20Calling%20a%20bot%20endpoint%20and%20answer%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-964925%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F120872%22%20target%3D%22_blank%22%3E%40Ehsan%20Amini%3C%2FA%3E%20You%20cannot%20do%20a%20GET%20%2Fcalls%2F%7Bid%7D%20till%20after%20the%20call%20has%20been%20answered.%20After%20the%20call%20is%20ended%2C%20the%20call%20will%20be%20deleted%20in%20PMA.%20Get%20call%20will%20result%20an%20error.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Ehsan Amini
Regular Visitor

I built a bot in Teams which have the following Calling endpoint.

 

Capture.JPG

when the bot is called, i receive the following message at my Api endpoint via the "AnswerCall" method:

 

 

{
  "id": "1adecac7-2911-4335-8253-362c59694c56",
  "participants": [
    {
      "identity": "29:1IwDeUzZgQ07weRUHF187SDIUrN-pe6Q95bQMHq-uDoPHHA_RjxFHIy-Qa0BeTUDyLfpKNVQp6TmETTF6MqB3Rw",
      "participantId": "948a3788-0318-48ef-bd38-14d825f41d45",
      "endpointId": "da4303d8-e86b-44dc-9e1d-120db8a7b60e",
      "languageId": "en-US",
      "tenantId": "664f8a72-63a7-4e25-b660-c4dd7c962773",
      "region": "emea",
      "originator": true,
      "isHidden": false,
      "endPointType": "default"
    },
    {
      "identity": "28:a368f612-e639-42eb-b63e-1c7199f1433f",
      "participantId": "1adecac7-2911-4335-8253-362c59694c56",
      "endpointId": "00000000-0000-0000-0000-000000000000",
      "originator": false,
      "isHidden": false,
      "endPointType": "default"
    }
  ],
  "isMultiparty": false,
  "presentedModalityTypes": [
    "audio"
  ],
  "callState": "incoming",
  "tenantId": "664f8a72-63a7-4e25-b660-c4dd7c962773"
}

 

 

according to this documentation i should be able to answer or get the call by calling Graph API.

GET /app/calls/{id}

GET https://graph.microsoft.com/beta/app/calls/{id}

 

but i always receive the following error:

 

{
  "error": {
    "code": "BadRequest",
    "message": "Resource not found for the segment 'calls'.",
    "innerError": {
      "request-id": "886f8e9b-522f-40e0-a10f-ced9a054708e",
      "date": "2019-10-10T14:08:10"
    }
  }
}

 

 

The Question is:

am i using the correct call Id from the message?

"id": "1adecac7-2911-4335-8253-362c59694c56"

 

P.S: I can call other Graph API (Beta version) Methods like Get Users and it works. so i don't have any authentication problem. and also i set all the permission which is required for my app in AAD.

 

Thank you ,

E.A

1 Reply
Highlighted

@Ehsan Amini You cannot do a GET /calls/{id} till after the call has been answered. After the call is ended, the call will be deleted in PMA. Get call will result an error.

Related Conversations