diff --git a/sdk.php b/sdk.php index 0a14fef6..c0e2b488 100644 --- a/sdk.php +++ b/sdk.php @@ -249,7 +249,7 @@ public static function build_http_query_multi($params) { foreach ($params as $parameter => $value) { - if( in_array($parameter, array('pic', 'image')) && $value{0} == '@' ) { + if( in_array($parameter, array('pic', 'image')) && $value[0] == '@' ) { $url = ltrim( $value, '@' ); $content = file_get_contents( $url ); $array = explode( '?', basename( $url ) ); diff --git a/sendsms.php b/sendsms.php index ee601c15..4a2ee352 100644 --- a/sendsms.php +++ b/sendsms.php @@ -3,21 +3,23 @@ include_once "config.php"; include_once "sdk.php"; - - - if($argc < 3){ - print "php ./sendsms.php '1377777777777|137888888888' 'UCLOUD'".PHP_EOL; + print "php ./sendsms.php '1377777777777|137888888888' '010086'".PHP_EOL; exit; } $conn = new UcloudApiClient(BASE_URL, PUBLIC_KEY, PRIVATE_KEY, PROJECT_ID); -$params['Action'] = "SendSms"; -$params["Content"] = $argv[2]; +$params['Action'] = "SendUSMSMessage"; $phones = explode("|", $argv[1]); foreach($phones as $key => $val){ - $params["Phone.".$key] = $val; + $params["PhoneNumbers.".$key] = $val; } +$params['SigContent'] = "..."; +$params['TemplateId'] = "..."; +$params['TemplateParams.0'] = $argv[2]; + +print_r($params); + print_r($response = $conn->get("/", $params));