Forum Discussion
JFM_12
Jul 30, 2024Iron Contributor
List of Teams with uses Connectors
Hello Is there a way (Powershell, Power BI) to get a list of the Teams who use connectors and which ones (Name) they use? We have 180k teams but want only the teams that use the connectors and have...
- Aug 06, 2024
JFM_12 - The error message you're seeing,
(403) Forbidden, indicates that the request you're making usingInvoke-RestMethodin PowerShell is being blocked due to permission issues.
1. Verify API Permissions
Make sure that the API endpoint you're trying to access is properly authorized and that the token or credentials used in the request have the correct permissions.-
Check API Documentation: Ensure you have the correct permissions for the API you're calling. For Microsoft Teams APIs, this often means ensuring that your app has the required permissions granted in Azure AD.
-
Check Azure AD Permissions: If you're using OAuth tokens, ensure that your Azure AD application has the necessary permissions (e.g.,
Group.Read.All,User.Read.All, etc.) and that these permissions have been granted and consented to by an administrator.
2. Validate Authentication
Ensure your authentication token or credentials are correct and valid:
-
Generate a New Token: If you're using OAuth tokens, generate a new one and ensure it's being passed correctly in the request headers.
-
Check Token Expiry: Tokens have a limited lifespan. Verify that the token you're using has not expired.
The(403) Forbiddenerror typically means that authentication or authorization is failing. By verifying permissions, ensuring correct authentication, and inspecting request details, you can usually resolve such issues.
-
JFM_12
Jul 31, 2024Iron Contributor
Hi Sayali-MSFT
Thank you very much.
Yes I know, that is why I want to contact our users to let them know.
I will try it.
Have a great time
JFM_12
JFM_12
Aug 05, 2024Iron Contributor
Sayali-MSFT
Hello
I have tried to run the script.
Unfortunately I get the error
Invoke-RestMethod : The remote server returned an error: (403) Forbidden.
At line:22 char:10
+ $teams = Invoke-RestMethod -Method Get -Uri $teamsUrl -Headers @{ Aut ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Do you have an idea
Regards
JFM_12
- Sayali-MSFTAug 06, 2024
Microsoft
JFM_12 - The error message you're seeing,
(403) Forbidden, indicates that the request you're making usingInvoke-RestMethodin PowerShell is being blocked due to permission issues.
1. Verify API Permissions
Make sure that the API endpoint you're trying to access is properly authorized and that the token or credentials used in the request have the correct permissions.-
Check API Documentation: Ensure you have the correct permissions for the API you're calling. For Microsoft Teams APIs, this often means ensuring that your app has the required permissions granted in Azure AD.
-
Check Azure AD Permissions: If you're using OAuth tokens, ensure that your Azure AD application has the necessary permissions (e.g.,
Group.Read.All,User.Read.All, etc.) and that these permissions have been granted and consented to by an administrator.
2. Validate Authentication
Ensure your authentication token or credentials are correct and valid:
-
Generate a New Token: If you're using OAuth tokens, generate a new one and ensure it's being passed correctly in the request headers.
-
Check Token Expiry: Tokens have a limited lifespan. Verify that the token you're using has not expired.
The(403) Forbiddenerror typically means that authentication or authorization is failing. By verifying permissions, ensuring correct authentication, and inspecting request details, you can usually resolve such issues.
- JFM_12Aug 06, 2024Iron Contributor
- Sayali-MSFTAug 07, 2024
Microsoft
JFM_12 - Could you please share your valuable feedback via Microsoft Teams Developer Feedback link.
https://forms.office.com/Pages/ResponsePage.aspx?id=v4j5cvGGr0GRqy180BHbR7iCOpS5_b9Nqmwx43u5rtZUOThVR081SllSR05aSDQxQ0tUMDVPTVIxTi4u
-