First of all, here is my labels list.
And I tried to use contacts.queryLabels() to get all my info of labels as below:
And now I want to create contact with label defined, here is my code:
export function resentActivation ( email ) {
let contactInfo = {
“emails” : [{
tag : “WORK” ,
email : email
}],
“labels” : [ “Resend Activation Form” ]
}
return contacts . createContact ( contactInfo )
. then (( contact ) => {
const contactId = contact . _id ;
console . log ( “create contact” , contact )
**return** contact ;
})
. catch (( error ) => {
console . error ( "error" , error );
});
It was successfully created contact but it didn’t attach with labels.
Can anyone help on this? Here is the wix velo API link but it didn’t stated clearly on how to define the label when creating contact.
https://www.wix.com/velo/reference/wix-crm-backend/createcontact