Hi,
I am using the following url to search if a contact’s email exist and to retrieve the ID
url:
${this.invoice_ninja.$auth.domain}/api/v1/clients/?email=${contactEmail},
Recently, for two accounts where the contact existed, it returned 0 records. This led to a downstream function creating the contact on the client. However, instead of adding the contact to the client, this endpoint overwrote all contacts on the client leading to just one contact now on the account. Invoice Ninja API Spec (invoicing.co)
let clientData = {
"contacts": contact_props
}
var updateClient = await axios($, {
url: `${this.invoice_ninja.$auth.domain}/api/v1/clients/${client_id}`,
method: 'put',
headers: {
"X-api-Token": `${this.invoice_ninja.$auth.api_token}`,
'Content-Type': 'application/json'
},
data: clientData
})
Am I sending this wrong, how do I add a contact without overwriting previous contacts on the client account.