question

tech demo avatar image
tech demo asked Phong Vu answered

How to send fax from different fax number to ringcentral number(account).

Want to send a fax from a different fax number to my ring central number or account(admin portal) using RingCentral sdk (fax API)


The code I am using is:-


require('vendor/autoload.php');

$dotenv = Dotenv\Dotenv::createImmutable(__DIR__ . '/../');

$dotenv->load();


$RECIPIENT = $_ENV['FAX_RECIPIENT'];


$rcsdk = new RingCentral\SDK\SDK( $_ENV['RC_CLIENT_ID'],

$_ENV['RC_CLIENT_SECRET'],

$_ENV['RC_SERVER_URL'] );

$platform = $rcsdk->platform();

$platform->login( [ "jwt" => $_ENV['RC_JWT'] ] );


$request = $rcsdk->createMultipartBuilder()

->setBody(array(

'to' => array(array('phoneNumber' => $RECIPIENT)),

'faxResolution' => 'High',

))

->add(fopen('test.jpg', 'r'))

->request('/account/~/extension/~/fax');


$resp = $platform->sendRequest($request);

print_r ("FAX sent. Message status: " . $resp->json()->messageStatus);

fax
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Phong Vu avatar image
Phong Vu answered

To send a fax message using the Fax API, you cannot set the "from" phone number. The server will choose the preselected fax number from your extension outbound Fax settings in your [user extension service portal](https://service.ringcentral.com). If you want to change the default Outbound Fax settings (send from a company Fax number) for your extension, login the admin portal and change the Fax number to your own number.

screen-shot-2023-05-08-at-83121-am.png


1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys