Iam using the golang package
https://github.com/intercom/intercom-go /p>
While iam trying to update my contact , getting error
Error :
400: invalid_document, either_email_or_user_id_present validation failed
Code:
ic := intercom.NewClient(token, "")
contact := intercom.Contact{
ID: "604720410292c92b2fbd598a",
UserID: "420",
CustomAttributes: map[string]interface{}{"First Campaign Sent": "Yes boss"},
}
savedContact, err := ic.Contacts.Update(&contact)
Please help me for update contact using golang
Best answer by Roy
Hello @user461 , Welcome to Interconnect
1) Can you confirm that contact 604720410292c92b2fbd598a accseble from Intercom UI?
(To check this try to access the following URL: https://app.intercom.com/a/apps/ b>YOURAPPID/users/604720410292c92b2fbd598a /all-conversations).
2) Accordingly to Github docs to update contact ID or User ID is required:
contact := intercom.Contact{
UserID: "420",
Name: "SomeContact",
CustomAttributes: map[string]interface{}{"is_cool": true},
}
savedContact, err := ic.Contacts.Update(&contact)
or via ID:
contact := intercom.Contact{
ID: "604720410292c92b2fbd598a",
Name: "SomeContact",
CustomAttributes: map[string]interface{}{"is_cool": true},
}
savedContact, err := ic.Contacts.Update(&contact)
Can you try the following advice and let me know if this helps?
Looking forward and have a great day.
View original