2020-02-13 07:43:59 -08:00
|
|
|
import {
|
2022-05-15 11:39:54 -07:00
|
|
|
IAuthenticateHeaderAuth,
|
|
|
|
ICredentialTestRequest,
|
2020-02-13 07:43:59 -08:00
|
|
|
ICredentialType,
|
2021-06-12 09:39:55 -07:00
|
|
|
INodeProperties,
|
2020-02-13 07:43:59 -08:00
|
|
|
} from 'n8n-workflow';
|
|
|
|
|
|
|
|
export class MailjetSmsApi implements ICredentialType {
|
|
|
|
name = 'mailjetSmsApi';
|
|
|
|
displayName = 'Mailjet SMS API';
|
2020-08-17 05:42:09 -07:00
|
|
|
documentationUrl = 'mailjet';
|
2021-06-12 09:39:55 -07:00
|
|
|
properties: INodeProperties[] = [
|
2020-02-13 07:43:59 -08:00
|
|
|
{
|
|
|
|
displayName: 'Token',
|
|
|
|
name: 'token',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2020-02-13 07:43:59 -08:00
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
];
|
2022-05-15 11:39:54 -07:00
|
|
|
authenticate: IAuthenticateHeaderAuth = {
|
|
|
|
type: 'headerAuth',
|
|
|
|
properties: {
|
|
|
|
name: 'Authorization',
|
|
|
|
value: '=Bearer {{$credentials.token}}',
|
|
|
|
},
|
|
|
|
};
|
|
|
|
test: ICredentialTestRequest = {
|
|
|
|
request: {
|
|
|
|
baseURL: `https://api.mailjet.com`,
|
|
|
|
url: '/v4/sms',
|
|
|
|
method: 'GET',
|
|
|
|
},
|
|
|
|
};
|
2020-02-13 07:43:59 -08:00
|
|
|
}
|