本文为您提供了JAVA语言版本的短信营销接口对接DEMO示例
// 接口类型:互亿无线营销短信批量发送DEMO
// 账户注册:请通过该地址开通账户 http://user.ihuyi.com/?AX7wLG
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.methods.PostMethod;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import util.StringUtil;
public class sendsms {
private static String Url = "http://api.ihuyi.com/sms-yx/v1/batchSend";
public static void main(String [] args) {
HttpClient client = new HttpClient();
PostMethod method = new PostMethod(Url);
client.getParams().setContentCharset("UTF-8");
method.setRequestHeader("ContentType", "application/json;charset=UTF-8");
// 需要修改的参数-开始
String api_id = "sms-xxxxxxxx";
String api_key = "xxxxxxxxxxxxxxxxxxx";
String[] phone = {"1366197xxxx","1366197xxxx"};
String sign_name = "互亿无线";
int product_id = 1018;
String content = new String("您好,短信内容,回T退订");
// 需要修改的参数-结束
long timest = System.currentTimeMillis() / 1000;
String timestamp = "" + timest;
String request_id = timestamp + (int)((Math.random()*9+1)*100000);
// 生成sign方式一
// Map