• 指定模板单发接口text参数参考示例
  • Java
  • python
  • C Sharp
  • php

    指定模板单发接口text参数参考示例

    请参考如下示例对批量个性化发送接口中tpl_value参数传参

    Java

    1. String tpl_value = URLEncoder.encode("#company#",ENCODING) +"="
    2. + URLEncoder.encode("Yunpian", ENCODING) + "&"
    3. + URLEncoder.encode("#code#",ENCODING) + "="
    4. + URLEncoder.encode("1234",ENCODING);

    python

    1. tpl_value = urllib.urlencode({'#company#':'Yunpian','#code#':'1234'})

    C Sharp

    1. string tpl_value = HttpUtility.UrlEncode(
    2. HttpUtility.UrlEncode("#company#", Encoding.UTF8) + "=" +
    3. HttpUtility.UrlEncode("Yunpian", Encoding.UTF8) + "&" +
    4. HttpUtility.UrlEncode("#code#", Encoding.UTF8) + "=" +
    5. HttpUtility.UrlEncode("1234", Encoding.UTF8), Encoding.UTF8);

    php

    1. $data = array('tpl_id' => '1', 'tpl_value' => ('#company#').
    2. '='.urlencode('Yunpian').
    3. '&'.urlencode('#code#').
    4. '='.urlencode('1234'), 'apikey' => $apikey, 'mobile' => $mobile);