API to check if a person has unsubscribed from a list

I would like to use node.

I tried the following code:

JavaScript:
const { ListSubscribers } = require('node-mailwizz');


const config = {
    publicKey: '___',
    secret: '___',
    baseUrl: 'http://mail.mycompany.com/api'
}
// Configuration details directly in the class constructor
const subscribers = new ListSubscribers(config);


// Function to search for a subscriber by email
function searchSubscriber(listUid, email) {
    console.log("listUid", listUid)
    console.log("email", email)
    subscribers.emailSearch({
        listUid: listUid,
        email: email
    })
    .then(result => {
        console.log('Subscriber found:', result);
    })
    .catch(err => {
        console.error('Error:', err);
    });
}


// Example usage of the function
searchSubscriber('en804x0lnrf1f', 'fabio.ginnetti@savoiaesavoia.it');


However, it returned
Code:
listUid en804x0lnrf1f
email fabio.ginnetti@savoiaesavoia.it
Error: {
  status: 'error',
  error: 'Please provide the subscriber email address.'
}
 
Last edited by a moderator:
I would like to use node.

I tried the following code:
This is not our library and we cannot manage what it's happens, so if you want to use API please use the php sdk which is the most updated and it's working.
 
Back
Top