I want to send message to channel using python script automatically. It should be automatic , which code flow i can use . I tried with client_credentials flow , but it was not working

Anonymous
2023-02-04T11:05:47.32+00:00

I tried with RPOC Flow , but i am getting following error

{"error":"interaction_required","error_description":"AADSTS50076: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access '00000003-0000-0000-c000-000000000000'.\r\nTrace ID: dec5910b-759f-413d-80ae-ceca828bc500\r\nCorrelation ID: 784090e5-e587-47e0-bd77-ca8ce04a30ac\r\nTimestamp: 2023-02-04 11:02:24Z","error_codes":[50076],"timestamp":"2023-02-04 11:02:24Z","trace_id":"dec5910b-759f-413d-80ae-ceca828bc500","correlation_id":"784090e5-e587-47e0-bd77-ca8ce04a30ac","error_uri":"https://login.microsoftonline.com/error?code=50076","suberror":"basic_action"}

I tried with client_credentials , but i am getting following error

{'error': {'code': 'Forbidden', 'message': "Missing role permissions on the request. API requires one of 'Teamwork.Migrate.All, ChannelMessage.ReadWrite.All'. Roles on the request 'ChannelMessage.Read.All, ChannelMessage.UpdatePolicyViolation.All'.", 'innerError': {'date': '2023-02-04T11:03:13', 'request-id': '47147f1f-ecd7-4beb-9565-d8e260e644e8', 'client-request-id': '47147f1f-ecd7-4beb-9565-d8e260e644e8'}}}

I don't see ChannelMessage.ReadWrite.All in the application level graph permissions.

I tried with generating access_token using auth code flow method , it works , but we need to pass code after login into browser , which is not automated way.

Can you please help us ..hot to send message to channel in automated way?

Microsoft Teams Development
{count} votes

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.