Compartilhar via


Office.SharedProperties interface

Representa as propriedades de um compromisso ou mensagem numa pasta partilhada ou caixa de correio partilhada.

Para obter mais informações sobre como este objeto é utilizado, consulte Ativar pastas partilhadas e cenários de caixa de correio partilhada num suplemento do Outlook.

Comentários

[ Conjunto de API: Caixa de correio 1.8 para suporte de pastas partilhadas, Caixa de Correio 1.13 para suporte de caixa de correio partilhada ]

Nível mínimo de permissão: ler item

Modo Outlook aplicável: Compose ou Leitura

Exemplos

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");
                }
              );
            }
          }
        );
      }
    }
  );
}

Propriedades

delegatePermissions

As permissões que o delegado tem numa pasta partilhada ou o utilizador tem numa caixa de correio partilhada.

owner

O endereço de e-mail do proprietário de um item partilhado.

targetMailbox

A localização da caixa de correio do proprietário para o acesso do delegado. Esta localização pode ser diferente com base no cliente do Outlook.

Utilize com targetRestUrl para construir o URL da operação REST.

Utilização de exemplo: targetRestUrl + "/{api_version}/users/" + targetMailbox + "/{REST_operation}"

targetRestUrl

O URL base da API REST (atualmente https://outlook.office.com/api).

Utilize com targetMailbox para construir o URL da operação REST.

Utilização de exemplo: targetRestUrl + "/{api_version}/users/" + targetMailbox + "/{REST_operation}"

Detalhes da propriedade

delegatePermissions

As permissões que o delegado tem numa pasta partilhada ou o utilizador tem numa caixa de correio partilhada.

delegatePermissions: MailboxEnums.DelegatePermissions;

Valor da propriedade

Exemplos

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

O endereço de e-mail do proprietário de um item partilhado.

owner: string;

Valor da propriedade

string

targetMailbox

A localização da caixa de correio do proprietário para o acesso do delegado. Esta localização pode ser diferente com base no cliente do Outlook.

Utilize com targetRestUrl para construir o URL da operação REST.

Utilização de exemplo: targetRestUrl + "/{api_version}/users/" + targetMailbox + "/{REST_operation}"

targetMailbox: string;

Valor da propriedade

string

targetRestUrl

O URL base da API REST (atualmente https://outlook.office.com/api).

Utilize com targetMailbox para construir o URL da operação REST.

Utilização de exemplo: targetRestUrl + "/{api_version}/users/" + targetMailbox + "/{REST_operation}"

targetRestUrl: string;

Valor da propriedade

string