mirror of
				https://github.com/n8n-io/n8n-nodes-starter.git
				synced 2025-10-30 14:52:27 -05:00 
			
		
		
		
	Test authentication
This commit is contained in:
		
					parent
					
						
							
								58b5d0d9c0
							
						
					
				
			
			
				commit
				
					
						936fc68b5a
					
				
			
		
					 2 changed files with 57 additions and 6 deletions
				
			
		|  | @ -16,7 +16,7 @@ import { | |||
| } from 'n8n-workflow'; | ||||
| 
 | ||||
| export async function friendGridApiRequest(this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, | ||||
| 	method: string, endpoint: string, body?: object, query?: object, uri?: string): Promise<any> { // tslint:disable-line:no-any
 | ||||
| 	method: string, endpoint: string, body?: object, qs?: object, uri?: string): Promise<any> { // tslint:disable-line:no-any
 | ||||
| 
 | ||||
| 	//Get credentials the user provided for this node
 | ||||
| 	const credentials = await this.getCredentials('friendGridApi') as IDataObject; | ||||
|  | @ -32,9 +32,9 @@ export async function friendGridApiRequest(this: IHookFunctions | IExecuteFuncti | |||
| 			'Accept': ' application/json', | ||||
| 			'Authorization': `Bearer ${credentials.apiKey}`, | ||||
| 		}, | ||||
| 		qs: query, | ||||
| 		qs, | ||||
| 		body, | ||||
| 		uri: uri || `https://api.sendgrid.com/v3/marketing/${endpoint}`, | ||||
| 		uri: uri || `https://api.sendgrid.com/v3/${endpoint}`, | ||||
| 		json: true, | ||||
| 	}; | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue