SAREpush
  • INTRODUCTION
  • Platform Support
  • JAVASCRIPT LIBRARY
    • Installing library on website
    • Installing library through GTM
    • Tagging a subscriber using library
    • Preview subscriber's tags in our platform.
    • Sending shopping cart events using library
  • REST API
    • Introduction
    • Retrieving a list of websites
    • Retrieving JS code for specific website
    • Creating campaign to all subscribers
    • Creating campaign to particular locations
    • Creating campaign to particular tags
    • Creating campaign to particular segments
    • Sending message to specific subscriber
    • Sending message to test subscribers
    • Retrieving a list of segments
    • Retrieving a list of locations
    • Retrieving a list of tags
    • Retrieving a list of subscribers
  • PLUGINS
    • Installing WordPress plugin
  • CAMPAIGNS
    • Delivery automation
      • Welcome notification
      • When leave website
      • When visit specific web page
      • When spend X time on specific web page
    • Delivery to audience
      • Send to all subscribers
      • Send to particular segments
      • Send to particular tags
      • Send to test segment
    • Delivery scheduling
      • Send at a particular time
      • Sent recurring
    • Message personalization
    • Message preview
    • Message time to live
    • Images and icons
  • User management
    • User Management
    • Permission table
  • Product feed
    • What is XML Product Feed?
Powered by GitBook
On this page
  1. REST API

Retrieving JS code for specific website

To retrieve a JS code for specific website, submit a GET request to:

https://push-api.sare.pl/v1/websites/<YOUR_WEBSITE_UID>/code

PHP example

$url = "https://push-api.sare.pl/v1/websites/<YOUR_WEBSITE_UID>/code";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Basic <YOUR_API_KEY>']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);

Bash example

curl --include \
     --header "Authorization: Basic <YOUR_API_KEY>" \
     https://push-api.sare.pl/v1/websites/<YOUR_WEBSITE_UID>/code

Response example

<script>
!function(e,n,s,t,o){e.sarepush=e.sarepush||function(){(e.sarepush.q=e.sarepush.q||[]).push(arguments)},
t=n.createElement('script'),o=n.getElementsByTagName('script')[0],
t.async=1,t.src='//push-cdn.s3-eu-west-1.amazonaws.com/<ACCOUNT_ID>/<YOUR_WEBSITE_UID>/library.min.js',
o.parentNode.insertBefore(t,o)}(window,document);
</script>
PreviousRetrieving a list of websitesNextCreating campaign to all subscribers

Last updated 4 years ago