Ask a Question

Send to an Individual Subscriber

I don´t know whats is wrong. Im trying to senda test to a subscribed user using php. could you help me <?php $title = 'Titulo de Test'; $message = 'Test'; $url = 'http://segsoftware.com.br'; $subscriberId = '919fd2eec1c0e0304655a355a62e3fc0'; $apiToken = 'df06e4a9c1507e4f73945928375131d9'; $curlUrl = 'https://pushcrew.com/api/v1/send/individual/'; //set POST variables $fields = array( 'title' => $title, 'message' => $message, 'url' => $url, 'subscriber_id' => $subscriberId ); $httpHeadersArray = Array(); $httpHeadersArray[] = 'Authorization: key='.$apiToken; //open connection $ch = curl_init(); //set the url, number of POST vars, POST data curl_setopt($ch, CURLOPT_URL, $curlUrl); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($fields)); curl_setopt($ch, CURLOPT_HTTPHEADER, $httpHeadersArray); //execute post $result = curl_exec($ch); $resultArray = json_decode($result, true); if($resultArray['status'] == 'success') { //success //echo $resultArray['request_id']; //ID of Notification Request echo("sucess"); } else if($resultArray['status'] == 'failure') { //failure echo("erro1"); } else { //failure echo("erro2 " . $result); } //echo($subscriberId); ?>



Javascript API - Modal Translation

How can I translate the Javascript API modal's messages? I know that using the parameter "text" I can edit the default message. But what about in these cases "If User is already subscribed" and "If User had blocked"? At this point I'm using something like this: window._pcq.push(['triggerOptIn',{subscriberSegment: 'homepage', modal: {text: 'Receba alertas sobre nossa promoção!', blackenBackground: true}}]); Cheers

REST API 400 BAD Request

{ "status": "failure", "message": "URL cannot be empty" }


Hi, I need help I'm trying build a status message in view, like "Browser Enable" or "Browser Blocked". So, I made this: if(pushcrew.isAPIReady) { if (console.log(pushcrew.subscriberId) === false){ $('.inactive-push').attr("hidden",false); } else if (console.log(pushcrew.subscriberId) === -1){ $('.blocked-push').attr("hidden",false); } else { $('.active-push').attr("hidden",false); } } I can run this in console normally, and work right, but, when I try put this in my code, I get a error like "Uncaught ReferenceError: pushcrew is not defined"

Subscriber with problems

In last days,I saw some crazy problems, some users haven't receive push notification and others in the same group receive normaly, all this users have push notification ID, and have notification "alow" for pushcrew in browser and I checked the the permition and everything are okay. What I can check also?

Get List of Segments

Here in your documentation: http://api.pushcrew.com/docs/get-list-of-segments you tell to use a GET method but which variable do I have to pass? I created a segment category but I forgot to uncomment the result so I don't have an ID of my segment

Location of notofication

I need to know how i can to set location of notification? I need that it will be top-middle/ With cod like: <script type="text/javascript"> (function(p,u,s,h){ p._pcq=p._pcq||[]; p._pcq.push(['_currentTime',Date.now()]); s=u.createElement('script'); s.type='text/javascript'; s.async=true; s.src='https://cdn.pushcrew.com/js/e4eb09399a4d14f21e3142f0724e1ee9.js'; h=u.getElementsByTagName('script')[0]; h.parentNode.insertBefore(s,h); })(window,document); </script> I get it but i cant't to change content With PHP API i can to change content but location is buttom right! How i can to change location?

one click unsubscribe is not working

Hi Guys I am using below code to unsubscribe notification. _pcq.push(['triggerOptOut']); user is not able subscribe again until they click twice on unsubscribe button even after page refresh. suppose there is 2 button "subscribe" and "unsubscribe" which will display according to condition Here is the flow 1). user click on subscribe button and allow notificaiton from pushcrew.com then display "unsubscribe" button 2). user click on unsubscribe button which open window with help image, user unsubscribe with help of browser window option then display "subscribe" button 3). user click on subscribe button again but it does not work untill user click on unsubscribe button again -> open browser window and close it Please help me to track this issue, Thanks in Advance

Customizing PushCrew popup design with HTML/CSS?

Is it possible? I added some CSS to my page that seems to change some of the design, but it seems like most of the CSS is inline and cannot be overriden. I can't find anything about that in the docs. Can it be done?