2022-08-24 01:26:48 -07:00
|
|
|
import {
|
|
|
|
IAuthenticateGeneric,
|
|
|
|
ICredentialTestRequest,
|
|
|
|
ICredentialType,
|
|
|
|
NodePropertyTypes,
|
|
|
|
} from 'n8n-workflow';
|
2021-11-05 10:37:50 -07:00
|
|
|
|
|
|
|
export class DropcontactApi implements ICredentialType {
|
|
|
|
name = 'dropcontactApi';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2021-11-05 10:37:50 -07:00
|
|
|
displayName = 'Dropcontact API';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2021-11-05 10:37:50 -07:00
|
|
|
documentationUrl = 'dropcontact';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2021-11-05 10:37:50 -07:00
|
|
|
properties = [
|
|
|
|
{
|
|
|
|
displayName: 'API Key',
|
|
|
|
name: 'apiKey',
|
|
|
|
type: 'string' as NodePropertyTypes,
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
];
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2022-08-24 01:26:48 -07:00
|
|
|
authenticate: IAuthenticateGeneric = {
|
|
|
|
type: 'generic',
|
|
|
|
properties: {
|
|
|
|
headers: {
|
|
|
|
'user-agent': 'n8n',
|
|
|
|
'X-Access-Token': '={{$credentials.apiKey}}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2022-08-24 01:26:48 -07:00
|
|
|
test: ICredentialTestRequest = {
|
|
|
|
request: {
|
|
|
|
baseURL: 'https://api.dropcontact.io',
|
|
|
|
url: '/batch',
|
|
|
|
method: 'POST',
|
|
|
|
body: {
|
|
|
|
data: [{ email: '' }],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
2021-11-05 10:37:50 -07:00
|
|
|
}
|