cancel
Showing results for 
Search instead for 
Did you mean: 

MS Teams 메세지 발송

DongJaeAhn
Level 2

안녕하세요.

Microsoft Graph - Teams 오브젝트를 활용한 팀즈 메세지 발송에 문제가 생겨 글 남깁니다.

35457.png
현재 Microsoft Graph - Teams 오브젝트의 Send Chat Mesaage 액션을 이용하려 하고 있습니다.
MSAL.NET오브젝트로 Get Auth Token - Client Secret 액션을 이용하여 AccessToken까지는 잘 얻어 왔습니다만, 해당 오류를 내며 진행이 안되고 있는 상황입니다.

"Message POST is allowed in application-only context only for import purposes. Refer to https://docs.microsoft.com/microsoftteams/platform/graph-api/import-messages/import-external-messages-to-teams for more details."

35458.png35459.png
권한의 문제인지 방법의 문제인지 갈피를 잡지 못해 질문 드립니다.

1 REPLY 1

Dohyeong.Kim
Staff
Staff

안녕하세요, 

Return된 에러메시지의 내용이 401 HTTP status code이고, 내용도 Unauthorized로 된 것을 보았을때 인증이나 권한과 관련된 문제로 보입니다.
안내 받으신 에러 메시지로 검색을 해보니, 아래와 같이 팀즈 계정에서 Permissions을 조정하는 작업 등이 필요해 보입니다.

Permissions

One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.

Permission type Permissions (from least to most privileged)
Delegated (work or school account) ChannelMessage.Send, Group.ReadWrite.All**
Delegated (personal Microsoft account) Not supported.
Application Teamwork.Migrate.All

Note: Permissions marked with ** are supported only for backward compatibility. We recommend that you update your solutions to use an alternative permission listed in the previous table and avoid using these permissions going forward.

Note: Application permissions are only supported for migration. In the future, Microsoft may require you or your customers to pay additional fees based on the amount of data imported.


마이크로소프트 사에서 제공하는 문서 경로를 아래에 추가하여 드립니다.
도움 되시면 좋겠습니다. 감사합니다.

에러메시지가 확인된 질문 페이지:
https://learn.microsoft.com/en-us/answers/questions/1168205/i-cant-send-message-in-chat-with-microsoft-graph-a

마이크로소프트 Graph 매뉴얼 페이지(Send chatMessage in channel)
https://learn.microsoft.com/en-us/graph/api/channel-post-messages?view=graph-rest-1.0&tabs=http#permissions:%7E:text=Note%3A%20Application%20permissions%20are%20only%20supported%20for%20migration.%20I....