PHP余额查询接口代码示例
请求
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "/2/account/balance.html");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_POST, TRUE);
/*
设定微米账号的接口UID和接口密码
*/
curl_setopt($ch, CURLOPT_POSTFIELDS, 'uid=&pas=&type=json');
$res = curl_exec( $ch );
curl_close( $ch );
echo($res);
/*
注意:以上参数传入时不包括“<>”符号
*/
返回结果
{ "sms-left":157, "sms-sent":13, "sms-total":190, "mms-left":90, "mms-sent":10, "mms-total":100,
"ivr-left":90, "ivr-sent":10, "ivr-total":100, "gj-left":90, "gj-sent":10, "gj-total":100, "msg":"微米账户余额查询" }
请参考