微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

RingCentral API 在某些服务器上不起作用

如何解决RingCentral API 在某些服务器上不起作用

您好,我正在使用 RingCentral API 发送短信和彩信,并按照文档进行操作,但它在服务器上给我错误,因为它在本地系统上运行良好。

“客户端错误POST https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/~/sms 导致 400 Bad Request 响应”。

function send_mms($rcsdk,$platform,$fromNumber){

try{
    
   $RECIPIENT = '#########';
  
    
    $body = array(
             'from' => array ('phoneNumber' => $fromNumber),'to' => array(
                      array('phoneNumber' => $RECIPIENT)
                    )
           );
    $request = $rcsdk->createMultipartBuilder()
        ->setBody( $body )
        ->add(fopen(__DIR__.'/iphone.png','r'))
        ->request('/account/~/extension/~/sms');
    $r = $platform->sendRequest($request);
    print_r ("MMS sent. Message status: " . $r->json()->messageStatus . PHP_EOL);
}catch(\RingCentral\SDK\Http\ApiException $e) {
  //print '  Message: ' . $e->getMessage() . PHP_EOL;
  var_dump($e->getCode());
  var_dump($e->getMessage());
  var_dump($e->apiResponse()->response());
}
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。