Small improvements to ZohoCRM-Node and OAuth fix

This commit is contained in:
Jan Oberhauser
2020-02-14 18:48:58 -08:00
parent f938693695
commit 6a08fc9da3
6 changed files with 46 additions and 17 deletions

View File

@@ -9,12 +9,9 @@ import {
} from 'n8n-workflow';
export async function zohoApiRequest(this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, method: string, resource: string, body: any = {}, qs: IDataObject = {}, uri?: string, option: IDataObject = {}): Promise<any> { // tslint:disable-line:no-any
const credentials = this.getCredentials('zohoOAuth2Api');
const options: OptionsWithUri = {
headers: {
'Content-Type': 'application/json',
//@ts-ignore
Authorization: `Zoho-oauthtoken ${credentials!.oauthTokenData.access_token}`
},
method,
body: {