2024-10-31 09:38:11 -07:00
|
|
|
import type {
|
|
|
|
IAuthenticateGeneric,
|
|
|
|
ICredentialTestRequest,
|
|
|
|
ICredentialType,
|
|
|
|
INodeProperties,
|
|
|
|
} from 'n8n-workflow';
|
2019-11-15 12:10:51 -08:00
|
|
|
|
|
|
|
export class IntercomApi implements ICredentialType {
|
|
|
|
name = 'intercomApi';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2019-11-15 12:10:51 -08:00
|
|
|
displayName = 'Intercom API';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2020-08-17 05:42:09 -07:00
|
|
|
documentationUrl = 'intercom';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2021-06-12 09:39:55 -07:00
|
|
|
properties: INodeProperties[] = [
|
2019-11-15 12:10:51 -08:00
|
|
|
{
|
|
|
|
displayName: 'API Key',
|
|
|
|
name: 'apiKey',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2022-11-01 09:41:45 -07:00
|
|
|
typeOptions: { password: true },
|
2019-11-15 12:10:51 -08:00
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
];
|
2024-10-31 09:38:11 -07:00
|
|
|
|
|
|
|
authenticate: IAuthenticateGeneric = {
|
|
|
|
type: 'generic',
|
|
|
|
properties: {
|
|
|
|
headers: {
|
|
|
|
Authorization: '=Bearer {{$credentials.apiKey}}',
|
|
|
|
Accept: 'application/json',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
test: ICredentialTestRequest = {
|
|
|
|
request: {
|
|
|
|
baseURL: 'https://api.intercom.io',
|
|
|
|
url: '/me',
|
|
|
|
method: 'GET',
|
|
|
|
},
|
|
|
|
};
|
2019-11-15 12:10:51 -08:00
|
|
|
}
|