thorning / node-mailchimp

node mailchimp wrapper using v3 of the mailchimp api
MIT License
288 stars 35 forks source link

Can't use query properly #47

Closed cristiboariu closed 6 years ago

cristiboariu commented 6 years ago

I've tried to exclude contact field from GET request but its still listed:

const listsResponse = await this.mailchimp.request({
        method: 'get',
        path: '/lists',
        query: {
          exclude_fields: 'contact',
          count: 1
        }
      });

count is working (it returns only 1 result) but not exclude_fields.

Tried to exclude other fields, eg: id,name but still whole list objects are returned.

Can anybody let me know please what I'm doing wrong?

cristiboariu commented 6 years ago

Found the issue. We have to name the fields by prepending them with lists property which is unbelievable: fields: 'lists.name.id,lists.id,lists.web_id', or: exclude_fields:'lists.contact