How to Send Events to the SendPulse Bypassing Authorization

Sometimes there is a need to start a series of events with bypassing the stage of authorization in SendPulse email service

To be able to send an unauthorized event you will need to know the contact's email address and their phone number (at least one of these parameters)
Also, you will need the so-called Event Hash value — it consists of 32 characters, and you can find it here:

Log in to your SendPulse account, Open Automations menu

Open the Events Manager

Click on the event you need to activate

Copy the value from the Post Raw tab — it is the last two blocks of characters, displayed after the /id/ block

Send this value together with the contact's email address and/or phone number

Example for PHP

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://events.sendpulse.com/events/name/abandoned_shopping_cart_76',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
  "email": "test@site.com",
  "phone": "493034343434",
  "product_name": "product_name value",
  "product_id": 123,
  "product_link": "product_link value",
  "product_price": "product_price value",
  "product_img_url": "product_img_url value",
  "event_date": "2021-02-19"
}',
  CURLOPT_HTTPHEADER => array(
    'Authorization: YourBearerToken',
    'Content-Type: application/json',
    'Cookie: URL_LOGIN=%2Femailservice%2Fhelper'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Example for Python

import requests

url = "https://events.sendpulse.com/events/name/abandoned_shopping_cart_76"

payload="{\n  \"email\": \"test@site.com\",\n  \"phone\": \"493034343434\",\n  \"product_name\": \"product_name value\",\n  \"product_id\": 123,\n  \"product_link\": \"product_link value\",\n  \"product_price\": \"product_price value\",\n  \"product_img_url\": \"product_img_url value\",\n  \"event_date\": \"2021-02-19\"\n}"
headers = {
  'Authorization': 'YourBearerToken',
  'Content-Type': 'application/json',
  'Cookie': 'URL_LOGIN=%2Femailservice%2Fhelper'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
Rate this article about "How to Send Events to the SendPulse Bypassing Authorization"

User Rating: 5 / 5 (4)

  • email

Other useful articles

Popular in Our Blog

Try SendPulse today for free