Created
January 11, 2015 15:08
-
-
Save pasindud/eab6a86f3d83e5096fc2 to your computer and use it in GitHub Desktop.
Ideamart PHP API Query Base
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $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