Office.MailboxEnums.RestVersion enum
Specifies the version of the REST API that corresponds to a REST-formatted item ID.
Remarks
Applicable Outlook mode: Compose or Read
Examples
// 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();
});
Fields
v1_0 = "v1.0" | Version 1.0. |
v2_0 = "v2.0" | Version 2.0. |
Beta = "beta" | Beta. |
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Office Add-ins