【问题标题】:Get error code 14 when sending SMS using smsapi使用 smsapi 发送短信时出现错误代码 14
【发布时间】:2019-02-21 20:10:48
【问题描述】:

我正在尝试使用来自 smsapi.pl 的 API 发送短信。目前我收到错误代码 14,意思是“无效的发件人字段”。

代码:

        $access_token = 'XXXXXX';          //sms api access token
        $numbers = '+7XXXXXXXX';
        $params = array(
            'to'            => $numbers,       
            'from'          => 'Info',    
            'message'       => 'message text',      
            );

        $c = curl_init();
        curl_setopt($c, CURLOPT_URL, 'https://api.smsapi.pl/sms.do');
        curl_setopt($c, CURLOPT_POST, true);
        curl_setopt($c, CURLOPT_POSTFIELDS, $params);
        curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($c, CURLOPT_HTTPHEADER, array(
              "Authorization: Bearer $access_token"
        ));

        $content = curl_exec($c);
        $http_status = curl_getinfo($c, CURLINFO_HTTP_CODE);

        curl_close($c);
        print_r($content);

【问题讨论】:

    标签: php api sms


    【解决方案1】:

    翻译后的documentation 说:

    只接受经过验证的名称。 (& 来自 = aktywna_nazwa)。需要在登录 SMSAPI 网站后添加 sender 字段,Sender Field 。

    您是否在website 上添加了发件人姓名Info

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-05-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多