We have the situation, that we are sending Triggered Emails via REST Api. All subscribers are stored in Triggered Send Data Extension. The Email is the primary key.
In case a user enters an already existing Email the Triggered Email will not be triggered, because the email already exists in the Data Extension.
That is correct and expected.
The thing is, in this case the response would still look like this:
"responses": [
{
"recipientSendId": "some ID numbers",
"hasErrors": false,
"messages": [
"Queued"
]
}
]
So I find no way to make it possible to give the user an error message on the website saying something like "you email is already in use".
Are there any ideas how to handle that? I guess this case might occur frequently.
Best Answer
Your best bet for checking from a third party website is to use two API calls. You would just need to include some logic in your SS language that if the first call is true to put in whatever message you want, but if false then insert.
See calls required below:
Below is a sample SOAP envelope for the first call:
To address your inquiry in the comment - technically yes you can use client-side Javascript to call the API, but that exposes your User/Pass combination to anyone that accesses the page. This would allow any viewer of your page unfettered access to your SFMC account, both via the UI and via API. So usually this is not an option most people would use.