Retrieving JS code for specific website
To retrieve a JS code for specific website, submit a GET request to:
1
https://push-api.sare.pl/v1/websites/<YOUR_WEBSITE_UID>/code
Copied!

PHP example

1
$url = "https://push-api.sare.pl/v1/websites/<YOUR_WEBSITE_UID>/code";
2
3
$ch = curl_init();
4
curl_setopt($ch, CURLOPT_URL, $url);
5
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Basic <YOUR_API_KEY>']);
6
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
7
$result = curl_exec($ch);
Copied!

Bash example

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

Response example

1
<script>
2
!function(e,n,s,t,o){e.sarepush=e.sarepush||function(){(e.sarepush.q=e.sarepush.q||[]).push(arguments)},
3
t=n.createElement('script'),o=n.getElementsByTagName('script')[0],
4
t.async=1,t.src='//push-cdn.s3-eu-west-1.amazonaws.com/<ACCOUNT_ID>/<YOUR_WEBSITE_UID>/library.min.js',
5
o.parentNode.insertBefore(t,o)}(window,document);
6
</script>
Copied!
Copy link
Contents