Get list of conversations a bot has participated in from BotConnectorAPI

Copper Contributor

Hi! My team is building a Microsoft Teams bot, and we are trying to get a list of conversations (channels) that the bot has participated in using the BotConnectorAPI.

 

We are trying to use this endpoint: https://learn.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-connector-api-refere..., however we keep getting 405 errors "The requested resource does not support http method 'GET'". Are we doing something wrong, or is there any other endpoint we can use?

 

 

Screenshot 2024-02-29 at 3.31.40 PM.png

9 Replies

Hello @jlincroft ,
Try generating access token from below link-
https://learn.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-connector-authentica...
And follow the below endpoint for getting the list of conversation has participated in-
/v3/conversations?continuationToken={continuationToken}
Note- Continuation token can be obtained from GetConversationsAsync, since it uses the GET Conversations API.

Hi @Vaibhav-MSFT 

 

Yes, I have generated the access token and included it in the request.

 

What do you mean by GetConversationsAsync? The endpoint I'm trying to call is the one you listed, /v3/conversations, but is returning a 405. Is the continuation token required for that endpoint?

Hello @jlincroft ,
Yes, the continuation token is required for the endpoint.
GetConversationsAsync method uses the Get Conversations API. This API must be called many times in sequence in order to retrieve all the conversations a bot has participated in.
And can you confirm if you still getting 405 error?

@Vaibhav-MSFT 

 

How do I get the continuation token to use in the first request?

 

Yes, I am still getting 405 errors.

@jlincroft ,
The continuation token is used to help each call continue where the last one left off. Therefore, the first call needs no continuation token. For each subsequent call, you should use the continuation token from the conversations result returned by the previous call.

@Vaibhav-MSFT 

 

So just to be clear, you're saying the continuation token is not required for the first call?

So if I call GET /v3/conversations with a valid access token, I should not be getting 405s? (This is what I'm getting currently)

@Vaibhav-MSFT 

 

image (4).png

 

We found this note in the documentation here (https://learn.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-connector-api-refere...). Does this mean we will not be able to use this endpoint to get the list of conversation a bot has participated in for a Microsoft Teams tenant installation?

Hi @Vaibhav-MSFT , just checking if you saw this!

 

Thanks!

Jackie

Hello @jlincroft ,
We are able to repro this issue. We have raised a bug for the same.
Thanks!!