question

ArkaDutta-6370 avatar image
0 Votes"
ArkaDutta-6370 asked Vijaykanth-9346 commented

graph rest api to send a message to a teams channel failing

Request =>


curl --location --request POST 'https://graph.microsoft.com/v1.0/teams/{teamId}/channels/{channelId}/messages' \
--header 'Authorization: Bearer <bearer_token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"body": {
"content": "Dude !!! Please work"
}
}'

Response =>

{
"error": {
"code": "InternalServerError",
"message": "Unable to find target address",
"innerError": {
"date": "2021-09-27T18:23:48",
"request-id": "2edd2854-1edc-47b8-aa1b-52e8e252f767",
"client-request-id": "2edd2854-1edc-47b8-aa1b-52e8e252f767"
}
}
}

teamId and channelId s are fetched from the graph API itself for the same.

What am I doing wrong here. Have followed as per this blog => https://docs.microsoft.com/en-us/graph/api/chatmessage-post?view=graph-rest-1.0&tabs=http

microsoft-graph-applications
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

CarlZhao-MSFT avatar image
0 Votes"
CarlZhao-MSFT answered Vijaykanth-9346 commented

This is an error caused by your personal account. Personal microsoft account is not currently supported. You need to switch to a work/school account.

135619-image.png

135724-image.png



If an Answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.




image.png (17.2 KiB)
image.png (66.8 KiB)
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi, @ArkaDutta-6370 Would you please provide us with an update on the status of your issue?

0 Votes 0 ·

Hi @CarlZhao-MSFT, I had similar issue
{
"error": {
"code": "InternalServerError",
"message": "Unable to find target address",
"innerError": {
"date": "2022-05-11T09:00:47",
"request-id": "e735d22d-e788-469d-afbc-954f6f60e840",
"client-request-id": "e86da880-ff14-de48-f2e6-15c94fa02a60"
}
}
}
Found this thread.. and your answer. I have asked my Admin to Enable Permissions. But they could not enable it.
I have logged in with Work Account but still getting the same response. Could you please provide steps to enable these permissions? Would appreciate your help here. Thanks much!

200952-app-permissions-ushur-ms-account.png200876-graph-api-error.png


0 Votes 0 ·

Hi @Vijaykanth-9346

Can you open a new thread? Then share me the link of the new thread, which I will research in the new thread. Thank you very much!

1 Vote 1 ·