2

過去1か月ほど、次のような単純なWebアプリが機能していました。

outlook.office365.com/api/beta/Me/userphotos('120x120')/$value

しかし、今では次のように返されます:

{"error":{"code":"RequestBrokerOld-ParseUri","message":"Resource not found for the segment 'userphotos'."}}

次のいずれかを試しても、同じエラーが発生します。

https://outlook.office365.com/api/beta/Me/userphoto
https://outlook.office365.com/api/beta/Me/userphotos
https://outlook.office365.com/api/beta/Me/userphoto/$value

私の組織がこれを引き起こすために何かを変更した可能性はありますか? または、このリクエストの仕組みに一般的な変更がありましたか?

同じアプリで、他のメールとカレンダーのリクエストはすべて正常に機能します。これは、ユーザーのプロフィール写真が上隅に表示されないという表面的な問題にすぎません。

4

2 に答える 2

2

これは本当にElioStruyfの答えです。

エンドポイントは「userphoto」ではなく「photo」と呼ばれるようになりました

使用する写真情報を取得するには:

https://outlook.office365.com/api/beta/Me/photo

呼び出した写真を取得するには

https://outlook.office365.com/api/beta/Me/photo/$value

利用可能なすべての写真サイズのリストを取得するには、この API エンドポイントを使用します -

https://outlook.office.com/api/beta/me/Photos/

回答例 -

{
    "@odata.context": "https://outlook.office.com/api/beta/$metadata#Me/Photos",
    "value": [
        {
            "@odata.id": "https://outlook.office.com/api/beta/Users('John.Doe@contoso.com')/Photos('48X48')",
            "@odata.readLink": "https://outlook.office.com/api/beta/Users('John.Doe@contoso.com')/Photos('48X48')",
            "@odata.mediaContentType": "image/jpeg",
            "@odata.mediaEtag": "\"7A1F3A9D\"",
            "Id": "48X48",
            "Height": 48,
            "Width": 48
        },
        {
            "@odata.id": "https://outlook.office.com/api/beta/Users('John.Doe@contoso.com')/Photos('64X64')",
            "@odata.readLink": "https://outlook.office.com/api/beta/Users('John.Doe@contoso.com')/Photos('64X64')",
            "@odata.mediaContentType": "image/jpeg",
            "@odata.mediaEtag": "\"7A1F3A9D\"",
            "Id": "64X64",
            "Height": 64,
            "Width": 64
        },
        {
            "@odata.id": "https://outlook.office.com/api/beta/Users('John.Doe@contoso.com')/Photos('96X96')",
            "@odata.readLink": "https://outlook.office.com/api/beta/Users('John.Doe@contoso.com')/Photos('96X96')",
            "@odata.mediaContentType": "image/jpeg",
            "@odata.mediaEtag": "\"7A1F3A9D\"",
            "Id": "96X96",
            "Height": 96,
            "Width": 96
        },
        {
            "@odata.id": "https://outlook.office.com/api/beta/Users('John.Doe@contoso.com')/Photos('120X120')",
            "@odata.readLink": "https://outlook.office.com/api/beta/Users('John.Doe@contoso.com')/Photos('120X120')",
            "@odata.mediaContentType": "image/jpeg",
            "@odata.mediaEtag": "\"7A1F3A9D\"",
            "Id": "120X120",
            "Height": 120,
            "Width": 120
        },
        {
            "@odata.id": "https://outlook.office.com/api/beta/Users('John.Doe@contoso.com')/Photos('240X240')",
            "@odata.readLink": "https://outlook.office.com/api/beta/Users('John.Doe@contoso.com')/Photos('240X240')",
            "@odata.mediaContentType": "image/jpeg",
            "@odata.mediaEtag": "\"7A1F3A9D\"",
            "Id": "240X240",
            "Height": 240,
            "Width": 240
        },
        {
            "@odata.id": "https://outlook.office.com/api/beta/Users('John.Doe@contoso.com')/Photos('360X360')",
            "@odata.readLink": "https://outlook.office.com/api/beta/Users('John.Doe@contoso.com')/Photos('360X360')",
            "@odata.mediaContentType": "image/jpeg",
            "@odata.mediaEtag": "\"7A1F3A9D\"",
            "Id": "360X360",
            "Height": 360,
            "Width": 360
        },
        {
            "@odata.id": "https://outlook.office.com/api/beta/Users('John.Doe@contoso.com')/Photos('432X432')",
            "@odata.readLink": "https://outlook.office.com/api/beta/Users('John.Doe@contoso.com')/Photos('432X432')",
            "@odata.mediaContentType": "image/jpeg",
            "@odata.mediaEtag": "\"7A1F3A9D\"",
            "Id": "432X432",
            "Height": 432,
            "Width": 432
        },
        {
            "@odata.id": "https://outlook.office.com/api/beta/Users('John.Doe@contoso.com')/Photos('504X504')",
            "@odata.readLink": "https://outlook.office.com/api/beta/Users('John.Doe@contoso.com')/Photos('504X504')",
            "@odata.mediaContentType": "image/jpeg",
            "@odata.mediaEtag": "\"7A1F3A9D\"",
            "Id": "504X504",
            "Height": 504,
            "Width": 504
        },
        {
            "@odata.id": "https://outlook.office.com/api/beta/Users('John.Doe@contoso.com')/Photos('648X648')",
            "@odata.readLink": "https://outlook.office.com/api/beta/Users('John.Doe@contoso.com')/Photos('648X648')",
            "@odata.mediaContentType": "image/jpeg",
            "@odata.mediaEtag": "\"7A1F3A9D\"",
            "Id": "648X648",
            "Height": 648,
            "Width": 648
        }
    ]
}

目的の写真サイズの実際のブロブを取得するには、この API を呼び出します -

https://outlook.office.com/api/beta/me/Photos('120X120')/$value
于 2015-11-04T23:57:54.183 に答える