Office.SharedProperties interface
共有フォルダーまたは共有メールボックス内の予定またはメッセージのプロパティを表します。
このオブジェクトの使用方法の詳細については、「 Outlook アドインで共有フォルダーと共有メールボックスのシナリオを有効にする」を参照してください。
注釈
[ API セット: 共有フォルダーのサポート用メールボックス 1.8、共有メールボックスサポート用メールボックス 1.13 ]
最小アクセス許可レベル: 読み取り項目
適用できる Outlook モード: Composeまたは読み取り
例
function performOperation() {
Office.context.mailbox.getCallbackTokenAsync({
isRest: true
},
function (asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded && asyncResult.value !== "") {
Office.context.mailbox.item.getSharedPropertiesAsync({
// Pass auth token along.
asyncContext: asyncResult.value
},
function (asyncResult1) {
let sharedProperties = asyncResult1.value;
let delegatePermissions = sharedProperties.delegatePermissions;
// Determine if user can do the expected operation.
// E.g., do they have Write permission?
if ((delegatePermissions & Office.MailboxEnums.DelegatePermissions.Write) != 0) {
// Construct REST URL for your operation.
// Update <version> placeholder with actual Outlook REST API version e.g. "v2.0".
// Update <operation> placeholder with actual operation.
let rest_url = sharedProperties.targetRestUrl + "/<version>/users/" + sharedProperties.targetMailbox + "/<operation>";
$.ajax({
url: rest_url,
dataType: 'json',
headers:
{
"Authorization": "Bearer " + asyncResult1.asyncContext
}
}
).done(
function (response) {
console.log("success");
}
).fail(
function (error) {
console.log("error message");
}
);
}
}
);
}
}
);
}
プロパティ
delegate |
代理人が共有フォルダーに対して持つアクセス許可、またはユーザーが共有メールボックスに対して持っているアクセス許可。 |
owner | 共有アイテムの所有者のメール アドレス。 |
target |
代理人のアクセス権の所有者のメールボックスの場所。 この場所は、Outlook クライアントによって異なる場合があります。
使用例: |
target |
REST API のベース URL (現在
使用例: |
プロパティの詳細
delegatePermissions
代理人が共有フォルダーに対して持つアクセス許可、またはユーザーが共有メールボックスに対して持っているアクセス許可。
delegatePermissions: MailboxEnums.DelegatePermissions;
プロパティ値
例
function performOperation() {
Office.context.mailbox.getCallbackTokenAsync({
isRest: true
},
function (asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded && asyncResult.value !== "") {
Office.context.mailbox.item.getSharedPropertiesAsync({
// Pass auth token along.
asyncContext: asyncResult.value
},
function (asyncResult1) {
let sharedProperties = asyncResult1.value;
let delegatePermissions = sharedProperties.delegatePermissions;
// Determine if user can do the expected operation.
// E.g., do they have Write permission?
if ((delegatePermissions & Office.MailboxEnums.DelegatePermissions.Write) != 0) {
// Construct REST URL for your operation.
// Update <version> placeholder with actual Outlook REST API version e.g. "v2.0".
// Update <operation> placeholder with actual operation.
let rest_url = sharedProperties.targetRestUrl + "/<version>/users/" + sharedProperties.targetMailbox + "/<operation>";
$.ajax({
url: rest_url,
dataType: 'json',
headers:
{
"Authorization": "Bearer " + asyncResult1.asyncContext
}
}
).done(
function (response) {
console.log("success");
}
).fail(
function (error) {
console.log("error message");
}
);
}
}
);
}
}
);
}
owner
共有アイテムの所有者のメール アドレス。
owner: string;
プロパティ値
string
targetMailbox
代理人のアクセス権の所有者のメールボックスの場所。 この場所は、Outlook クライアントによって異なる場合があります。
targetRestUrl
と共に使用して、REST 操作の URL を作成します。
使用例: targetRestUrl + "/{api_version}/users/" + targetMailbox + "/{REST_operation}"
targetMailbox: string;
プロパティ値
string
targetRestUrl
REST API のベース URL (現在 https://outlook.office.com/api
)。
targetMailbox
と共に使用して、REST 操作の URL を作成します。
使用例: targetRestUrl + "/{api_version}/users/" + targetMailbox + "/{REST_operation}"
targetRestUrl: string;
プロパティ値
string
Office Add-ins