Unfortunately, the fax API does not support base64 encoded (the sample code in the API reference is incorrect). This is the only way how you fax attachments.
... $request = $rcsdk->createMultipartBuilder() ->setBody(array( 'to' => array(array('phoneNumber' => $RECIPIENT)), 'faxResolution' => 'High', )) ->add(fopen('log.txt', 'r')) ->add(fopen('test.html', 'r')) ->add(fopen('test.jpg', 'r')) ->add(fopen('test.pdf', 'r')) ->request('/account/~/extension/~/fax'); $resp = $platform->sendRequest($request); print_r ("FAX sent. Message status: " . $resp->json()->messageStatus);
Thanks for responding @Phong Vu . Just curious then in the scenario I described, would I then have to just cache the pdf file on the server in a file, then fopen that file and send the fax with the attached pdf file with the code you sent me. That's really the only way then? Or is there any other way to do what Im trying to do.
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:
9 People are following this question.