(* I understand that node-mialwizz is not your library, but your experience with PHP SDK may help *)
I tried to use the following code to create a new subscriber `aoxiang.paris.new@gmail.com` (I'm sure it does not exist in the list):
It returned
```
Error: {
status: 'error',
error: 'Only POST requests allowed for this endpoint.'
}
```
Does anyone know what's the correct way to create a new subscriber by API in node?
I tried to use the following code to create a new subscriber `aoxiang.paris.new@gmail.com` (I'm sure it does not exist in the list):
JavaScript:
const { ListSubscribers } = require('node-mailwizz');
const config = {
publicKey: 'key',
secret: 'key',
baseUrl: 'http://mail.mycompany.com/api'
}
const subscribers = new ListSubscribers(config);
function createSubscriber() {
const userInfo = { EMAIL: "aoxiang.paris.new@gmail.com", TRANSACTIONAL_REMINDERS: "YES" };
subscribers.create({
listUid: "en804x0lnrf1f",
data: userInfo
}).then(result => {
console.log('Subscriber created:', result);
}).catch(err => {
console.error('Error:', err);
})
}
createSubscriber();
It returned
```
Error: {
status: 'error',
error: 'Only POST requests allowed for this endpoint.'
}
```
Does anyone know what's the correct way to create a new subscriber by API in node?
Last edited: