1

Thank you all in advance.

Scenario is simple: Website visitor register to newsletter and recieve double opt-in confirmation email. Registered visitor can change his preference in his profile (after login). We wanted to avoid cloud pages as we want to have maximum control over UX/UI.

We are wanted to leverage API to minimize development impact on the current website and use REST API when an anonymous visitor subscribes to a newsletter.

Here is what we did.

1. Sendable data extension - for testing, we used only a few attributes (EmailAddress, FirstName, LastName) and setup attribute EmailAddress to relates to Subscriber key

2. A simple journey to send the email immediately when API event is triggered - we want to evaluate whether customer click/open the sent email to perform additional action such as update record or send another email.

3. Create a record in DE and trigger the journey via API we have successfully authenticated and were enable to send some test API calls. However, we have tried to follow up with our scenario and were not able to do it. We thought that we might be able to insert Data Extension rows which would be then followed by fire API event for our journey.

So we end up with following:

POST
rest.marketingcloudapis.com/hub/v1/dataevents/OUR DATA EXTENSION KEY/rowset

Content-Type:application/json

[
    {
        "keys":{
                "EmailAddress": "[email protected]"
                },
        "values":{
                "EmailAddress": "[email protected]",
                "FirstName": "John",
                "LastName": "Smith"
                }
    }
]

The response is the following:

{
    "message": "Primary key 'EmailAddress' does not exist.",
    "errorcode": 10000,
    "documentation": ""
}

So my question is what could be possibly wrong on our scenario or should we rather focus on some alternative solution (e.g. to proceed with Double Opt-in rather with Lists or some others?)

Thank you all!

-------------------UPDATE 23. 10. 2019-------------------

Thank you both for your feedback. It was indeed mistake with KEY in my endpoint.

So we have managed to Fire Event trigger but there was 1-2 minutes delay when the email was received by recipient added to DE. So this is not suitable solution if this is expected behavior.

We have used call bellow.

rest.marketingcloudapis.com/interaction/v1/events

{
    "ContactKey": "XYZ9",
    "EventDefinitionKey":"APIEvent-3cdbdc2c-0759-0639-6b55-a90ad7c8f06c",
    "Data": {
        "OptInID":"XYZ9", 
        "EmailAddress": "[email protected]",
        "FirstName": "John"
    }
}

We have also considered to trigger email via REST API. The recipient has recived the email within few seconds, but we were unable to follow up on with additional actions in journey builder to update details in DE - there is not possible to add engagement split if there is missing the email send action added in the same journey.

I basically want to achieve following scenario and I feel that every solution has some disadvantages.

Scenario: New website visitor send form -> Visitor recieve an email with a link to confirm subscription -> visitor after confirming recieve a welcome email

In the backend we want to have Contact record created with subscription status, datetime, source, emailaddress, etc.

We think of the following solution:

1. Add contact record in custom DE and trigger Fire Event which would add contact to journey and send email immediately. This was achieved, but the email has long delay since it was sent to the contact.

2. Trigger API send and process automation to analyze if the email was clicked or not. The disadvantage here is that automation process can only run per defined time period - which is too long.

3. Leverage Double Opt-In scenario through lists. Seems feasible, but we still need to have automation process to take data from list to the DE.

Is there something we are missing in our scenario or is there some other solution or approach to consider? Thank you very much

2 Answers 2

1

I see that you are missing key in your endpoint.

Try using:

SUBDOMAIN.rest.marketingcloudapis.com/hub/v1/dataevents/key:OUR DATA EXTENSION KEY/rowset

Reference:

https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/routes.htm

POST /hub/v1/dataevents/key:{key}/rowset

1

A much simpler solution would be to do the following:

1) Create Triggered Send Data Extension in the SFMC UI that will house the records which you deploy to.

2) Create a Triggered Send Definition with your data extension selected under the "Triggered Send Data Extensions" sub-menu.

3) Deploy your triggered email via the REST API from your website using this route.

If you don't have a need to actually store the recipient data in a data extension, then you can always create your send definition and then deploy your email send entirely through the API.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .