msGraph v1.0 endpoint broken regarding reference attachments

Tom Monnier 1 Reputation point
2021-01-11T14:00:58.6+00:00

I already posted an issue on stackoverflow. It doesn't seem to be picked up and I don't see how to notice the correct people.
Basically this should be considered a bug in the v1.0 endpoint as it behaves completely different vs the documentation.
original post: https://stackoverflow.com/questions/65633418/microsoft-graph-api-v1-0-endpoint-does-not-support-adding-referenceattachment

Different people have reported this using different languages but it can also be reproduced using the graph explorer.

This is a rather severe issue. Not only can I not use the v1.o endpoint, If I implement this against the beta endpoint I have no idea how long it will work. It puzzles me that I found other people reporting this (on the sdks instead of on the api) from over a year ago and is still not resolved. Perhaps not much used feature...

after creating a mail try to add a reference attachment. For the v1.0 endpoint this looks something like

using v1.0 endpoint

if you execute this you get: a bad request [400] Note that the sourceUrl property does not even exist on the v1.0 resources (see https://learn.microsoft.com/en-us/graph/api/resources/referenceattachment?view=graph-rest-1.0)

{
"error": {
"code": "ErrorInvalidProperty",
"message": "The property 'SourceUrl' is required when creating the entity.",
"innerError": {
"date": "2021-01-08T16:52:31",
"request-id": "2b8b4c2a-0f21-4691-bebc-574a30a9973a",
"client-request-id": "c42b7a0f-b6cb-0d7a-b461-d6ac026067a4"
}
}
}
Executing against the beta endpoint is possible, that one does contain the SourceUrl property, among others that are not in v1.0. (see https://learn.microsoft.com/zh-tw/graph/api/resources/referenceattachment?view=graph-rest-beta)

Try in graph explorer against beta endpoint

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,508 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Tom Monnier 1 Reputation point
    2023-09-29T15:45:44.4+00:00

    I would also like to know, I still have a workaround in my code for this.

    I have one application in production and one that is going into production soon that both rely on this...

    0 comments No comments