26
Views
13
Comments
Solved
Microsoft Teams Connector - 400 Bad Request Error

Hi Guys,

              Requirement is that i need to connect chat functionalities with Microsoft Teams. In forge i found Microsoft Teams Connector and followed everything. I created Azure AD account and passed Tenant Id, ClientId, ClientName, UserName and Password. But it showing 400 Bad Request error. Anybody tried this component? Kindly update if you have worked on this. 

regards,

Naveen

Rank: #95
Solution

Hi Naveen,


You manage to make some progress, great!

Regarding the get users service, the web service called is this one and according to Microsoft Graph API documentation, these are the permissions that need to be granted on the side of Azure to the user you use to get the token:



Once you select the user and proceed to send the message, please also take into account that Microsoft Graph API's Chat services for 1-1 conversations (not channels) are limited by the following:



Hope it helps.


Cheers,

João

Rank: #95

Hi Naveen,


I have worked with this component successfully, we use it in an application without a problem.

Also, I would ask you to create this issue on the Forge component page on Support, so the creators of the component can be notified and can get back to you quickly.


Have you checked your Service Center logs?

As you can read here, executing an action in Microsoft Teams supposes several web services. For instance, sending a message to a channel presumes: 1) doing login 2) getting a team 3) getting a channel 4) sending a message.

Your error might be occurring in any one of them.

So you should turn the web services log to Full Log and analyse the logs from there.


I suggest you to do this analysis with your Azure admin since it is likely something to do with permissions and he can grant them to your user (for example, showing users, implies having permissions to show users; sending a channel presumes getting the channel by name which has some specific permissions).


Hope it helps.


Cheers,

João

Rank: #6000

Hi Joao Marques,

                                 

I would like the say the flow which i followed. First of all, I created 2 users. User1@outlook.com and User2@outlook.com.  

I opened https://portal.azure.com and logged with User1@outlook.com , created application. Now i got TenantId, ClientId, ClientName, Scope. 

I passed this values in screen and username as user1@outlook.com. then i got 400 Bad Request error. Might be I missed something here.

I checked in service center logs, kindly find the attachments


Kindly find where i am making mistakes.

regards,

Naveen

joao2.png

Rank: #95

Hi Naveen,


Have you checked the permissions which are required for the web service calls you are calling with the graph api links I gave you?

Have you confirmed your user has the permissions needed to call the api's you are calling?

Have you turned the full log on web services to try to understand where the error is? (See here how).

Have you debugged the call to see which service is failing?


Cheers,

João

Rank: #6000

Hi Joao Marques,

                           I tired with 2 Outlook users which is created by own, I got 400 Bad Request error. Now I tired with my office Azure AD account. Its connected now, no 400 Bad Request error is there. But while fetching users am getting 401 Unauthorized error and getting empty data in users dropdown. Its related to permission right. I gave permission and added my account as a Owner in Azure App. Not yet fixed. Any other rights we need to provide? 


regards,

Naveen

Rank: #95
Solution

Hi Naveen,


You manage to make some progress, great!

Regarding the get users service, the web service called is this one and according to Microsoft Graph API documentation, these are the permissions that need to be granted on the side of Azure to the user you use to get the token:



Once you select the user and proceed to send the message, please also take into account that Microsoft Graph API's Chat services for 1-1 conversations (not channels) are limited by the following:



Hope it helps.


Cheers,

João

Rank: #6000

Hi Joao Marques


As per the document, I gave the permissions to application in Azure, still same 401 Unauthorized error in User_GetUsers action.


regards,

Naveen

Rank: #6000

Hi Joao Marques,

I have some questions sir.

1. Is it possible to connect with non microsoft account

2. we are planning to use this component for endusers chatting,  enduser may have different domain accounts

3. we are planning to connect for Video Call also, so that can you help us in this?


regards,

Naveen

             

Rank: #95

Hi Naveen,


Regarding your error, I suggest you check again the permissions in Azure (in delegated mode). Following the instructions, I manage to make it work as you can see on the screenshot below:



Regarding your questions:


1 and 2. Is it possible to connect with non microsoft account

You can find your answer in detail with a simple Google search.


2. we are planning to connect for Video Call also, so that can you help us in this?

Taking a look at the Microsoft Graph API documentation, there are APIs for that so it is possible.

This component does not have calling functionality yet but it can definitely be something to explore and eventually include in a later version.

As you can understand, I have other assignments and cannot put a timetable on that.


Cheers,

João



Rank: #6000

Hi Joao Marques,

                             https://developer.microsoft.com/en-us/graph/graph-explorer 

This link is very useful for finding the right api permissions for each api url from Microsoft graph API.


regards,

Naveen