Skip to main content
Solved

Trying to Set up API-Based transactional events for Reset Password

  • March 10, 2023
  • 1 reply
  • 414 views

Forum|alt.badge.img+2

I am trying to Set up API-Based transactional events for Reset Password as explained with new SDK

https://developers.klaviyo.com/en/v1-2/docs/guide-to-setting-up-api-based-transactional-events

 

$body = [

    'data' => [

        'event' => 'Reset Password',

        'customer_properties' => [

            '$email' => 'dinesh.dhaker.88@gmail.com'

        ],

        'properties' => [

            '$event_id' => rand(1000, 9999),

            'PasswordResetLink' => "https://otc.com/reset/1234567890987654321"

        ],

        'time' => time()

    ]

];

 

try {

    $response = $klaviyo->Events->createEvent($body);

    ////$response = $klaviyo->Events->getEvents();

    echo '<pre>';

    print_r($response);

} catch (Exception $e) {

    echo '<pre>';

    print_r($e);exit;

}

But getting error as below

KlaviyoAPI\ApiException Object(    [responseBody:protected] => {"errors":[{"id":"8a3fd160-73a1-468b-9bae-686baac0640d","status":400,"code":"invalid","title":"Invalid input.","detail":"The payload provided in the request is invalid.","source":{"pointer":"/data"},"meta":{}}]})So someone can help me how I can setup Reset Password Email using API.Thanks

 

Best answer by Brian Turcotte

Hi @dineshdhaker,

 

I see that you opened a Support ticket and that this issue was resolved by turning of Smart Sending on your flow. 

 

I’m going to throw the new version of that Developer Portal doc here for anyone else that might come across this:

 

Thanks for using the Community!

- Brian 

 

1 reply

Brian Turcotte
Forum|alt.badge.img+37
  • Klaviyo Alum
  • 1393 replies
  • Answer
  • March 11, 2023

Hi @dineshdhaker,

 

I see that you opened a Support ticket and that this issue was resolved by turning of Smart Sending on your flow. 

 

I’m going to throw the new version of that Developer Portal doc here for anyone else that might come across this:

 

Thanks for using the Community!

- Brian