Creating Contacts for Tickets
Hello,I'm trying to find a workflow for creating new customer tickets using just their email addresses. I was able to do so using curl commands, but ran into some issues concerning the contactId. This field is required for tickets, which means that I have to create a contact first. Also, I'm not sure why there is an email field in tickets in the first place.
In order to create a new contact, there's the POST api/v1/contacts API. However, I found out that I can create multiple contacts with the same email address. This means that every single ticket would get a new contact, and we wouldn't be able to correlate different tickets by the same person.
I was able to search for a contact based on the email address using the GET api/v1/contacts/search API, but that still leaves a race condition open, where when multiple tickets are created using the same email address at the same time, there's a good chance that the two search/create workflows would overlap and thus two contacts would be created.
Is there an API for searching/creating contacts in a single transaction? So if the contact doesn't exist, create it, otherwise just return the record.