Any follow up on this? Still do not understand why documentation is out of date that get a 403 error when run the “insertContact” for the second time with the exact same contact information.
From Documenation "Calling createContact() performs one of the following. (The contact information specified in the contactInfo parameter matches an existing contact if it contains an email address or phone number from an existing contact.)
-
If there is no matching existing contact, a new contact is created using the information specified using the contactInfo parameter.
-
If there is a matching existing contact, it is updated with the information specified using the contactInfo parameter. Any existing contact information that is not explicity overriden in the contactInfo parameter retains its existing value." ( https://www.wix.com/corvid/reference/wix-crm-backend.html#createContact ).
Maintaining another collection with the contact information is just counter-productive since would have to make sure listen if the contact was updated to update the email/phone. Why isn’t there a query for email/phone from the crm contacts table? There has to be some logic already built in since you can query the contact information from the Contact List section on the dashboard. There seems to be a rest endpoint this calls: https://www.wix.com/contacts-server/api/v1/metasite//queryContactsWithFilter?filterQuery=%7B%22conditions%22:,%22query%22:%22SEARCHTEXT%22%7D&sort=[%7B%22field%22:%22lastActivity%22,%22direction%22:%22descending%22%7D]