Skip to content

Instantly share code, notes, and snippets.

@pasindud
Created January 11, 2015 15:08
Show Gist options
  • Select an option

  • Save pasindud/eab6a86f3d83e5096fc2 to your computer and use it in GitHub Desktop.

Select an option

Save pasindud/eab6a86f3d83e5096fc2 to your computer and use it in GitHub Desktop.
Ideamart PHP API Query Base
$url = "https://api.dialog.lk/subscription/query-base";
base($url,'APPID','password');
function base($url,$appid,$pw){
$arrayField = array("applicationId" => $appid,
"password" => $pw
);
$jsonStream = json_encode($arrayField);
$ch = curl_init($url);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch,CURLOPT_POST, 1);
curl_setopt($ch,CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch,CURLOPT_POSTFIELDS, $jsonStream);
curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
$res = curl_exec($ch);
curl_close($ch);
echo $res; // Debug
return json_decode($res);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment