Blog

Sample Broadcast API Code in PHP

Sample Broadcast API Code in PHP

Below is the sample broadcast API code is PHP, please replace the JSON data with your own data and submit

<?php

    //--API PARAMETERS ENCODED AS JSON--
    $JSON_DATA = '{"token":"API_TOKEN_XXXXXXX","priority ":0,"application":"1","sleep":0,"globalmessage":"test","globalmedia":"","data":[{"number":"MOBILE_NUMBER_1_WITH_COUNTRY_CODE","message":""},{"number":"MOBILE_NUMBER_2_WITH_COUNTRY_CODE","message":""}]}';
  

    //--CURL FUNCTION TO CALL THE API--
    $url = 'http://pickyassist.com/app/api/v2/push';

    $ch = curl_init($url);                                                                      
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");                                                                     
    curl_setopt($ch, CURLOPT_POSTFIELDS, $JSON_DATA);                                                                  
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);                                                                      
    curl_setopt($ch, CURLOPT_HTTPHEADER, array(                                                                          
        'Content-Type: application/json',                                                                                
        'Content-Length: ' . strlen($JSON_DATA))                                                                       
    );                                                                                                                   
                                                                                                                            
    $result = curl_exec($ch);

    //--API RESPONSE--
    print_r( json_decode($result,true) );


?>

 

Leave a Reply


Your email address will not be published. Required fields are marked *

Related Posts


June 6, 2019

Adding Widget Into WordPress

Adding Widget Into WordPress In this guide we will show how can add Picky Assist Chat Widget into a WordPress site in less than 5 minute. Watch Video Login into your WordPress Admin Account From the sidebar menu locate “Appearance” menu and click on it and from sub menu select “Editor” Editor may prompt for

May 29, 2019

Step By Step Getting Start Guide

Step By Step Getting Start Guide This guide will help you to get started with picky assist services , before getting start you must install and configure the picky assist bridge mobile app correctly in your mobile phone where the whatsapp, sms and call automation is required. You can refer following links , if you