Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UpdateContact, boolean attributes are not updating #30

Open
frellan opened this issue May 31, 2021 · 3 comments
Open

UpdateContact, boolean attributes are not updating #30

frellan opened this issue May 31, 2021 · 3 comments

Comments

@frellan
Copy link

frellan commented May 31, 2021

Hello!

I cannot get boolean attributes to update when using the updateContact endpoint of the ContactsApi ith this SDK.

What value are you supposed to send in the Properties object? I Have tried true, TRUE, 1, Yes and nothing works. It just send 204 like all is okay but nothing happens. Below are the code. Its Kotlin, but its just the same. the user.sharingShopping field is a Boolean type.

val params = UpdateContact().apply {
    attributes = Properties().apply {
        setProperty("SHARING_SHOPPING", user.sharingShopping.toString())
    }
}
apiInstance.updateContact(user.userEmail, params)
@daneanbulosan
Copy link

daneanbulosan commented Sep 27, 2021

Hi @frellan

I found a workaround for this. Instead of using Propreties use the JSON Object instead

e.i
JSONObject body = new JSONObject();
body.put("SHARING_SHOPPING", user.sharingShopping);

This works for me.

@Kool-Hussain
Copy link
Contributor

Hi @frellan ,
I am able to replicate the issue on my end and will share the fix asap.
Thanks

@feenhoernchen
Copy link

feenhoernchen commented Nov 14, 2023

Another workaround (as this issue is not fixed) and you use version 7.0.0 over at Maven. https://mvnrepository.com/artifact/com.sendinblue/sib-api-v3-sdk/7.0.0

The workaround is to not use the Properties class and just use a normal HashMap instead and pass this to the UpdateContact class.

Map<Object, Object> attributes = new HashMap<>();
attributes.put("BOOLEANVALUE", false);
UpdateContact updateContact = new UpdateContact();
updateContact.setAttributes(attributes);
contactsApi.updateContact(email, updateContact);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants