feature/outlook shared mailbox (#1323)
* ⚡ Add shared mailbox support * 🐛 Add filter field to folderMessage:getAll * ⚡ Small changes to descriptions (#1322) Co-authored-by: Mika Luhta <12100880+mluhta@users.noreply.github.com>
This commit is contained in:
@@ -14,6 +14,14 @@ import {
|
||||
} from 'n8n-workflow';
|
||||
|
||||
export async function microsoftApiRequest(this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, method: string, resource: string, body: any = {}, qs: IDataObject = {}, uri?: string, headers: IDataObject = {}, option: IDataObject = { json: true }): Promise<any> { // tslint:disable-line:no-any
|
||||
const credentials = this.getCredentials('microsoftOutlookOAuth2Api');
|
||||
|
||||
let apiUrl = `https://graph.microsoft.com/v1.0/me${resource}`;
|
||||
// If accessing shared mailbox
|
||||
if (credentials!.useShared && credentials!.userPrincipalName) {
|
||||
apiUrl = `https://graph.microsoft.com/v1.0/users/${credentials!.userPrincipalName}${resource}`;
|
||||
}
|
||||
|
||||
const options: OptionsWithUri = {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -21,7 +29,7 @@ export async function microsoftApiRequest(this: IExecuteFunctions | IExecuteSing
|
||||
method,
|
||||
body,
|
||||
qs,
|
||||
uri: uri || `https://graph.microsoft.com/v1.0/me${resource}`,
|
||||
uri: uri || apiUrl,
|
||||
};
|
||||
try {
|
||||
Object.assign(options, option);
|
||||
|
||||
Reference in New Issue
Block a user