Office.MailboxEnums.RestVersion enum
REST 形式のアイテム ID に対応する REST API のバージョンを指定します。
注釈
適用できる Outlook モード: 新規作成または読み取り
例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/85-tokens-and-service-calls/basic-rest-cors.yaml
Office.context.mailbox.getCallbackTokenAsync({ isRest: true }, function (result) {
const ewsId = Office.context.mailbox.item.itemId;
const token = result.value;
const restId = Office.context.mailbox.convertToRestId(ewsId, Office.MailboxEnums.RestVersion.v2_0);
const getMessageUrl = Office.context.mailbox.restUrl + '/v2.0/me/messages/' + restId;
const xhr = new XMLHttpRequest();
xhr.open('GET', getMessageUrl);
xhr.setRequestHeader("Authorization", "Bearer " + token);
xhr.onload = function (e) {
console.log(this.response);
}
xhr.send();
});
フィールド
v1_0 = "v1.0" | バージョン 1.0。 |
v2_0 = "v2.0" | バージョン 2.0。 |
Beta = "beta" | ベータ版。 |
GitHub で Microsoft と共同作業する
このコンテンツのソースは GitHub にあります。そこで、issue や pull request を作成および確認することもできます。 詳細については、共同作成者ガイドを参照してください。
Office Add-ins