Microsoft-graph-docs: Bad Request - Write requests are only supported on contained entities when trying to create chat message

Created on 13 Oct 2020  Â·  8Comments  Â·  Source: microsoftgraph/microsoft-graph-docs

Hi All,

I used to be able to send a chat fine by posting to https://graph.microsoft.com/beta/me/chats/chat id/messages however now i'm getting a bad request error with the message... Write requests are only supported on contained entities
What's changed? Why does it no longer work?

Fiddler
Request
POST https://graph.microsoft.com/beta/me/chats/19:4f53324c-0316-48eb-a0a5-804465b74b87_f697803e-1120-4335-bba4-e30e608ab176@unq.gbl.spaces/messages HTTP/1.1
Host: graph.microsoft.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:81.0) Gecko/20100101 Firefox/81.0
Accept: /
Accept-Language: en-GB,en;q=0.5
Accept-Encoding: gzip, deflate, br
Referer: https://developer.microsoft.com/en-us/graph/graph-explorer
Content-Type: application/json
SdkVersion: GraphExplorer/4.0, graph-js/2.0.0 (featureUsage=6)
Authorization: Bearer .....
client-request-id: 0fa7773e-1988-46ec-1b17-ac8dd9526b38
Origin: https://developer.microsoft.com
Content-Length: 137
Connection: keep-alive

{"body":{"content":"

hi

"}}

Response
HTTP/1.1 400 Bad Request
Cache-Control: private
Content-Type: application/json
request-id: e54fcd29-7421-462c-aa2a-1499f61db286
client-request-id: 0fa7773e-1988-46ec-1b17-ac8dd9526b38
x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"Australia Southeast","Slice":"SliceC","Ring":"4","ScaleUnit":"001","RoleInstance":"AGSFE_IN_11"}}
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: ETag, Location, Preference-Applied, Content-Range, request-id, client-request-id, ReadWriteConsistencyToken, SdkVersion
Strict-Transport-Security: max-age=31536000
Date: Tue, 13 Oct 2020 09:20:36 GMT
Content-Length: 319

{
"error": {
"code": "BadRequest",
"message": "Write requests are only supported on contained entities",
"innerError": {
"date": "2020-10-13T09:20:37",
"request-id": "e54fcd29-7421-462c-aa2a-1499f61db286",
"client-request-id": "0fa7773e-1988-46ec-1b17-ac8dd9526b38"
}
}
}

Let me know if you need more information. Thanks!

Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Most helpful comment

@AlexFilippovDev , @ShaneOss As a workaround you can use /chats instead of /me/chats while we figure out the issue and fix for it.

All 8 comments

Same problem

We are looking into it.

@AlexFilippovDev , @ShaneOss As a workaround you can use /chats instead of /me/chats while we figure out the issue and fix for it.

Workaround works. Moving forward what would be the preferred way @RamjotSingh ?

The preferred way is always /chats directly since it lets you in a unified fashion handle app and app+user(delegated) scenarios without having to change code.

Thanks @RamjotSingh, and there's still no way to create a 1:1 chat conversation thread if one doesn't already exist? Other than via Bot Framework.

@ShaneOss We are working on a feature to support this and lot more in chats area in general. Please stay tuned to Graph changelog for more!!

This should be fixed now. Closing.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aaronrogers picture aaronrogers  Â·  3Comments

GregSpyra picture GregSpyra  Â·  4Comments

cconrado picture cconrado  Â·  4Comments

gi-joe-moto picture gi-joe-moto  Â·  3Comments

Chotimir picture Chotimir  Â·  3Comments