Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
788 views
in Technique[技术] by (71.8m points)

outlook - 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://docs.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://docs.microsoft.com/zh-tw/graph/api/resources/referenceattachment?view=graph-rest-beta)

Try in graph explorer against beta endpoint


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...