mailjet / mailjet-apiv3-go

[API v3] Official Mailjet API v3 Go wrapper
https://dev.mailjet.com
MIT License
86 stars 31 forks source link

Error adding contact to existing contact list #72

Closed bojanmilinkovic closed 3 years ago

bojanmilinkovic commented 3 years ago

Hi, I am facing the same issue as mentioned in https://github.com/mailjet/mailjet-apiv3-go/issues/59

I am sending request as it's described

`mr := &mailjet.Request{ Resource: "listrecipient", } fmr := &mailjet.FullRequest{ Info: mr, Payload: &resources.Listrecipient{ IsUnsubscribed: true, ContactID: 167078506, ContactALT: "bokitest8@gmail.com", ListID: 39784, }, }

err := m.client.Post(fmr, &data)
if err != nil {
    return fmt.Errorf("Error adding contact to contact list: %w", err)
}

`

But still getting an error Unexpected server response code: 400: Object properties invalid (MJ08 Property Contact is invalid: MJ03 A non-empty value is required)

It would be good if you can fix this. Thanks in advance

tsidei commented 3 years ago

Hi, just tried on latest code version and it worked for me. #69 should have fixed the issue. Is it happening all the time or only for some specific requests/contacts/contactlists? Also ensure you use the latest version.

tsidei commented 3 years ago

fixed by #69